Toolverse
All skills

e2e-testing

by etewiah

Playwright E2E testing and Lighthouse performance auditing. Use when setting up E2E tests, running Playwright tests, performing Lighthouse audits, or debugging E2E test failures.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
etewiah
Category
Testing
Views
1

About this skill

Playwright E2E testing and Lighthouse performance auditing. Use when setting up E2E tests, running Playwright tests, performing Lighthouse audits, or debugging E2E test failures.

How to use

  1. Zainstaluj przeglądarki Playwright, uruchamiając npx playwright install, a następnie przygotuj bazę danych testową poleceniem RAILS_ENV=e2e bin/rails playwright:reset.

  2. Uruchom serwer testowy za pomocą RAILS_ENV=e2e bin/rails playwright:server (serwer będzie dostępny na porcie 3001 z dwoma dzierżawcami: tenant-a.e2e.localhost:3001 i tenant-b.e2e.localhost:3001). Jeśli chcesz testować interfejs bez logowania, użyj RAILS_ENV=e2e bin/rails playwright:server_bypass_auth.

  3. Uruchom wszystkie testy poleceniem npx playwright test. Aby zobaczyć przeglądarki w akcji, dodaj flagę --headed, a aby pracować interaktywnie, użyj npx playwright test --ui.

  4. Aby uruchomić konkretny test, użyj npx playwright test tests/e2e/public/property-search.spec.js lub filtruj testy wzorcem: npx playwright test -g "property search".

  5. Jeśli test się nie powiedzie, uruchom go w trybie debugowania za pomocą npx playwright test --debug, aby przejść przez każdy krok i zidentyfikować problem.

  6. Aby odświeżyć dane testowe bez resetowania schematu bazy, uruchom RAILS_ENV=e2e bin/rails playwright:seed.

Related skills