IntermediatePW-RT-00325 minutesPlaywright

Recover from a controlled reconnect

A reconnect test needs an observable loss and recovery without an unbounded retry worker.

  • network
  • waits
  • assertions

Objective

What to automate

Run the reconnect loss step, then the explicit recovery step, and assert their different request behavior.

Preconditions and test data

Preconditions

  • Use a fresh isolated Practice Lab browser context.
  • Open the fixture identified by FX-RT-001.

Test data

  • scenario: reconnect
  • maximum reconnect attempts: 2

Expected result

The first event performs no request, and the recovery event performs one bounded ticket poll.

Progressive hints

Hint 1

Select Reconnect after a controlled loss.

Hint 2

Assert Connection loss observed before the second action.

Hint 3

Count requests around Connection restored instead of sleeping.

I’ve tried it — show solution
  1. Select Reconnect after a controlled loss.
  2. Assert Connection loss observed before the second action.
  3. Count requests around Connection restored instead of sleeping.

The deliberately failing starter is in tests/realtime-updates.spec.ts inside the TypeScript starter ZIP.