Log in to Sauce Demo and verify the products page
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
The interviewer opens saucedemo.com and says: "This is the site we use for screening. Log in as standard_user, prove you landed on the products page, and show me the locked-out user gets the error message. Run it for real, not in a mock."
Acceptance criteria
- Log in as standard_user / secret_sauce and assert the URL contains /inventory.html.
- Assert the Products title is visible and 6 inventory items are listed.
- In a second test, log in as locked_out_user and assert the error contains "locked out".
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 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/saucedemo-login/ 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 test in Selenium Java with TestNG.