- Download and install Node.js
- Download and install any Text Editor like Visual Code/Sublime/Brackets
- Install GitLens Extension from the Marketplace:
GitLens — Git supercharged by GitKraken
- Go to Visual Code Preference > Setting and search
formatOnSave
and enable/ON it.
- Clone the repository into a folder
- Go to Project root directory and install Dependency:
npm install
- All the dependencies from package.json would be installed in node_modules folder.
- Add new spec under
test
folder - Name the file as .e2e.js (e.g. login.e2e.js)
- Create page object under pageobjects/ folder as .page.js (e.g. login.page.js)
- Go to Project root directory and run command:
npm run wdio
- If you want to run api tests then run command:
npm run wdio:api
- Go to Project root directory and run command:
npm update
- Go to Project root directory:
./allure-results/index.html
- SauceLabs Quickstart
https://docs.saucelabs.com/web-apps/automated-testing/playwright/quickstart/
- Set Environment Variables:
- Open Terminal
- Run
touch ~/.bash_profile; open ~/.bash_profile
- In TextEdit, add
export SAUCE_USERNAME=“YOUR USERNAME”
export SAUCE_ACCESS_KEY="YOUR ACCESS KEY"
- Save the .bash_profile file and Quit (Command + Q) Text Edit.
- In Terminal echo $SAUCE_USERNAME
- In Terminal echo $SAUCE_ACCESS_KEY
- Set Environment Variables:
- Configure
https://docs.saucelabs.com/secure-connections/sauce-connect/setup-configuration/basic-setup/
- Open Terminal
- Run
cd sc-4.8.0-osx/bin
- Again run tests:
./sc -u YourUsername -k YourAccessKey --region us-west --tunnel-name YourTunnelName