TravelGo

Practice tasks

A seat map is the one screen most practice sites never give you. Selecting seats, holding that selection across three pages and building a form from it is exactly the kind of flow that catches people out in interviews.

1. Search

  1. Submit the search with no cities and assert the error message.
  2. Pick the same city in From and To and assert it is rejected.
  3. Use the swap button and assert the two cities exchange places.
  4. Click Tomorrow and assert the date field holds tomorrow's date.
  5. Search Chennai to Bengaluru and assert the route bar shows both cities and the date.
  6. Search a route with no service and assert the empty state.

2. Results and filters

  1. Assert the bus count text matches the number of result rows.
  2. Tick AC and assert every row shows an AC bus.
  3. Tick Sleeper as well and assert both conditions hold.
  4. Filter by one operator and assert only that operator remains.
  5. Drag the fare slider to 900 and assert no row shows a higher fare.
  6. Tick After 6 pm and assert every departure time is later than 18:00.
  7. Sort by fare ascending, then by rating, and assert both orders.
  8. Clear the filters and assert every bus on the route is back.

3. Seat selection

  1. Assert Continue is disabled before any seat is picked.
  2. Click a booked seat and assert nothing is selected.
  3. Pick two seats and assert the total equals fare x 2.
  4. Click a selected seat again and assert it is released and the total drops.
  5. Try to pick a seventh seat and assert the limit message.
  6. Assert a sleeper bus shows an upper deck and a seater bus does not.
  7. Pick seats but leave the boarding point empty and assert Continue stays disabled.
  8. Choose a boarding and a dropping point and assert Continue becomes enabled.

4. Passengers, payment and ticket

  1. Assert one passenger block is generated per selected seat, each labelled with its seat number.
  2. Submit the empty form and assert every passenger and contact field is listed.
  3. Enter an age of 0 and of 121 and assert both are rejected.
  4. Select UPI and assert the UPI field appears; select Card and assert it is replaced.
  5. Select the wallet with a total above 500 and assert the balance message.
  6. Add insurance and assert the total rises by 20 per passenger.
  7. Book the ticket and assert the PNR matches TG-XXXXXXXX.
  8. Download the ticket and assert the file is saved.
  9. Open My bookings, cancel the trip and assert the status changes.

Where the data lives

The search, the seat selection and the bookings are kept in localStorage under tg_search, tg_selection and tg_bookings. Reset between runs with:

// Selenium
((JavascriptExecutor) driver).executeScript("window.localStorage.clear()");

// Playwright
await page.evaluate(() => localStorage.clear());