-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (40 loc) · 1.27 KB
/
Jenkinsfile
File metadata and controls
48 lines (40 loc) · 1.27 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
pipeline {
agent any
environment {
REPO_URL = 'https://github.com/sstrohmeyer/browserstack.git' // My public repo
}
stages {
stage('Clone Repository') {
steps {
sh '''
# Clone the repository into the workspace
git clone ${REPO_URL} .
'''
}
}
stage('Run Tests') {
steps {
browserstack(credentialsId: 'browserstack_creds') {
sh '''
# Create a virtual environment
python3 -m venv venv
# Activate the virtual environment
. venv/bin/activate
# Install Selenium
pip install selenium
# Fetch and install Browserstack SDK
git clone -b sdk https://github.com/browserstack/python-selenium-browserstack
pip3 install -r ./python-selenium-browserstack/requirements.txt
# Run Browserstack
browserstack-sdk python ./tests/test.py
'''
}
}
}
}
post {
always {
cleanWs() // Clean workspace after the build
}
}
}