Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

e2e-testing-patterns

/e2e-testing-patterns

Pisze lub przegląda testy E2E w Playwright: strategie lokatorów, Page Object Model, przechwytywanie sieci oraz pomocników WordPressa i WooCommerce.

Licencja
MIT
Ostatnia zmiana repozytorium
12.10.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pisze lub przegląda testy E2E w Playwright: strategie lokatorów, Page Object Model, przechwytywanie sieci oraz pomocników WordPressa i WooCommerce.

Oryginalny opis (EN)

Use when writing or reviewing Playwright E2E tests - locator strategies, Page Object Model, auto-waiting, network interception, and WordPress/WooCommerce test helpers.

Jak działa

  1. Skill Directory
  2. Reference Routing
  3. Locator Priority (Best to Worst)
  4. E2E Quick Reference
  5. E2E Red Flags
  6. Page Object Model Pattern
Sekcje z nagłówków SKILL.md, w oryginale · 67 linii, 504 słów
Podgląd SKILL.md
---
name: e2e-testing-patterns
description: Use when writing or reviewing Playwright E2E tests - locator strategies, Page Object Model, auto-waiting, network interception, and WordPress/WooCommerce test helpers.
---

## Skill Directory

Resolve `SKILL_DIR` to the absolute directory containing this `SKILL.md`, as
shown by the current host, before using any bundled path below.
Before a shell command uses `$SKILL_DIR`, assign it in that command or replace
it with the resolved path. It is not a host-exported environment variable.

# E2E Testing Patterns

Playwright end-to-end testing patterns. For shared test quality principles (philosophy, smells, mocking decisions), see `testing-patterns`.

## Reference Routing

| Need | Reference File | Sections to Read |
|------|---------------|-----------------|
| Playwright + E2E patterns | `$SKILL_DIR/../testing-patterns/references/playwright-patterns.md` | Full file (~461L, manageable) |
| Behavior vs implementation | `$SKILL_DIR/../testing-patterns/references/test-philosophy.md` | `## The Fundamental Shift` + `## Four Core Principles` |
| Flaky/brittle tests | `$SKILL_DIR/../testing-patterns/references/test-smells.md` | `## The Six Major Test Smells` (relevant subsection) |
| Mock usage decisions | `$SKILL_DIR/../testing-patterns/references/mocking-strategies.md` | `## The Mocking Decision Framework` |
| Test layer strategy | `$SKILL_DIR/../testing-patterns/references/test-layers.md` | `## The Three Layers` + `## Choosing the Right Layer` |

**How to read sections:** Grep for heading to find line number, Read with offset+limit.

## Locator Priority (Best to Worst)

1. `page.getByRole('button', { name: 'Submit' })` — accessible, resilient
2. `page.getByLabel('Email')` — form elements
3. `page.getByText('Welcome')` — visible content
4. `page.getByTestId('checkout-form')` — explicit test hooks
5. `page.locator('.class')` / `#id` — last resort, fragile

## E2E Quick Reference

| Use | Instead Of | Why |
|-----|-----------|-----|
| `await expect(locator).toBeVisible()` | `page.waitForTimeout(2000)` | Auto-waits, deterministic |
| `page.getByRole()` | `page.locator('.btn')` | Resilient to CSS changes |
| Page Object Model | Inline selectors | Reusable, single source of truth |
| `page.route()` for external APIs | Real HTTP calls | Fast, deterministic, no rate limits |
| Config-based URLs | `http://localhost:8080` | Works across environments |
| `toHaveScreenshot({ maxDiffPixelRatio: 0.01 })` | `toMatchSnapshot()` | Tolerates rendering differences |
| `test.describe()` grouping | Flat test structure | Logical organization |
| `await` before all assertions | Missing `await` | Playwright assertions are async |

## E2E Red Flags

| Pattern | Why Harmful | Fix |
|---------|------------|-----|
| CSS selectors as primary locators | Break on styling changes | Use role/label/text locators |
| `page.waitForTimeout()` | Arbitrary delay, flaky | Use `expect(locator).toBeVisible()` |
| Missing test isolation | Tests depend on prior state | `beforeEach` setup, clean state |
| Hardcoded URLs | Breaks across environments | Use config/env variables |
| No Page Object Model | Duplicated selectors | Extract to page object classes |
| Screenshot without tolerance | Pixel-perfect failures | Set `maxDiffPixelRatio` |
| Missing `await` before assertions | Silent assertion skip | Always await Playwright expects |
| `page.evaluate()` for assertions | Bypasses auto-waiting | Use Playwright locator assertions |
| No network interception | Flaky external calls | `page.route()` for third-party APIs |

## Page Object Model Pattern

- One class per page/component with locators as properties
- Methods return `this` or the next page object for chaining
- Locators defined once, referenced by all tests
- Actions (click, fill) encapsulated in methods
- Assertions stay in test files, not page objects

Wersje

RepozytoriumWynikLicencja
Ta strona · vladolaru/claude-code-plugins90MIT
wshobson/agents100MIT
EricGrill/agents-skills-plugins100MIT
aAAaqwq/AGI-Super-Team95MIT
HermeticOrmus/LibreUIUX-Claude-Code95MIT
rootcastleco/rei-skills90MIT
rmyndharis/antigravity-skills90MIT

Migawka bazy z 13.11.2026 · wersja paczki d4aa9da70ad5 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100e2e-testing
    Opisuje wzorce testów E2E w Playwright: Page Object Model, konfigurację, integrację z CI/CD, zarządzanie artefaktami i strategie wobec niestabilnych testów.
  • 100wp-test-strategy
    Pomaga zaplanować testy WordPressa: PHPUnit, testy integracyjne i end-to-end w Playwright oraz pokrycie WooCommerce.
  • 100e2e-testing
    Podpowiada wzorce testów Playwright: Page Object Model, konfigurację, integrację z CI, artefakty i walkę z testami niestabilnymi.
  • 100e2e-testing
    Podpowiada wzorce testów Playwright: Page Object Model, konfigurację, integrację z CI, artefakty i walkę z testami niestabilnymi.
  • 95playwright-page-object-model
    Pomaga tworzyć obiekty stron i refaktoryzować testy Playwright wzorcem Page Object Model, żeby łatwiej było je utrzymywać.
  • 100woo-testing
    Testuje rozszerzenia WooCommerce: testy jednostkowe i integracyjne PHPUnit, zestaw testów WP, pomocnicze klasy WooCommerce, E2E z Playwright i szkielety testów WP-CLI.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.