Practice tasks
Work through these in order. Every control on this app has a stable id and a data-testid, so your locators will not break between visits.
1. Search and filter
- Search for
mouseand assert the result count text matches the number of product cards. - Search for something that does not exist and assert the empty-state message appears.
- Tick Electronics and assert every visible card shows that category.
- Drag the price slider to 2000 and assert no card shows a price above it.
- Tick In stock only and assert no card shows "Out of stock".
- Combine two filters, then click Clear all filters and assert all 18 products are back.
2. Sorting and paging
- Sort by Price: low to high and assert the prices are in ascending order.
- Sort by Customer rating and assert the first card has the highest rating.
- Go to page 2 and assert the cards are different from page 1.
- Apply a filter and assert the pager resets to page 1.
3. Product page
- Open a product and assert the name, price and rating match the card you clicked.
- Assert the discount percentage equals (MRP - price) / MRP, rounded.
- Open an out-of-stock product and assert Add to cart is disabled.
- Set the quantity above the stock and assert the error message.
- Check a pincode:
636001is serviceable,999999is not. - Switch to the Reviews tab, submit a review without a rating, and assert the validation message.
4. Cart
- Add two different products and assert the cart badge shows 2.
- Add the same product twice and assert the quantity becomes 2, not two rows.
- Change a quantity and assert the row subtotal and the order total both update.
- Remove a row and assert it disappears and the total drops.
- Apply
SAVE10on a cart above 1000 and assert a 10% discount. - Apply
SAVE10on a cart below 1000 and assert it is rejected. - Apply
EXPIRED5and assert the expiry message. - Clear the cart and assert the empty state and a badge of 0.
5. Checkout
- Submit the empty form and assert every required field is listed.
- Enter a 5-digit mobile number and assert the "exactly 10 digits" message.
- Enter an email without an @ and assert the email message.
- Select Card and assert the card fields appear; select UPI and assert they are replaced.
- Leave the terms unticked and assert the order is not placed.
- Place a valid order and assert you land on the confirmation page with an order ID in the format
SK-XXXXXX. - Assert the cart badge resets to 0 after the order.
6. Orders, login and register
- Open My Orders and assert the order you just placed is listed with the right total.
- Filter by status and assert only matching orders remain.
- Search by order ID and assert exactly one order is shown.
- Log in with
qa.tester/Passw0rd!and assert the welcome message. - Log in with a wrong password and assert the error message.
- Register with a weak password and assert the strength meter and the validation.
- Register with mismatched passwords and assert the message.
Where the data lives
The cart, the orders and the session are kept in your browser's localStorage under the keys
sk_cart, sk_orders and sk_session. Clearing site data resets the app,
which is a clean way to start each test run:
// Selenium
((JavascriptExecutor) driver).executeScript("window.localStorage.clear()");
// Playwright
await page.evaluate(() => localStorage.clear());