Skip to content

Instantly share code, notes, and snippets.

@christian-bromann
Last active June 12, 2022 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christian-bromann/3e2c3f8aea21f70f612650a85c50af2b to your computer and use it in GitHub Desktop.
Save christian-bromann/3e2c3f8aea21f70f612650a85c50af2b to your computer and use it in GitHub Desktop.
WebdriverIO example
{
"name": "wdio-examples",
"version": "1.0.0",
"description": "WebdriverIO examples",
"dependencies": {
"wdio-sauce-service": "^0.3.0",
"wdio-selenium-standalone-service": "^0.0.7",
"wdio-spec-reporter": "0.0.3",
"webdriverio": "^4.4.0"
},
"scripts": {
"local": "wdio wdio.local.conf.js",
"sauce": "wdio wdio.sauce.conf.js"
},
"author": "Christian Bromann <christian@saucelabs.com>"
}
describe('run wdio test', () => {
it('should print out user agent', () => {
browser.url('https://www.whatismybrowser.com/')
console.log($('.string-major').getText())
})
})
exports.config = {
specs: ['test.js'],
capabilities: [{
browserName: 'firefox' // latest
}, {
browserName: 'firefox', // developer version
firefox_binary: '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox'
}],
services: ['selenium-standalone'],
seleniumLogs: 'selenium.log',
seleniumInstallArgs: { version: '3.0.1' },
seleniumArgs: { version: '3.0.1' },
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 30000
},
}
exports.config = {
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
specs: ['test.js'],
capabilities: [{
browserName: 'firefox', // v52
platform: 'Windows 10',
version: 'dev'
}, {
browserName: 'firefox', // v51
platform: 'Windows 10',
version: 'beta'
}, {
browserName: 'firefox', // v50
platform: 'Windows 10',
version: '50'
}, {
deviceName: 'Samsung Galaxy S7 Device',
browserName: 'chrome',
platformName: 'Android',
platformVersion: '6.0'
}],
services: ['sauce'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 30000
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment