DAY 01
Architecture & Project Setup
Understand how Playwright works before writing a single test.
What to Study
- Browser → BrowserContext → Page hierarchy and why it matters
- How Playwright communicates with browsers (CDP — Chrome DevTools Protocol)
- Why Playwright is faster and more reliable than Selenium
- Context-based vs Browser-based execution
- What test isolation means — why each test gets a fresh context
- The generated project structure — every file and what it does
Warm-up (15 min)
Run npm init playwright@latest. Open playwright.config.ts and read every
line. Look up any option you do not understand.
Core Practice (45 min)
- Run
npx playwright test --headed— watch the generated example tests run - Run
npx playwright test --ui— explore UI mode, understand every panel - Run
npx playwright show-report— understand what the HTML report shows - Delete
example.spec.tsand create your owntests/first.spec.ts - Navigate to
https://opensource-demo.orangehrmlive.com/web/index.php/auth/loginand write one test that asserts the page title - Run it headed, run it headless — observe the difference
Open Challenge (30 min)
Run the same test against Firefox and WebKit using --project. Understand what changes in
the config to make this work.
Step-Up: Nothing existed. Now you have a running project you understand from
the inside.
DAY 02
Git & Node.js Project Foundation
Every day ends with a commit. Learn Git properly before Day 3.
What to Study
- Git essentials:
init,add,commit,push,pull - Branching:
checkout -b,merge,branch -d .gitignore— what never goes into version control- Node.js runtime and npm ecosystem (package.json, scripts)
.envanddotenv— environment management
Warm-up
Check your Day 1 repo — is .gitignore correct? Is node_modules tracked? Fix
anything wrong.
Core Practice
- Create
.gitignoreproperly for Playwright - Create
.envand.env.examplefor credentials - Install
dotenvand load it in your config - Add scripts:
test,test:headed,test:ui,test:report - Work through a
feature/day2-setupbranch and merge it
Step-Up: Yesterday you had a project. Today it is version-controlled and
environment-aware.
DAY 03
Locators: Finding Any Element
The most important day. Find any element confidently using the right
strategy.
What to Study
// Hierarchy of stability
await page.getByRole('button', { name: 'Log in' }); // 1st Choice
await page.getByLabel('User Name');
await page.getByPlaceholder('Enter password');
await page.getByText('Success');
await page.getByTestId('submit-btn');
await page.locator('.css-selector'); // Last Resort
Core Practice
- Find OrangeHRM username input 5 different ways
- Identify the most stable locator for the login button
- Navigate Employee List — find search field, table rows, Add button
- Practice
filter(),nth(),first(), andlast() - Use Playwright Codegen and manually improve the results
Step-Up: Yesterday you had a project structure. Today you can find any element
on any page.
DAY 04
Actions: Every Method on Every Element
Find it, then call the right method. Simple and powerful.
What to Study
- Click Actions:
click,dblclick,rightClick - Input:
fill,type,clear,press - Selection:
selectOption,check,uncheck - Pointer:
hover,dragAndDrop,focus - Files:
setInputFiles— the only way to handle uploads
Core Practice
- Full login flow using only
fill()andclick() - Add Employee form completion (dropdowns, toggles)
- Upload a resume using
setInputFiles() - Manual keyboard navigation login (no mouse clicks)
- Drag and drop practice on DemoQA
Step-Up: Yesterday you found elements. Today you can perform any action on any
element.
DAY 05
Special Contexts: Dialogs, Frames & Windows
These are not element types. They are special contexts.
Key Concepts
- Dialogs: Set listener
page.on('dialog')BEFORE trigger. - iFrames: Use
frameLocator()to scope your actions. - Windows:
context.waitForEvent('page')to capture new tabs. - Downloads: Intercept with
page.waitForDownload().
Step-Up: Yesterday was normal elements. Today you handle every context they
can live inside.
DAY 06
Assertions & Wait Strategies
Verify outcomes with precision using Web-First assertions.
Wait Strategies
waitForLoadState,waitForURLwaitForResponse— wait for the API, not the UI.expect.soft()— keep going even on failure.
Step-Up: Yesterday was special contexts. Today you verify outcomes and
understand Playwright's auto-waiting.
DAY 07
TypeScript for Testers
Make your code type-safe and self-documenting. Zero 'any'.
interface Employee {
id: string;
name: string;
role: 'Admin' | 'Employee';
}
function process(emp: Employee) { ... }
Step-Up: Today your code is type-safe — every method, data object, and return
value has a declared type.