Mid-LevelTest Automation & Frameworks
What is the role of component testing in a modern test strategy?
- component testing
- test pyramid
- testing library
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Component tests sit between unit and e2e tests. They render a single component in isolation with its dependencies mocked, test interactions (click, type, select) and verify output. Tools: Playwright Component Testing, Cypress Component Testing, Testing Library. Benefits: faster than e2e, more realistic than unit tests, catch rendering bugs early. Use for: complex form components, interactive widgets, state-heavy components. Do not use for: simple presentational components or integration flows.
What interviewers listen for
- Test architecture instinctsYou can defend why your suite is shaped like a pyramid, a trophy, or a honeycomb.
- Locator disciplineYou rank selector strategies by stability and explain when to break the rule.
- Flaky test ownershipYou debug to a structural fix instead of retry-until-green.
- Parallelisation literacyYou know how your framework isolates state, fixtures, and database access across workers.