Skip to content

Commit a90a415

Browse files
authored
Merge pull request #10 from devpuppet/feature/add-report
Add Playwright report in Jenkins
2 parents 2abbb2d + 1b5b6a6 commit a90a415

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Jenkinsfile

+19-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,32 @@ pipeline {
66
}
77
}
88
stages {
9-
stage('build') {
9+
stage('Build') {
1010
steps {
1111
sh 'PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install'
1212
}
1313
}
14-
stage('test') {
14+
stage('Test') {
1515
steps {
1616
sh 'npm run test:pw'
1717
}
1818
}
19+
stage('Report') {
20+
steps {
21+
publishHTML (target : [allowMissing: false,
22+
alwaysLinkToLastBuild: true,
23+
keepAll: true,
24+
reportDir: 'playwright-report',
25+
reportFiles: 'index.html',
26+
reportName: 'Playwright Report',
27+
reportTitles: 'PW Report'])
28+
}
29+
}
30+
}
31+
post {
32+
always {
33+
archiveArtifacts artifacts: 'playwright-report/**/*.*', fingerprint: true
34+
junit 'test-results/**/*.xml'
35+
}
1936
}
2037
}

playwright.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default defineConfig({
88
trace: 'on',
99
screenshot: 'on'
1010
},
11-
reporter: [[ 'html', { open: 'never' }]]
11+
reporter: [
12+
[ 'html', { open: 'never' }],
13+
[ 'junit', { outputFile: 'test-results/e2e-junit-results.xml' }]
14+
]
1215
});
1316

0 commit comments

Comments
 (0)