Skip to content

Commit 99f2f9e

Browse files
committed
chore: configure build and environment for Playwright testing
- Update build.gradle with test profile configuration - Add playwright test artifacts to .gitignore - Update application.yml with test-related settings
1 parent e08f973 commit 99f2f9e

3 files changed

Lines changed: 48 additions & 2 deletions

File tree

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,10 @@ application-local.yml
138138
/repomix-output.txt
139139
src/main/resources/application-docker-keycloak.yml
140140
.vscode/
141+
142+
# Playwright
143+
playwright/node_modules/
144+
playwright/test-results/
145+
playwright/playwright-report/
146+
playwright/reports/
147+
playwright/.env

build.gradle

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repositories {
3939

4040
dependencies {
4141
// DigitalSanctuary Spring User Framework
42-
implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.2'
42+
implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.3-SNAPSHOT'
4343

4444
// Spring Boot starters
4545
implementation 'org.springframework.boot:spring-boot-starter-actuator'
@@ -127,3 +127,42 @@ bootRun {
127127
environment SPRING_PROFILES_ACTIVE: profiles
128128
}
129129
}
130+
131+
// Playwright Test Integration
132+
tasks.register('playwrightInstall', Exec) {
133+
description = 'Install Playwright dependencies'
134+
group = 'verification'
135+
workingDir 'playwright'
136+
commandLine 'npm', 'install'
137+
}
138+
139+
tasks.register('playwrightBrowsers', Exec) {
140+
description = 'Install Playwright browsers'
141+
group = 'verification'
142+
workingDir 'playwright'
143+
commandLine 'npx', 'playwright', 'install'
144+
dependsOn 'playwrightInstall'
145+
}
146+
147+
tasks.register('playwrightTest', Exec) {
148+
description = 'Run Playwright E2E tests'
149+
group = 'verification'
150+
workingDir 'playwright'
151+
commandLine 'npx', 'playwright', 'test'
152+
dependsOn 'playwrightBrowsers'
153+
}
154+
155+
tasks.register('playwrightTestChromium', Exec) {
156+
description = 'Run Playwright E2E tests on Chromium only'
157+
group = 'verification'
158+
workingDir 'playwright'
159+
commandLine 'npx', 'playwright', 'test', '--project=chromium'
160+
dependsOn 'playwrightBrowsers'
161+
}
162+
163+
tasks.register('playwrightReport', Exec) {
164+
description = 'Show Playwright test report'
165+
group = 'verification'
166+
workingDir 'playwright'
167+
commandLine 'npx', 'playwright', 'show-report'
168+
}

src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ user:
117117
bcryptStrength: 12 # The bcrypt strength to use for password hashing. The higher the number, the longer it takes to hash the password. The default is 12. The minimum is 4. The maximum is 31.
118118
testHashTime: true # If true, the test hash time will be logged to the console on startup. This is useful for determining the optimal bcryptStrength value.
119119
defaultAction: deny # The default action for all requests. This can be either deny or allow.
120-
unprotectedURIs: /,/index.html,/favicon.ico,/apple-touch-icon-precomposed.png,/css/*,/js/*,/js/user/*,/js/event/*,/img/**,/user/registration,/user/resendRegistrationToken,/user/resetPassword,/user/registrationConfirm,/user/changePassword,/user/savePassword,/oauth2/authorization/*,/login,/user/login,/user/login.html,/swagger-ui.html,/swagger-ui/**,/v3/api-docs/**,/event/,/event/list.html,/event/**,/about.html,/error,/error.html # A comma delimited list of URIs that should not be protected by Spring Security if the defaultAction is deny.
120+
unprotectedURIs: /,/index.html,/favicon.ico,/apple-touch-icon-precomposed.png,/css/*,/js/*,/js/user/*,/js/event/*,/js/utils/*,/img/**,/user/registration,/user/resendRegistrationToken,/user/resetPassword,/user/registrationConfirm,/user/changePassword,/user/savePassword,/oauth2/authorization/*,/login,/user/login,/user/login.html,/swagger-ui.html,/swagger-ui/**,/v3/api-docs/**,/event/,/event/list.html,/event/**,/about.html,/error,/error.html # A comma delimited list of URIs that should not be protected by Spring Security if the defaultAction is deny.
121121
protectedURIs: /protected.html # A comma delimited list of URIs that should be protected by Spring Security if the defaultAction is allow.
122122
disableCSRFdURIs: /no-csrf-test # A comma delimited list of URIs that should not be protected by CSRF protection. This may include API endpoints that need to be called without a CSRF token.
123123

0 commit comments

Comments
 (0)