quality-engineering-selector-stability
/quality-engineering-selector-stability
Ustala wspólną politykę selektorów i identyfikatorów testowych dla automatyzacji UI w webie i mobile oraz przy komponentach.
- Autor
- HoangNguyen0403 ↗
- Repozytorium
- agent-skills-standard ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 12.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 7
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 12.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Ustala wspólną politykę selektorów i identyfikatorów testowych dla automatyzacji UI w webie i mobile oraz przy komponentach.
Oryginalny opis (EN)
Cross-stack selector and test-id policy for web and mobile automation. Use when writing or reviewing E2E/UI test locators, or adding data-testid/accessibility identifiers to components.
Jak działa
- Priority: P0 (CRITICAL)
- Web Ladder
- Mobile Ladder
- Framework Map
- Naming
- Insertion Policy
- Drift Classes
- Collection Readiness
- Anti-Patterns
- References
Podgląd SKILL.md
---
name: quality-engineering-selector-stability
description: Cross-stack selector and test-id policy for web and mobile automation. Use when writing or reviewing E2E/UI test locators, or adding data-testid/accessibility identifiers to components.
metadata:
triggers:
files:
- "**/e2e/**/*.{ts,js}"
- "**/*.e2e.{ts,js}"
keywords:
- selector
- locator
- data-testid
- testID
- accessibilityIdentifier
- testTag
- stable locator
- selector drift
---
# Quality Engineering: Selector Stability
## **Priority: P0 (CRITICAL)**
## Web Ladder
`getByRole` / `getByLabel` > `getByTestId` (`data-testid`) > attribute CSS. Never XPath, `nth-child`, or generated class names.
## Mobile Ladder
Accessibility id > resource-id / `testTag` > predicate/uiautomator > XPath. Never XPath.
## Framework Map
- React/Next.js: `data-testid`.
- React Native: `testID` for automation; separate `accessibilityLabel` for VoiceOver/TalkBack.
- Flutter: `WidgetKeys` (`Key`) on widgets for widget tests, `integration_test`, and Patrol.
- SwiftUI/UIKit: `.accessibilityIdentifier` (automation only); `.accessibilityLabel` (screen reader).
- Jetpack Compose: `Modifier.testTag` + `testTagsAsResourceId = true` for automation; `contentDescription` for a11y.
## Naming
`<screen>-<element>-<role>`, kebab-case (e.g. `checkout-submit-button`).
## Insertion Policy
Add ids to leaf interactive/assertable elements only, never layout wrappers. Never rename an existing id — ids are a public contract other tests depend on.
## Drift Classes
`rename` (id changed), `restructure` (DOM/tree moved), `i18n` (visible text changed, id untouched).
## Collection Readiness
Prefer retrying assertions (`expect(locator).toHaveCount(...)`, `toHaveText([...])`) over immediate enumeration (`locator.all()`). `all()` samples count immediately and returns live positional locators without waiting, risking false-green empty iterations. Establish declared finite completion and exact expected identities before iterating. Never assume count alone freezes dynamic lists or guarantees membership stability; target elements by stable IDs via POM actions, never `.all()` indices.
## Anti-Patterns
- Text selectors on translated strings, index-based locators (`nth`), generated/hashed class names.
- Using `accessibilityLabel` / `contentDescription` as a test id (they are user-facing a11y strings, not stable test locators).
- Overwriting or stripping accessible labels to insert test identifiers.
- Using web CSS / XPath selectors in native mobile automation.
- "xpath just for now" — there is no temporary XPath; use the ladder from the first commit.
- Immediate `locator.all()` loops on dynamic lists without asserting completion and identity readiness (causes false-green passes on empty lists).
- Using `nth()` or `.all()` positional indices to target or mutate items; target by stable semantic IDs/keys through page objects instead.
## References
- [Selector Ladder Details](references/selector-ladder.md)
- [Test-ID Naming](references/testid-naming.md)
- [Insertion Policy](references/insertion-policy.md)
- [Drift Classification](references/drift-classification.md)
- [Collection Readiness & Dynamic Lists](references/collection-readiness.md)
Pliki w paczce (7)
- LICENSE 1 KB
- SKILL.md 3 KB
- references/collection-readiness.md 8 KB
- references/drift-classification.md 1 KB
- references/insertion-policy.md 1 KB
- references/selector-ladder.md 4 KB
- references/testid-naming.md 1 KB
Wersje
W bazie nie ma innych skilli o nazwie quality-engineering-selector-stability.
Migawka bazy z 13.11.2026 · wersja paczki a07556578d71 (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
- 100specialist-testid-inserter
Wstawia stabilne identyfikatory testowe do komponentów produkcyjnych dla luk selektorów z planu testów, według polityki frameworka i bez zmiany nazw istniejących id. - 100e2e-testing
Podaje wzorce testów end-to-end Playwright dla aplikacji Python i React: struktura testów, Page Object Model, strategia selektorów, oczekiwania, ponowne użycie stanu uwierzytelnienia, dane testowe i CI. - 95playwright-frontend
Pomaga pisać komponenty, które testy i agenci znajdą pewnie: semantyczny markup, priorytety lokatorów i stabilne atrybuty data-testid. - 100e2e-testing-mobile
Planuje, generuje, uruchamia i naprawia przepływy end-to-end Maestro dla aplikacji Expo i React Native, od specyfikacji, z lokatorami testID i Maestro Cloud przez EAS. - 90quality-engineering-test-plan-authoring
Zamienia kryteria akceptacji w wykonywalny plan testów (scenariusze, seed, luki w selektorach) przed generowaniem kodu E2E. - 100validate-selector
Audytuje dynamiczny selektor Sim od deklaracji przez manifest po granicę bezpieczeństwa i zakres autoryzacji.