Auto testing with WebdriverIO(v4)
- macOS(I didn’t test this repo on Windows, but WebdriverIO and Selenium worked fine on Windows).
- Chrome and JDK is installed.
- NodeJS version >= 6.
$ npm install
.- Install drivers:
$ ./node_modules/.bin/selenium-standalone install
.
Create a HTTP server: $ npm run http
.
$ npm run test:local
.
$ npm run test:ci
.
If you wanted to run tests in Travis CI, please read this doc for more info: https://docs.travis-ci.com/user/chrome , it also supports Firefox https://docs.travis-ci.com/user/firefox .
Please read the official doc provided by BrowserStack https://www.browserstack.com/automate/webdriverio .
Please make sure your VPN is connected during tests, standalone-service sends few requests to googleapis.com before running tests, which are blocked in mainland China.
If you don’t have a VPN, please uncomment the selenium-standalone service in ./tests/configs/base.js and use $ npm run selenium
to start Selenium server manually.
Please follow this troubleshooting steps to fix it: http://stackoverflow.com/a/40837196/4480674.
This problem often happens on some Linux distributions e.g. Ubuntu, XUbuntu.
Please follow this to fix it: http://unix.stackexchange.com/a/138941.