Junior~8 minAuto-waitingpress('Enter')Loops over locators
Search with a loading state
App: TrendKart, a practice fashion marketplace (Myntra-style). Login: No login needed.
Interview scenario
"Our search shows a spinner before results arrive, and junior engineers love to add sleeps here. Search for shirt and assert the results without any waitForTimeout."
Acceptance criteria
- Search for "shirt" from the header search box and press Enter.
- Assert the results count says 5 items.
- Assert every product card name contains "Shirt".
- Do not use page.waitForTimeout.
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/trendkartOpen ↗
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.