Last active
June 12, 2022 20:05
-
-
Save christian-bromann/3e2c3f8aea21f70f612650a85c50af2b to your computer and use it in GitHub Desktop.
WebdriverIO example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 <[email protected]>" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('run wdio test', () => { | |
it('should print out user agent', () => { | |
browser.url('https://www.whatismybrowser.com/') | |
console.log($('.string-major').getText()) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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