Playwright

Filter, add to bag, apply a coupon and place an order

Hard100 pts
  • End-to-end flows
  • Filters
  • Modals
  • Forms
  • Page transitions
Practice app · StyleKart

A fashion store with Men, Women and Kids listings: multi-select filters with removable chips, a custom sort listbox, load-more paging, product pages with colour swatches, sizes, a size-chart modal and a hover gallery, a wishlist, a bag with per-line sizes and a coupons modal, sign-up validation and checkout.

Test URL
/lab/playwright-stylekart-filter-to-order

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

Objective

Automate a full purchase: filter the Men listing to black T-shirts, buy the Oversized Drop Shoulder T-Shirt in size L, apply FIRST100 in the coupons dialog, check out with Cash on Delivery and verify the order confirmation.

Your Task

  1. 1Open TEST_URL, click Men (#nav-men), tick T-Shirts (#filter-cat-t-shirts) and press the Black swatch (#filter-colour-black); assert #result-count reads “3 items”.
  2. 2Open the Oversized Drop Shoulder T-Shirt (data-product-id="m-oversized-tee"), keep Black, choose size L (#size-L) and click Add to bag (#add-to-bag); assert #bag-count shows 1.
  3. 3Open the bag (#nav-bag), click Apply coupon (#apply-coupon-button) and click Apply on the FIRST100 card; assert #bag-total shows ₹439.
  4. 4Click Place order (#place-order-button) and fill: #addr-name Rohan Mehta, #addr-mobile 9876543210, #addr-pincode 400001, #addr-state Maharashtra, #addr-line “Flat 12, Sea View Apartments”, #addr-city Mumbai.
  5. 5Choose Cash on Delivery (#pay-cod), click Place order (#place-order) and assert #order-confirmation shows an order id (SK-…), the item, the coupon and ₹439.

Validation Checks

  • The order confirmation is displayed with an SK- order id.
  • The order contains the Oversized Drop Shoulder T-Shirt in Black, size L.
  • FIRST100 was applied and the order total is ₹439, paid by Cash on Delivery.
  • The test makes at least three assertions along the journey.

Fixtures

Coupons
STYLE20 (20% off bags of ₹1,999 or more) · FIRST100 (₹100 off)
Valid mobile
10 digits starting with 6, 7, 8 or 9, e.g. 9123456780
Password rules
8+ characters with an uppercase letter, a number and a special character, e.g. Style@2026
Seeded bag
Floral Wrap Midi Dress (Pink, S) ×1 · Essential Crew Neck T-Shirt (Black, M) ×2 · Square Neck Crop Top (White, S) ×1
Delivery address
Rohan Mehta · 9876543210 · 400001 · Flat 12, Sea View Apartments · Mumbai · Maharashtra

Cloud Execution & Grading Guide

This Hard Playwright Challenges exercise runs inside TargetQA's managed cloud sandbox using Playwright (TypeScript, JavaScript, Python, Java, C#). Every submission runs inside an isolated headless Chromium container with pre-synced drivers, capturing live console logs, DOM assertions, and a 720p step-by-step video replay.

  • Supported stacks: TypeScript (@playwright/test) · JavaScript (@playwright/test) · Python (Playwright + pytest) · Java (Playwright for Java + JUnit 5) · C# (Playwright for .NET + NUnit)
  • Zero local setup: Use the pre-declared TEST_URL variable so your script targets the live StyleKart sandbox reliably without hardcoding hosts.
  • Automated grading: Click Run to inspect step logs and behavior, then click Submit to validate all 4 acceptance checks and earn 100 points.

Playwright · Playwright Challenges Practice Track · StyleKart