-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
65 lines (56 loc) · 1.72 KB
/
Copy pathJenkinsfile
File metadata and controls
65 lines (56 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pipeline {
agent any
tools {
nodejs 'NodeJS_LTS_24.16.0' // Must match the NodeJS installation name configured in Jenkins global tools
allure 'Allure_CMD_2.40.0' // Must match the Allure installation name configured in Jenkins global tools
}
stages {
stage('Prepare .env') {
environment {
SECRETS_ENV = credentials('playwright-api-testing-secrets') // Must match the secret file credential ID in Jenkins
}
steps {
bat '''
if exist .env del .env
copy "%SECRETS_ENV%" .env
'''
}
}
stage('Install Dependencies') {
steps {
bat 'call npm ci --no-audit --no-fund'
}
}
stage('Install Chromium') {
steps {
bat 'call npx playwright install chromium'
}
}
stage('Run Tests') {
steps {
bat 'call npx playwright test'
}
}
}
post {
always {
bat 'if exist .env del .env'
junit 'test-results/junit-results.xml'
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'playwright-report',
reportFiles: 'index.html',
reportName: 'Playwright HTML Report'
])
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'allure-results']]
])
}
}
}