-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
49 lines (42 loc) · 1.2 KB
/
Jenkinsfile
File metadata and controls
49 lines (42 loc) · 1.2 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
pipeline {
agent any
triggers {
// Runs at 3 AM every day
cron('H 3 * * *')
}
parameters {
// Create a choice parameter named 'TEST'
choice(name: 'TEST', choices: ['PurchaseOrderTest'], description: 'Seleccione el test a ejecutar')
}
options {
githubProjectProperty(projectUrlStr: "https://github.com/jmr85/saucedemo-selenium-java")
}
tools {
maven 'apache-maven-3.9.8'
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/jmr85/saucedemo-selenium-java.git'
}
}
stage('Build and Test') {
steps {
script {
if (isUnix()) {
sh "mvn test -P=${params.TEST}"
} else {
bat "mvn test -P=${params.TEST}"
}
}
}
}
}
post {
always {
// Generate a TestNG report based on the test results
// You must previously have TestNG Results Plugin installed in Jenkins
testNG(reportFilenamePattern: '**/testng-results.xml')
}
}
}