forked from LambdaTest/nightwatch-selenium-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
50 lines (41 loc) · 1.08 KB
/
Jenkinsfile
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
#!/usr/bin/env groovy
node {
withEnv(["LT_USERNAME=Your LambdaTest UserName",
"LT_ACCESS_KEY=Your LambdaTest Access Key",
"LT_TUNNEL=true"]){
echo env.LT_USERNAME
echo env.LT_ACCESS_KEY
stage('setup') {
// Get some code from a GitHub repository
try{
git 'https://github.com/LambdaTest/nightwatch-selenium-sample.git'
//Download Tunnel Binary
sh "wget http://downloads.lambdatest.com/tunnel/linux/64bit/LT_Linux.zip"
//Required if unzip is not installed
sh 'sudo apt-get install --no-act unzip'
sh 'unzip -o LT_Linux.zip'
//Starting Tunnel Process
sh "./LT -user ${env.LT_USERNAME} -key ${env.LT_ACCESS_KEY} &"
sh "rm -rf LT_Linux.zip"
}
catch (err){
echo err
}
}
stage('build') {
// Installing Dependencies
sh 'npm install'
}
stage('test') {
try{
sh './node_modules/.bin/nightwatch -e chrome,edge tests'
}
catch (err){
echo err
}
}
stage('end') {
echo "Success"
}
}
}