Designing a resilient test suite for a high-concurrency, real-time dashboard
Description and use
Tests for a high-concurrency trading dashboard became resilient to transient errors and WebSocket noise by using expect.poll() and aborting irrelevant WebSocket requests.
Problem
Financial dashboard tests fail due to transient “Processing…” flashes and background WebSocket noise, causing flaky assertions of the final stable state.
Outcome
Tests become resilient to flaky intermediate states and background noise, achieving reliable assertions of the final dashboard state.
Workflow
- 1. Use expect.poll() with a custom timeout to repeatedly evaluate the final state and error count.
- 2. In the poll callback, read the order status text and count transient error elements.
- 3. Return an object with status and errors and assert it equals {status:'Success', errors:0}.
- 4. Before performing critical actions, mute background WebSocket noise by routing the feed endpoint and aborting the request.
- 5. Run the test; expect.poll() retries until the condition is met or the timeout expires.
Evidence
Use expect.poll() with custom timeout + page.route() to mute noise. Assert final state while ignoring intermediate flashes.
- Record date: 2026-09-18T21:46:15.432Z