FE-104TSTGate 05
Testing
Scheduled
data-test-component and data-test-id conventions for stable automation selectors.
Testing — Key Takeaways
Three categories worth testing, two attributes for automation, and AI guardrails to catch breakage early.
- 01Test what matters
- Business logic · behaviour logic · component behaviour
- Not styling, not implementation, not snapshot diffs
- If it doesn't fit, you're testing the wrong thing
- 02Two attributes, two purposes
- data-test-component — reusable elements, can repeat
- data-test-id — specific instance, unique per page
- Apply to new code, migrate legacy over time
- 03Selectors with context
- "video" tells you nothing — which one, where?
- Include enough context to find it without the file
- No more snowflake selectors
- 04AI guardrails
- Rules flag changes that would break automation
- Caught at PR review, not an hour into the test run
- Still improving — already cutting the "I broke the suite" cycle
Test what matters, identify things consistently, and let tooling catch the rest — fewer flaky tests, more real signal.