quality-engineering-selector-stability
БесплатноБез исполняемых скриптовНе проверен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…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
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:
testIDfor automation; separateaccessibilityLabelfor 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 = truefor automation;contentDescriptionfor 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/contentDescriptionas 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
Установить quality-engineering-selector-stability в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл quality-engineering-selector-stability?
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.
Как установить скилл quality-engineering-selector-stability?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл quality-engineering-selector-stability запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic