DAY 08
Why POM & BasePage
Understand exactly what POM solves. Build the foundation everything extends.
Core Practice
- Create
src/pages/BasePage.ts— constructor acceptsPage - Add to BasePage:
navigate(),waitForNetworkIdle(),isElementVisible() - Create
src/pages/LoginPage.tsextending BasePage - Implement
login(user, pass)andgetErrorMessage() - Rewrite login tests from Week 1 using these new classes
DAY 09
Feature Page Objects
Build page objects for every module. Methods as user actions, not code.
- Create
NavigationPage.tsfor sidebar/top-nav - Create
EmployeePage.ts: methods for create, search, and delete - Create
LeavePage.ts: apply, approve, and reject logic - Verify tests read like plain English business scenarios
DAY 10
Data Models & Faker
Design the data contracts. Create unique, robust test data sets.
- Install
@faker-js/faker - Refine models:
Employee,LeaveRequest,Candidate - Create
src/data/EmployeeBuilder.tswith override methods - Replace hardcoded data with builder-generated unique values
DAY 11
Custom Fixtures
Stop repeating setup code. Fixtures are the clean way to share state.
- Define custom fixture types in
src/fixtures/base.ts - Create
authenticatedPageand page object fixtures - Create a
testEmployeefixture (creates/deletes employee) - Rewrite tests to use pre-instantiated fixtures
DAY 12
Framework Architecture
Establish the structure that holds the entire framework.
- Set up Path Aliases:
@pages,@fixtures,@models - Establish production folder layout (api, data, utils, config)
- Configure ESLint & Prettier for consistency
- Write
README.md&CONTRIBUTING.md
DAY 13
Multi-Project Config
One config for every environment, browser, and scenario.
- Define Chromium, Firefox, and WebKit projects
- Define a 'mobile' project using Pixel 5 emulation
- Configure 3 reporters simultaneously (html, json, list)
- Add
smokeproject withgrep: /@smoke/
DAY 14
Session Auth State
Login once, reuse everywhere. Cut suite time by 30-50%.
- Create
globalSetup.tsto perform login and save state - Reference
globalSetupinplaywright.config.ts - Set
storageState: '.auth/admin.json'for your project - Verify tests run pre-authenticated without hitting the login page