Skip to content

Commit 6bb02cb

Browse files
author
Hrithik Katiyar
committed
Merged sdk branch to merge_sdk_to_master
2 parents e3479bf + 342c296 commit 6bb02cb

8 files changed

+719
-330
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
tests_output
22
local.log
33
node_modules
4+
usage.log

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
## Running your tests
2121

22-
- To run tests, run `npm run parallel`
23-
- To run local tests, run `npm run local`
22+
- To run tests, run `npm run sample-test`
23+
- To run local tests, run `npm run sample-local-test`
2424

2525
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
2626

environments.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
const common_capabilities = {
2-
'buildName': 'browserstack-build-1',
3-
'userName': '${BROWSERSTACK_USERNAME}',
4-
'accessKey': '${BROWSERSTACK_ACCESS_KEY}',
5-
'debug': true
6-
};
71
module.exports = {
82
test_settings: {
93
default: {},
@@ -14,7 +8,7 @@ module.exports = {
148
"browserVersion": "103.0",
159
"os": "Windows",
1610
"osVersion": "11",
17-
...common_capabilities
11+
"debug": true
1812
}
1913
}
2014
},
@@ -25,7 +19,7 @@ module.exports = {
2519
"browserVersion": "102.0",
2620
"os": "Windows",
2721
"osVersion": "10",
28-
...common_capabilities
22+
"debug": true
2923
}
3024
}
3125
},
@@ -36,7 +30,7 @@ module.exports = {
3630
"browserVersion": "14.1",
3731
"os": "OS X",
3832
"osVersion": "Big Sur",
39-
...common_capabilities
33+
"debug": true
4034
}
4135
}
4236
}

nightwatch.conf.js

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
11
const additonalEnvironments = require("./environments");
2-
const { getLocalIdentifier } = require("./scripts/local-identifier");
32

43
if(!additonalEnvironments.test_settings)
54
additonalEnvironments.test_settings = {};
65

76
const bstackOptions = {
8-
'bstack:options' : {
9-
"os" : "OS X",
10-
"osVersion" : "Big Sur",
11-
"buildName" : "browserstack-build-1",
12-
"sessionName" : "BStack nightwatch snippet",
13-
"source": "nightwatch:sample-master:v1.1",
14-
"local" : "false",
15-
"seleniumVersion" : "4.0.0",
16-
userName: '${BROWSERSTACK_USERNAME}',
17-
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
18-
},
19-
}
20-
21-
const localBstackOptions = {
227
'bstack:options' : {
238
"os" : "OS X",
249
"osVersion" : "Big Sur",
2510
"buildName" : "browserstack-build-1",
2611
"sessionName" : "BStack nightwatch snippet",
27-
"source": "nightwatch:sample-master:v1.1",
28-
"local" : "true",
29-
"localIdentifier": getLocalIdentifier(),
12+
"source": "nightwatch:sample-sdk:v1.0",
3013
"seleniumVersion" : "4.0.0",
31-
userName: '${BROWSERSTACK_USERNAME}',
32-
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
14+
userName: '${BROWSERSTACK_USERNAME}' || 'YOUR_USERNAME',
15+
accessKey: '${BROWSERSTACK_ACCESS_KEY}' || 'YOUR_ACCESS_KEY',
3316
},
3417
}
3518

@@ -49,14 +32,18 @@ const browserStack = {
4932
},
5033

5134
desiredCapabilities: {
52-
browserName: 'chrome',
35+
browserName: 'chrome',
5336
...bstackOptions
5437
}
5538
}
5639

5740
const nightwatchConfigs = {
5841
src_folders: [],
5942
live_output: true,
43+
plugins: ['@nightwatch/browserstack'],
44+
'@nightwatch/browserstack': {
45+
browserstackLocal: true // set true to manage browserstack local tunnel. Defaults to false.
46+
},
6047

6148
test_settings: {
6249
default: {
@@ -87,28 +74,6 @@ const nightwatchConfigs = {
8774
browserName: 'Edge',
8875
...bstackOptions
8976
}
90-
},
91-
// capabilities to run local test on BrowserStack
92-
'browserstack.local': {
93-
...browserStack,
94-
desiredCapabilities: {
95-
browserName: 'chrome',
96-
...localBstackOptions
97-
},
98-
},
99-
'browserstack.local_chrome': {
100-
...browserStack,
101-
desiredCapabilities: {
102-
browserName: 'chrome',
103-
...localBstackOptions
104-
}
105-
},
106-
'browserstack.local_firefox': {
107-
...browserStack,
108-
desiredCapabilities: {
109-
browserName: 'firefox',
110-
...localBstackOptions
111-
}
11277
}
11378
}
11479
}

0 commit comments

Comments
 (0)