Build the Sauce Demo framework from scratch
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
"Here is an empty folder and Sauce Demo. Set up the automation framework you would put in front of a client: Playwright config, page objects, fixtures, test data, a couple of production-grade tests, and a README. Treat it like a real repo, not an exercise. This is the real saucedemo.com. Your config must work on CI, not only on your laptop."
What the framework must have
- playwright.config.ts you write yourself: testDir, baseURL from an environment variable with a default, retries, reporter, trace/screenshot on failure.
- pages/ with at least two page objects; fixtures.ts that extends test (for example a logged-in page or a ready page object).
- tests/ with at least two spec files and four tests in total, using only fixtures and page objects, grouped with test.describe or tagged @smoke/@regression.
- data/ or utils/ for test data and helpers; a README that says how to install and run.
- Everything green: in the browser for the practice apps, and on GitHub Actions with your own config for every app.
Runs with real Playwright on GitHub Actions in your own repo: the files are committed, the Lab run workflow starts with BASE_URL=https://www.saucedemo.com and your own playwright.config.ts, and the results come back here. Saved in this browser. Ctrl/⌘ + Enter runs.
https://www.saucedemo.com can't be embedded here, so your code runs with real Playwright and Chromium on a GitHub Actions runner in your repo. Explore the site in a new tab while you write the test. Login: standard_user, locked_out_user, problem_user, performance_glitch_user / secret_sauce.
- 1. Commit
Your files go to labs/workspace-saucedemo/ in your repo.
- 2. Run
The Lab run workflow installs Playwright and runs your spec against the real site.
- 3. Verify
Results, assertion steps and the HTML report come back; the checks grade your code.
Test output
Press Run on GitHub to commit your code and run it against the real site. Results appear here in a few minutes.
Reference solution
Try it yourself first. Then compare with the Playwright solution and the same framework in Selenium Java with TestNG.