This is a UI test automation demo using Playwright typescript library
Demo is done based on a public test automation website maintained by Saucelabs
Several designs and test methods are demonstrated in this demo such as:
- Feature & Flow tests
- Parametrized tests, Test repeated with multiple different parameters
- Reused login state shared between tests
- Node.js
- Demo website to be live, https://www.saucedemo.com/
Note: The demo site was arbitarily chosen and is not maintained by me. The website could change from the time of writing of this repository thus the tests may fail. At the time of writing however the tests are written to expect to pass.
- Git Clone this repo
- install dependancies
npm install
- Create
.env
file
TEST_USER=<username>
TEST_PASSWORD=<password>
BASE_URL=<saucelab demo site>
Ensure cli is in projects root directory
Run all tests
npm run test
Run test by tag
npx playwright test --grep @flow
npx playwright test --grep @feature
npx playwright test --grep @auth
npx playwright test --grep @snapshot
Run test by file
npx playwright test tests/products.sort.test.ts
npx playwright test tests/login.success.test.ts