QA
Senior~25 minData-driven testsHelper modulesGenerated tests

Data-driven suite with a helper module

App: TrendKart, a practice fashion marketplace (Myntra-style). Login: No login needed.

Interview scenario

"We have 40 search terms to cover and I don't want 40 copies of the same test. Show me a data-driven design: a data file, a helper for prices, a page object, and a spec that generates a test per row."

Acceptance criteria

  1. data/searches.ts exports SEARCHES: at least three rows of { query, expectedCount, mustContain } (shirt → 5 results all containing Shirt, jeans → 2, kurta → 2).
  2. helpers/money.ts exports parsePrice('₹1,199') that returns 1199.
  3. pages/search.page.ts: SearchPage with search(query), resultCount(), productNames() and prices().
  4. tests/search.spec.ts generates one test per row with a loop, asserting the count and that every name contains mustContain, plus one test that sorts by Price: Low to High and uses parsePrice to assert the prices ascend.

🔒 This lab is part of full access

Unlock 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 ₹999, lifetime access.