Explain how you would test a real-time feature like a chat application or live notifications.
- real-time
- websocket
- multi-user testing
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Challenges: timing, WebSocket connections, multiple users. Approach: (1) Use multiple browser contexts in Playwright to simulate sender and receiver. (2) Test WebSocket messages by intercepting them or checking UI updates. (3) Verify message ordering, delivery confirmation, and offline/reconnect scenarios. (4) Test rate limiting and scroll pagination. (5) Performance: measure time from send to display. Use page.waitForSelector or expect.poll for async assertions.
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.