Skip to content

Commit ca69a21

Browse files
Adding Jenkins pipeline support (#7)
* creating new project using specflow plugin * Delete .DS_Store * removing .DS_Stores * Update .gitignore * specflow nunit glue fixes * adding single parallel and local testing * configuring local * adding capability file for on prem grid and machine browser updating readme file * removed app folder * changing naming conventions, removing comments and unused packages * changing naming conventions * created(Jenkinsfile): adding Jenkinsfile * updating dotnet command path * updating dotnet command path * updating dotnet command path * updating cd to navigate to solution dir * adding force copy * updating dotnet path * modifying capabilites-local.yml to add Local path from Jenkins step * updating Local path for Jenkins Co-authored-by: Samiran Saha <samiran.s89@gmail.com>
1 parent c9c2eaa commit ca69a21

2 files changed

Lines changed: 36 additions & 16 deletions

File tree

Jenkinsfile

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parallel
1414
single-local
1515
parallel-local
1616
''',
17-
defaultChoice: 'bstack-parallel'
17+
defaultChoice: 'parallel'
1818
],
1919
description: 'Select the test you would like to run',
2020
editable: false,
@@ -27,35 +27,55 @@ parallel-local
2727
checkout scm
2828
}
2929

30-
stage('Pull from Github') {
31-
dir('test') {
32-
git branch: 'nunit_runner_development', changelog: false, poll: false, url: 'https://github.com/browserstack/browserstack-examples-specflowplus.git'
33-
}
34-
}
35-
3630
stage('Run Test(s)') {
3731
browserstack(credentialsId: "${params.BROWSERSTACK_USERNAME}") {
32+
sh returnStatus:true, script:'''
33+
mkdir -p browserstack_examples_specflowplus/bin/Debug/netcoreapp3.1/BrowserStack/Webdriver/Resources
34+
echo 'DriverType: CloudDriver
35+
BaseUrl: http://localhost:3000
36+
CloudDriverConfig:
37+
HubUrl: https://hub-cloud.browserstack.com/wd/hub
38+
User:
39+
Key:
40+
LocalTunnel:
41+
IsEnabled: true
42+
LocalOptions:
43+
binarypath: /var/lib/jenkins/.browserstack/BrowserStackLocal
44+
CommonCapabilities:
45+
BStackOptions:
46+
projectName: BrowserStack Examples Specflow
47+
buildName: browserstack-examples-specflow
48+
debug: true
49+
networkLogs: true
50+
os: Windows
51+
osVersion: "11"
52+
local: true
53+
Platforms:
54+
- SessionCapabilities:
55+
PlatformOptions:
56+
BrowserVersion: latest
57+
' > browserstack_examples_specflowplus/BrowserStack/Webdriver/Resources/capabilities-local.yml
58+
cp -r browserstack_examples_specflowplus/BrowserStack/Webdriver/Resources/* browserstack_examples_specflowplus/bin/Debug/netcoreapp3.1/BrowserStack/Webdriver/Resources/
59+
/bin/dotnet build
60+
'''
61+
3862
if(TEST_TYPE == "single"){
3963
sh returnStatus:true,script: '''
40-
cd test
41-
dotnet test --filter Category=single
64+
/bin/dotnet test --filter Category=single
4265
'''
4366
} else if(TEST_TYPE == "single-local") {
4467
sh returnStatus:true,script: '''
45-
cd test
4668
export CAPABILITIES_FILENAME=capabilities-local.yml
47-
dotnet test --filter Category=single
69+
/bin/dotnet test --filter Category=single
4870
'''
4971
} else if(TEST_TYPE == "parallel-local"){
5072
sh returnStatus:true,script: '''
51-
cd test
5273
export CAPABILITIES_FILENAME=capabilities-local.yml
53-
dotnet test
74+
/bin/dotnet test
5475
'''
5576
} else {
5677
sh returnStatus:true,script: '''
57-
cd test
58-
dotnet test
78+
/bin/dotnet test
5979
'''
6080
}
6181
}

browserstack_examples_specflowplus/BrowserStack/Webdriver/Core/DriverFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class DriverFactory
2121
private readonly string BROWSERSTACK_ACCESS_KEY = "BROWSERSTACK_ACCESS_KEY";
2222
private readonly string BUILD_ID = "BROWSERSTACK_BUILD_NAME";
2323
private readonly string DEFAULT_BUILD_NAME = "browserstack_examples_specflow";
24-
public readonly string CAPABILITIES_DIR = "/Browserstack/Webdriver/Resources/";
24+
public readonly string CAPABILITIES_DIR = "/BrowserStack/Webdriver/Resources/";
2525
private readonly WebDriverConfiguration WebDriverConfiguration;
2626
private readonly string DefaultBuildSuffix;
2727
private readonly bool IsLocal;

0 commit comments

Comments
 (0)