a front-end test automation framework using webdriverio and mocha, designed with high portability as a priority.
- Node.js (node, npm)
- some browsers
-
Install Node.js
- Recommended: Use
nvmto manage multiple versions of Node.js on your box. install using the following command in your terminal:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash- Install at least node 10 on your machine
nvm install 10 - Recommended: Use
-
Generate & Add SSH key:
-
Install your dependencies
npm install -
Copy the
.envschemafile to.envand fill your BrowserStack credentials into the two keys. if you need credentials reach out to your tech/qa leadcp .envschema .env -
once you've specified valid BrowserStack credentials, run
npm googleto execute some tests and see what happens.npm run google -
If you don't have BrowserStack credentials:
npm run google:local
feel free to check the package.json for available scripts. and their configs
This is a tutorial aimed at non technical people to get their very first test running, regard it as a springboard for diving into Automated Testing using this boilerplate:
- This boilerplate:
- Standardizes the organization of your tests.
- Simplifies the use of Selenium webdriver through the Page Object pattern.
- Demonstrates preferred test code and patterns.
- Use the examples under the listed directories to better understand how to write your tests.
examples/Amazon: Sample tests against https://www.amazon.com. Uses Page Object pattern.examples/Google: Sample tests against https://www.google.com. Uses Page Object pattern.examples/antipatterns: Suggested practices to NOT follow.
- For your own tests, use the
testfolder as your scaffolding.test: contains example code running against https://www.hugeinc.com.- Feel free to add/modify/remove tests as needed from this folder.
- Configure WebdriverIO using the files at
test/wdio.conf*.js.test/wdio.conf.js: Uses a remote testing service such as BrowserStack or LambdaTest.test/wdio.conf.local.js: Uses your local browsers and webdriver installations.
- Write your tests under
test/specs,test/E2E, ortest/Integration.- You may use any folder name under
testthat you like to organize your tests.
- You may use any folder name under
- Isolate any webdriver interactions inside page/component objects under
test/page_objects,test/component_objects, etc.
If you've made it this far down the readme, i'm assuming you seek more than just the above tl;dr, you can reach out to the #wdio-boilerplate room on Huge Slack for any guidance or conversation.