Skip to content

Commit

Permalink
Merged sdk branch to merge_sdk_to_master
Browse files Browse the repository at this point in the history
  • Loading branch information
khrithik96 committed Jun 21, 2024
2 parents e3479bf + 342c296 commit 6bb02cb
Show file tree
Hide file tree
Showing 8 changed files with 719 additions and 330 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tests_output
local.log
node_modules
usage.log
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

## Running your tests

- To run tests, run `npm run parallel`
- To run local tests, run `npm run local`
- To run tests, run `npm run sample-test`
- To run local tests, run `npm run sample-local-test`

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

Expand Down
12 changes: 3 additions & 9 deletions environments.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
const common_capabilities = {
'buildName': 'browserstack-build-1',
'userName': '${BROWSERSTACK_USERNAME}',
'accessKey': '${BROWSERSTACK_ACCESS_KEY}',
'debug': true
};
module.exports = {
test_settings: {
default: {},
Expand All @@ -14,7 +8,7 @@ module.exports = {
"browserVersion": "103.0",
"os": "Windows",
"osVersion": "11",
...common_capabilities
"debug": true
}
}
},
Expand All @@ -25,7 +19,7 @@ module.exports = {
"browserVersion": "102.0",
"os": "Windows",
"osVersion": "10",
...common_capabilities
"debug": true
}
}
},
Expand All @@ -36,7 +30,7 @@ module.exports = {
"browserVersion": "14.1",
"os": "OS X",
"osVersion": "Big Sur",
...common_capabilities
"debug": true
}
}
}
Expand Down
51 changes: 8 additions & 43 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
const additonalEnvironments = require("./environments");
const { getLocalIdentifier } = require("./scripts/local-identifier");

if(!additonalEnvironments.test_settings)
additonalEnvironments.test_settings = {};

const bstackOptions = {
'bstack:options' : {
"os" : "OS X",
"osVersion" : "Big Sur",
"buildName" : "browserstack-build-1",
"sessionName" : "BStack nightwatch snippet",
"source": "nightwatch:sample-master:v1.1",
"local" : "false",
"seleniumVersion" : "4.0.0",
userName: '${BROWSERSTACK_USERNAME}',
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
},
}

const localBstackOptions = {
'bstack:options' : {
"os" : "OS X",
"osVersion" : "Big Sur",
"buildName" : "browserstack-build-1",
"sessionName" : "BStack nightwatch snippet",
"source": "nightwatch:sample-master:v1.1",
"local" : "true",
"localIdentifier": getLocalIdentifier(),
"source": "nightwatch:sample-sdk:v1.0",
"seleniumVersion" : "4.0.0",
userName: '${BROWSERSTACK_USERNAME}',
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
userName: '${BROWSERSTACK_USERNAME}' || 'YOUR_USERNAME',
accessKey: '${BROWSERSTACK_ACCESS_KEY}' || 'YOUR_ACCESS_KEY',
},
}

Expand All @@ -49,14 +32,18 @@ const browserStack = {
},

desiredCapabilities: {
browserName: 'chrome',
browserName: 'chrome',
...bstackOptions
}
}

const nightwatchConfigs = {
src_folders: [],
live_output: true,
plugins: ['@nightwatch/browserstack'],
'@nightwatch/browserstack': {
browserstackLocal: true // set true to manage browserstack local tunnel. Defaults to false.
},

test_settings: {
default: {
Expand Down Expand Up @@ -87,28 +74,6 @@ const nightwatchConfigs = {
browserName: 'Edge',
...bstackOptions
}
},
// capabilities to run local test on BrowserStack
'browserstack.local': {
...browserStack,
desiredCapabilities: {
browserName: 'chrome',
...localBstackOptions
},
},
'browserstack.local_chrome': {
...browserStack,
desiredCapabilities: {
browserName: 'chrome',
...localBstackOptions
}
},
'browserstack.local_firefox': {
...browserStack,
desiredCapabilities: {
browserName: 'firefox',
...localBstackOptions
}
}
}
}
Expand Down
Loading

0 comments on commit 6bb02cb

Please sign in to comment.