QA
Senior~20 minHybrid UI + APIpage.requestTest data seedingEnd-to-end verification

UI + API: seed the cart by API, finish checkout in the UI

App: SwagShop, a practice e-commerce demo store (Saucedemo-style). Login: standard_user, locked_out_user, problem_user, performance_glitch_user / secret_sauce. REST API: tests call it as /api/... through the request fixture or page.request; GET /api lists every endpoint ↗.

Next scenario →

Interview scenario

"Our checkout UI tests spend most of their time clicking products into the cart. Seed the state through the API instead: log in, add items and save the shipping info with page.request, then open the overview page, verify what the customer sees, finish the order, and confirm it through GET /api/orders."

Acceptance criteria

  1. Use page.request (it shares the browser's cookies) to log in as standard_user, add productId 0 and productId 4 with qty 2, and PUT /api/checkout/info.
  2. page.goto('/checkout-step-two') and assert the title Checkout: Overview, two item rows and the total label Total: $49.65.
  3. Click Finish and assert the Thank you for your order! header.
  4. GET /api/orders with page.request: one order, status placed, total 49.65.

🔒 This lab is part of Pro

Pro unlocks the live editor, the scenario checks and the reference solutions in Playwright and Selenium Java for all 37 labs, plus every interview answer. One payment of ₹1,299, lifetime access. Already on a lower tier? Upgrade for the difference.