Skip to content

UI Test Automation Demo using playwright framework in Typescript

Notifications You must be signed in to change notification settings

fsamiker/playwright-saucelab-demo

Repository files navigation

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

About

UI Test Automation Demo using playwright framework in Typescript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published