IntermediatePW-WAIT-00225 minutesPlaywright

Synchronise with a loading indicator

A request displays Loading before the final data is rendered.

  • waits
  • network

Objective

What to automate

Start the controlled request, observe Loading, then assert completion.

Preconditions and test data

Preconditions

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

Test data

  • delayMs: 2000

Expected result

The loading state appears and later disappears when final data is visible.

Progressive hints

Hint 1

Assert the loading state immediately after the action.

Hint 2

Use toBeHidden for completion.

Hint 3

Assert the final result instead of network idle.

I’ve tried it — show solution
  1. Assert the loading state immediately after the action.
  2. Use toBeHidden for completion.
  3. Assert the final result instead of network idle.