UI + API: seed a record by API, verify in the UI, clean up
App: PeopleDesk HR, a practice HR management portal (OrangeHRM-style). Login: Admin / admin123, or any employee as first.last / Welcome@1 (for example vikram.singh). REST API: tests call it as /api/... through the request fixture or page.request; GET /api lists every endpoint ↗.
Interview scenario
"Our PIM search tests create employees through the form, which is slow and leaves junk behind. Create the employee with the API in beforeEach, verify the search in the UI, and delete it with the API in afterEach, asserting the clean-up worked."
Acceptance criteria
- beforeEach: with page.request, log in as Admin and POST /api/employees for a unique last name; keep the returned employee.id.
- Test: log in through the UI, open PIM, search by the name and assert (1) Record Found and that the row shows the last name.
- afterEach: DELETE /api/employees/:id with page.request and assert GET /api/employees/:id returns 404.
- The test must not create any record through the UI form.
🔒 This lab is part of Pro
Pro unlocks the live editor, the scenario checks and the reference solutions in Playwright and Selenium Java for all 38 labs, plus every interview answer. One payment of ₹1,299, lifetime access. Already on a lower tier? Upgrade for the difference.