IntermediatePW-BKG-00225 minutesPlaywright

Assert controlled availability states

Availability must be repeatable even when a learning exercise simulates scarcity or zero rooms.

  • forms
  • assertions
  • state

Objective

What to automate

Switch between limited and sold-out scenarios and assert their distinct visible states.

Preconditions and test data

Preconditions

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

Test data

  • scenario: limited
  • scenario: sold-out

Expected result

Limited mode has one selectable room and sold-out mode exposes the controlled empty state.

Progressive hints

Hint 1

Use the labelled Availability scenario select.

Hint 2

Submit Check availability after every scenario change.

Hint 3

Assert the button enabled state and empty-state message rather than a card index.

I’ve tried it — show solution
  1. Use the labelled Availability scenario select.
  2. Submit Check availability after every scenario change.
  3. Assert the button enabled state and empty-state message rather than a card index.

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