Skip to content

adequatica/ui-testing

Repository files navigation

UI Testing with TypeScript and Playwright

Run Playwright Tests

Stack

A basic set of packages to test UI with TypeScript:

Example website for testing as a default baseURL: CERN, unless otherwise specified.

How to Use

  1. Clone repository
  2. Install dependencies: npm install
  3. Install dependencies for testing framework: npm run test:install-deps
  4. Run tests: npm test

CLI Options

  • Different tested host could be passed to tests through .env variable:
BASE_URL=https://home.cern npm test
npm test -- --grep @mobile
  • Run a single test (for example: switch-language.spec.ts):
npm test tests/switch-language.spec.ts

Or:

npm test -- --grep language
npm test -- --debug --grep language

Or through the custom command:

npm run test:debug -- --grep language

Examples of Test Cases

All tests are synthetic and written in different «styles» and approaches with the intent to demonstrate various cases from the articles Hidden Gems of Playwright and Part 2, unless otherwise specified:

About

Testing UI with TypeScript and Playwright

Topics

Resources

Stars

Watchers

Forks