Skip to content

Commit 8dd5abe

Browse files
authored
Update JenkinsFile
1 parent 2aa3731 commit 8dd5abe

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

JenkinsFile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,27 @@ pipeline {
1414
}
1515
stage('Install Dependencies') {
1616
steps {
17-
script {
18-
// Ensure you use Node 16 or higher for Playwright
19-
sh 'npm ci'
20-
}
17+
// Ensure dependencies are installed using npm ci
18+
sh 'npm ci'
2119
}
2220
}
2321
stage('Run Playwright Tests') {
2422
steps {
25-
script {
26-
// Run Playwright tests
27-
sh 'npx playwright test --grep PlaywrightWithJenkins' // You can specify browsers or configurations
28-
}
23+
// Run Playwright tests using npx
24+
sh 'npx playwright test --project=firefox' // You can specify browsers or configurations
2925
}
3026
}
3127
stage('Cleanup') {
3228
steps {
33-
script {
34-
// Clean up if needed, like removing temp files
35-
}
29+
// Clean up after the tests, if needed
30+
sh 'rm -rf node_modules' // Example cleanup step
3631
}
3732
}
3833
}
3934

4035
post {
4136
always {
42-
// Ensure Playwright is cleaned up after the tests, even if they fail
37+
// Ensure workspace is cleaned up after the tests, even if they fail
4338
cleanWs()
4439
}
4540
success {

0 commit comments

Comments
 (0)