-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (50 loc) · 1.35 KB
/
Copy pathJenkinsfile
File metadata and controls
55 lines (50 loc) · 1.35 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
#!/usr/bin/env groovy
pipeline {
agent any
environment {
TAG = "demo_${env.BRANCH_NAME}_${env.BUILD_NUMBER}"
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Cleaning and preparing") {
steps {
sh """#!/bin/bash -e
git clean -dfx
mkdir reports
"""
}
}
stage('Run Selenium Tests') {
steps {
try {
sh """#!/bin/bash -e
# Build, create and start containers in a background
docker-compose -p ${TAG} up -d --build
"""
sh """#!/bin/bash -e
# Wait for chromemode to be up and execute selenium tests in robottests container
docker-compose -p ${TAG} run robottests -t 15 chromenode:5555 -- robot -d reports -x xunit --variablefile variables/config.py --variable BROWSER:chrome tests/
"""
} finally {
publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'reports',
reportFiles: 'report.html',
reportName: 'Robot Framework Test Execution Report'
]
junit 'reports/*.xml'
sh """#!/bin/bash
# Stop and remove the containers
docker-compose -p ${TAG} down
"""
}
}
}
}
}