In this exercise, you'll work with Playwright, a test automation framework, to add three automated tests for a todo application and verify one additional test. You'll be improving tests that were code-generated by Ranger's system for Ranger TODO.
Do feel free to use Playwright Codegen as a tool in this process. And remember to consider good coding practices and locators when identifying elements in the DOM.
You have 60 minutes to fix, finish, and validate four test scenarios that verify core todo functionality:
login.ts: Log into an existing QA TODO accountalphabeticallySorted.ts: Create 4 new todo items and verify that the items are sorteddoneAfterUncomplete.ts: Verify that a todo marked as done is sorted to the bottom of the listrollTenYahoo.ts: Roll the dice and verify the user gets a special message when the dice lands on ten
Your objectives are to:
- Create an account to use for these tests
- Ensure that the tests are able to complete the objectives
- Ensure tests run consistently and reliably (at least twice in a row)
Following your independent work, we'll have a brief code review discussion where you'll walk through your implementation and any challenges you encountered. Feel free to use online resources during the assessment.
- Node.js v22+
- npm
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install# Run all tests
npm run test
# Run a specific test
npm run test tests/[filename].ts
# Debug a test (after adding .only to the test you want to debug)
npm run test -- --debugIf you run into any technical issues during the assessment, let your interviewer know.