Skip to content

Commit

Permalink
Merge pull request #49 from browserstack/selenium-4
Browse files Browse the repository at this point in the history
Selenium 4 to master
  • Loading branch information
francisf authored Jul 26, 2022
2 parents 2e39c1a + b0750e5 commit 6ef9517
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 94 deletions.
156 changes: 63 additions & 93 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,111 +1,81 @@
module.exports = {
// An array of folders (excluding subfolders) where your tests are located;
// if this is not specified, the test source must be passed as the second argument to the test runner.
src_folders: [],
const bstackOptions = {
'bstack:options' : {
"os" : "OS X",
"osVersion" : "Sierra",
"buildName" : "Final-Snippet-Test",
"sessionName" : "Selenium-4 Nodejs snippet test",
"local" : "false",
"seleniumVersion" : "4.0.0",
userName: '${BROWSERSTACK_USERNAME}',
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
},
}

// See https://nightwatchjs.org/guide/working-with-page-objects/using-page-objects.html
page_objects_path: ['node_modules/nightwatch/examples/pages/'],

// See https://nightwatchjs.org/guide/extending-nightwatch/custom-commands.html
custom_commands_path: ['node_modules/nightwatch/examples/custom-commands/'],
const browserStack = {
webdriver: {
start_process: false
},

// See https://nightwatchjs.org/guide/extending-nightwatch/custom-assertions.html
custom_assertions_path: '',
selenium: {
host: 'hub-cloud.browserstack.com',
port: 443
},

// See https://nightwatchjs.org/guide/extending-nightwatch/plugin-api.html
plugins: [],

// See https://nightwatchjs.org/guide/#external-globals
globals_path : '',
desiredCapabilities: {
browserName: 'chrome',
...bstackOptions
}
}

webdriver: {},
module.exports = {
src_folders: [],

test_settings: {
//////////////////////////////////////////////////////////////////////////////////
// Please set the username and access key by setting the environment variables: |
// - BROWSERSTACK_USERNAME |
// - BROWSERSTACK_ACCESS_KEY |
// .env files are supported |
//////////////////////////////////////////////////////////////////////////////////
browserstack: {
selenium: {
host: 'hub.browserstack.com',
port: 443
},
// More info on configuring capabilities can be found on:
// https://www.browserstack.com/automate/capabilities?tag=selenium-4
desiredCapabilities: {
'bstack:options' : {
userName: '${BROWSERSTACK_USERNAME}',
accessKey: '${BROWSERSTACK_ACCESS_KEY}',
buildName: 'browserstack-build-1'
},
browserName: 'chrome',
browserVersion: 'latest'
},

disable_error_log: true,
webdriver: {
timeout_options: {
timeout: 120000,
retry_attempts: 3
},
keep_alive: true,
start_process: false
}
default: {
launch_url: 'https://nightwatchjs.org'
},

'browserstack.local': {
extends: 'browserstack',
desiredCapabilities: {
'browserstack.local': true
}
browserstack: {
...browserStack
},

'browserstack.chrome': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions : {
w3c: true
}
"browserstack.chrome": {
...browserStack,
desiredCapabilities:{
browserName: 'chrome',
...bstackOptions
}
},

'browserstack.firefox': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'firefox'
"browserstack.firefox": {
...browserStack,
desiredCapabilities:{
browserName: 'firefox',
...bstackOptions
}
},

'browserstack.ie': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'internet explorer',
browserVersion: '11.0'
}
},

'browserstack.safari': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'safari'
"browserstack.edge": {
...browserStack,
desiredCapabilities:{
browserName: 'Edge',
...bstackOptions
}
},

'browserstack.local_chrome': {
extends: 'browserstack.local',
desiredCapabilities: {
browserName: 'chrome'
}
},

'browserstack.local_firefox': {
extends: 'browserstack.local',
// capabilities to run local test on BrowserStack
'browserstack.local': {
...browserStack,
desiredCapabilities: {
browserName: 'firefox'
}
},
browserName: 'chrome',
'bstack:options' : {
"os" : "OS X",
"osVersion" : "Sierra",
"buildName" : "Final-Snippet-Test",
"sessionName" : "Selenium-4 Nodejs snippet test",
"local" : "true",
"seleniumVersion" : "4.0.0",
userName: '${BROWSERSTACK_USER}',
accessKey: '${BROWSERSTACK_KEY}',
},
}
}
}
};
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ef9517

Please sign in to comment.