-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsFile_TEST
65 lines (62 loc) · 1.99 KB
/
JenkinsFile_TEST
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 { label 'principal' }
tools {nodejs 'node'}
environment {
CHROME_BIN = '/bin/google-chrome'
}
stages {
stage('Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Prepare Tests') {
steps {
sh 'npm run pre:test'
}
}
stage('Test Execution in Desktop') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh 'npm run cypress:run:test:desktop'}
}
}
stage('Generate Report with Multiple Cucumber HTML Report') {
steps {
sh 'npm run generate:report'
}
}
stage('Generate Junit Report') {
steps {
sh 'npm run generate:junit:report'
}
}
stage('Generate TXT report') {
steps {
sh 'npm run generate:txt:report'
script {
def data = readfile(file:'cypress/reports/programming.txt')
println(data)
}
}
}
stage('Send Email') {
steps {
mail bcc: '',
body: "<b>Automation Cypress-Cucumber Tienda V9</b><br>Proyecto: ${env.JOB_NAME} <br> Número de Build: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL} <br> Reporte: ${env.BUILD_URL}execution/node/3/ws/cypress/reports/ <br> Duración: ${currentBuild.durationString.replace(' and counting', '')} <br>",
cc: '',
charset: 'UTF-8',
from: '',
mimeType: 'text/html',
replyTo: '',
subject: "Automation en Cypress de Tienda V9: ${env.JOB_NAME} - SMOKE",
}
}
}
post {
always {
junit 'cypress/reports/test_result.xml'
}
}
}