Senior~25 minFixture teardownFixture dependenciesTest data hygiene
A fixture that creates test data and cleans up
App: PeopleDesk HR, a practice HR management portal (OrangeHRM-style). Login: Admin / admin123.
Interview scenario
"Every test that needs an employee should get a fresh one, and the suite must leave the system exactly as it found it. Design the fixtures for that, then write the search test on top of them."
Acceptance criteria
- fixtures.ts: an adminPage fixture that logs in as Admin and hands over the page, and an employee fixture that depends on it.
- The employee fixture creates an employee with a unique first name through PIM → Add, hands { first, last, id } to the test with use(), and after the test deletes that employee again (Delete → Yes, Delete).
- tests/employee-search.spec.ts: search by the employee's first name and assert (1) Record Found and that the row shows the name.
- After the run the employee list must be back to 6 records, which is how we know the teardown worked.
🔒 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.