Wait for flight results after the spinner
Medium50 pts~2 min
- Explicit waits
- Loading states
- Element collections
Practice app · SkyWay
An online travel agency: airport autocomplete, a custom calendar, travellers popover, timed search results with sorting and filters, a fare modal, passenger validation, a seat map, card payment inside an iframe, and a manage-booking page with native confirm and prompt dialogs.
Your starter code already declares TEST_URL — never hardcode a host.
Objective
Search results take a few seconds to load behind a spinner. Wait for them without fixed sleeps and verify all eight flights are listed.
Your task
- 1Open TEST_URL. The form is already filled with BLR → DEL on Fri, 20 Nov 2026.
- 2Click #search-flights.
- 3Wait until the loading spinner (#search-loading) disappears and the flight cards ([data-testid="flight-card"]) appear.
- 4Assert that 8 flight cards are shown and #results-count reads “8 flights found”.
Acceptance criteria
- The spinner is gone.
- Eight flight cards are listed.
- The result count says 8 flights found.
- The test uses no fixed sleeps.
Fixtures
- Airports
- BLR Bengaluru · DEL New Delhi · BOM Mumbai · MAA Chennai · GOI Goa · HYD Hyderabad
- Today
- Tuesday, 10 November 2026 (earlier dates are disabled)
- Test card
- 4111 1111 1111 1111 · expiry 12/29 · CVV 123
- Declined card
- 4000 0000 0000 0002
- Existing booking
- PNR SW7K2Q · last name Verma
- Travellers
- Asha Verma (34, Female) · Rohan Verma (36, Male) · asha.verma@example.com · 9876543210
Playwright · Playwright Challenges · SkyWay