QA
Fresher~5 minLocatorsfill / clicktoHaveURLtoHaveCount

Log in and land on the products page

App: SwagShop, a practice e-commerce demo store (Saucedemo-style). Login: standard_user, locked_out_user, problem_user, performance_glitch_user / secret_sauce.

Next scenario →

Interview scenario

The interviewer shares the SwagShop login page and says: "Automate the happy-path login for standard_user and prove the user really landed on the products page."

Acceptance criteria

  1. Open the app and log in as standard_user with password secret_sauce.
  2. Assert the URL contains /inventory.
  3. Assert the Products title is visible and exactly 6 products are listed.
tests/example.spec.tsPlaywright · TypeScript

Runs in your browser with a Playwright-compatible API: locators, auto-waiting actions, expect, imports between files and test.extend fixtures. Saved in this browser. Ctrl/⌘ + Enter runs.

Save your lab code to a GitHub repo in your name, automatically after every run.Sign in with GitHub
/sandbox/swagshopOpen ↗

Test output

Press Run tests to watch your code drive the practice app in the preview.

Reference solution

Try it yourself first. Then compare with the Playwright solution and the same test in Selenium Java with TestNG.