AdvancedPW-MOCK-00440 minutesPlaywright

Assert a network abort outcome

A browser-level route failure needs a stable user-visible error rather than an unhandled exception.

  • network-mocking
  • error-recovery

Objective

What to automate

Abort the documented request and assert its labelled network-error state and explicit retry control.

Preconditions and test data

Preconditions

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

Test data

  • route action: abort
  • expected status: NETWORK_ERROR

Expected result

The status contains NETWORK_ERROR and Retry request is enabled without any automatic follow-up request.

Progressive hints

Hint 1

Install the abort handler before loading or clicking the fixture.

Hint 2

Press Send catalogue request only once.

Hint 3

Assert both the status message and the enabled retry control.

I’ve tried it — show solution
  1. Install the abort handler before loading or clicking the fixture.
  2. Press Send catalogue request only once.
  3. Assert both the status message and the enabled retry control.

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