QA
Mid~20 minAPI testingCRUDValidation detailsUnique test data

API: employee CRUD with validation

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 ↗.

Next scenario →

Interview scenario

"Cover the employee record end to end at the API: create one, read it back through search, update it, delete it, and prove it is gone. Include the validation failure for a missing last name, and check the field-level details the API returns."

Acceptance criteria

  1. Log in as Admin / admin123 through POST /api/auth/login.
  2. POST /api/employees without lastName returns 400 with error.details.lastName.
  3. Create an employee (firstName, lastName, jobTitle SDET, department Quality Engineering): status 201 and an employee.id.
  4. GET /api/employees?name=<the name> returns total 1; PATCH the job title to Test Lead and assert it; DELETE the record; GET /api/employees/:id is then 404.
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/peopledeskOpen ↗

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.