Mid~30 minReal sitePage ObjectsCustom fixturesCI run
Page Object framework for Sauce Demo, run on CI
Site: https://www.saucedemo.com, the real saucedemo.com, the public Sauce Labs demo store. Runs on GitHub Actions in your repo. Login: standard_user, locked_out_user, problem_user, performance_glitch_user / secret_sauce.
Interview scenario
"Set up a small framework against saucedemo.com the way you would on day one of a project: page objects for login, inventory and cart, a fixture that logs in, and tests that read like English. Then run it on CI and show me green."
Acceptance criteria
- pages/login.page.ts exports LoginPage with goto() and login(username, password).
- pages/inventory.page.ts exports InventoryPage with addToCart(name), cartCount(), sortBy(value) and prices().
- pages/cart.page.ts exports CartPage with itemNames().
- fixtures.ts extends test with an inventory fixture that logs in as standard_user.
- tests/shop.spec.ts has at least two tests that use only fixtures and page objects: the badge shows 2 after adding two items and they appear in the cart; prices ascend after sorting low to high.
🔒 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 25 labs, plus every interview answer. One payment of ₹1,299, lifetime access. Already on a lower tier? Upgrade for the difference.