This example doesn't need Selenium installation locally. See more detail about standalone mode here.
- Pros: flexibility and better control
- Cons: can't use synchronous mode (because it's a part of
wdiotest runner)
A cloud testing service account is needed: Saucelabs, BrowserStack or TestingBot. This example uses TestingBot.
- Node.js is installed to your local system
- TestingBot account
- TestingBot key (set to
$TESTINGBOT_KEYas an environment variable) - TestingBot secret (set to
$TESTINGBOT_SECRETas an environment variable)
At the first, clone or download this dir. Then install dependencies:
$ npm installThis example has devDependencies below:
- Mocha: testing framework
- PhantomJS: browser for local testing
- WebdriverIO: WebDriver
Run the local test:
$ npm run test-localphantomjs
First Test Group
✓ gets the title of MDN toppage
Second Test Group
✓ gets the title of GitHub toppage
2 passing (702ms)
Run the cloud test:
$ npm run test-cloudfirefox - latest - WINDOWS
First Test Group
✓ gets the title of MDN toppage
Second Test Group
✓ gets the title of GitHub toppage
chrome - latest - WINDOWS
First Test Group
✓ gets the title of MDN toppage
Second Test Group
✓ gets the title of GitHub toppage
4 passing (46s)
Or run both:
$ npm testtest/e2e/first.js: the first group of testssecond.js: the second group of test
e2e.js: test runnerwebdriver.cloud.js: settings for the cloud environmentwebdriver.local.js: settings for the local environment
Note: basically you don't need to change e2e.js.