e2e-testing
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
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
Zainstaluj przeglądarki Playwright, uruchamiając
npx playwright install, a następnie przygotuj bazę danych testową poleceniemRAILS_ENV=e2e bin/rails playwright:reset.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żyjRAILS_ENV=e2e bin/rails playwright:server_bypass_auth.Uruchom wszystkie testy poleceniem
npx playwright test. Aby zobaczyć przeglądarki w akcji, dodaj flagę--headed, a aby pracować interaktywnie, użyjnpx playwright test --ui.Aby uruchomić konkretny test, użyj
npx playwright test tests/e2e/public/property-search.spec.jslub filtruj testy wzorcem:npx playwright test -g "property search".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.Aby odświeżyć dane testowe bez resetowania schematu bazy, uruchom
RAILS_ENV=e2e bin/rails playwright:seed.