Playwright

Sort restaurants by rating and read the top result

Medium45 pts~2 min
  • Dropdowns
  • Reading lists of data
  • Sorting
  • Numeric comparison
Practice app · FoodRush

A food-delivery app: set your delivery area through a native prompt, filter restaurants by veg-only, cuisine and search, sort them, customise dishes in a modal, manage a cart with a coupon, check out and follow a live order tracker before rating the meal.

Test URL
/lab/playwright-foodrush-sort-by-rating

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Sort the restaurant listing by rating, verify the ratings run from highest to lowest, and confirm that the top-rated restaurant is Sugar & Spoon with 4.7.

Your task

  1. 1Open TEST_URL.
  2. 2Choose “Rating” in #sort-select (value rating).
  3. 3Read the .restaurant-rating of every card in #restaurant-list and assert the values never increase from one card to the next.
  4. 4Assert the first card's .restaurant-name is “Sugar & Spoon” and its .restaurant-rating is 4.7, and that all 12 restaurants are still listed.

Acceptance criteria

  • The listing is sorted by rating.
  • The first result is Sugar & Spoon rated 4.7.
  • All 12 restaurants remain.
  • The test makes at least two assertions.

Fixtures

Delivery area
Any area name, e.g. Indiranagar
Coupon
FEAST50 (₹50 off item totals of ₹299 and above)
Delivery fee
₹40 per order
Taxes
5% GST & restaurant charges on the item total, rounded to the nearest rupee
Seeded cart
Dosa Darbar: Masala Dosa ×1 (₹120), Filter Coffee ×2 (₹60), Medu Vada ×1 (₹80)
Checkout details
Asha Verma · 9876543210 · 12, 4th Cross
Tracking
Order placed → Preparing → Out for delivery → Delivered, about 1.5 s per step

Playwright · Playwright Challenges · FoodRush