Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.43 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.43 KB

UI Automation Demo using Playwright

This is a UI test automation demo using Playwright typescript library

Demo is done based on a public test automation website maintained by Saucelabs Demo site

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

Prerequisites

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.

Setup

  1. Git Clone this repo
  2. install dependancies npm install
  3. Create .env file
TEST_USER=<username>
TEST_PASSWORD=<password>
BASE_URL=<saucelab demo site>

Running Tests

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