76 executable exercises · TypeScript first

Playwright challenges

Build from resilient locators to API-assisted setup, reusable authentication, network failure handling, and realistic ecommerce flows.

BeginnerPW-FORM-00115 min

Assert registration validation

Submit the customer form with an invalid synthetic email and verify its validation state.

  • forms
  • validation
BeginnerPW-TBL-00115 min

Find one employee row

Find Rahul Sharma in Engineering and assert the row contains Pune.

  • tables
  • locators
BeginnerPW-ECOM-00115 min

Verify product stock

Open product prd-001 and verify its stock status is visible.

  • ecommerce
  • assertions
BeginnerPW-DLG-00115 min

Accept a native alert

Accept the alert and verify the visible alert result.

  • dialogs
  • events
BeginnerPW-WAIT-00115 min

Wait for delayed text

Trigger the 1,000 ms delayed text and wait for the final assertion target.

  • waits
  • assertions
IntermediatePW-TBL-00225 min

Sort and filter employees

Filter Active employees in Pune, sort by salary, and assert the visible rows.

  • tables
  • sorting
  • filters
IntermediatePW-FRM-00125 min

Submit a nested frame form

Use frameLocator to fill and submit the nested form, then verify its result.

  • frames
  • locators
IntermediatePW-FILE-00125 min

Upload a valid CSV

Upload a valid CSV and verify its accepted filename and content classification.

  • files
  • forms
IntermediatePW-NET-00125 min

Mock an empty catalogue

Fulfil the catalogue request with an empty data array and assert the empty state.

  • network-mocking
  • ecommerce
IntermediatePW-DLG-00225 min

Submit a browser prompt

Fill the prompt and verify the page echoes the supplied value.

  • dialogs
  • events
AdvancedPW-AUTH-00340 min

Verify a role-based 403

Authenticate as standard_user, call the Manager-only API, and verify 403.

  • authentication
  • api
  • authorization
AdvancedPW-ECOM-00340 min

Checkout and verify the order API

Add a product, sign in, complete fake checkout, and verify the order through the API.

  • ecommerce
  • api-ui
  • checkout
AdvancedPW-NET-00240 min

Modify a product response

Fetch the real catalogue response, rename one product, and fulfil the request.

  • network-mocking
  • api
AdvancedPW-FILE-00240 min

Reject active SVG content

Attempt to upload an SVG with a script and verify safe rejection.

  • files
  • security
AdvancedPW-DBG-00140 min

Debug a hidden race condition

Run the failing test with trace, diagnose the race, and replace the eager read with a web-first assertion.

  • debugging
  • trace-viewer
  • waits
AdvancedPW-DBG-00240 min

Debug a wrong locator

Use the trace DOM snapshot to diagnose strict-mode ambiguity and scope the locator.

  • debugging
  • trace-viewer
  • locators
ExpertPW-DBG-00360 min

Debug an unhandled dialog

Diagnose the event ordering with trace/video/console evidence and register the handler before the click.

  • debugging
  • trace-viewer
  • dialogs
ExpertPW-ECOM-00460 min

Recover from malformed store data

Arm the malformed scenario, verify the explicit error, retry, and verify products return.

  • ecommerce
  • network
  • error-recovery
IntermediatePW-EMP-00425 min

Edit an employee role and status

Edit an existing employee, change the role and status, and verify the same row displays both values.

  • forms
  • tables
  • assertions
AdvancedPW-EMP-00540 min

Delete and reset the employee sandbox

Delete a synthetic employee, accept the confirmation dialog, reset the sandbox, and verify seed results return.

  • api
  • reset
  • isolation
ExpertPW-EMP-00660 min

Prove employee session isolation

Create an employee in one header-mode Lab session, prove it is absent in another, then reset the first session.

  • api
  • isolation
  • authentication
IntermediatePW-TKT-00225 min

Search and paginate tickets

Search for a synthetic ticket, clear the query, then verify the next page changes predictably.

  • tables
  • search
  • pagination
ExpertPW-TKT-00660 min

Prove ticket session isolation

Create a ticket in one header-mode session, prove it is absent from another, then reset the first.

  • api
  • isolation
  • authentication
BeginnerPW-RT-00115 min

Run one bounded refresh poll

Open the refresh scenario, run one explicit poll, and assert the first ordered event.

  • locators
  • waits
  • network
IntermediatePW-RT-00325 min

Recover from a controlled reconnect

Run the reconnect loss step, then the explicit recovery step, and assert their different request behavior.

  • network
  • waits
  • assertions
AdvancedPW-SHD-00540 min

Verify the closed Shadow DOM boundary

Assert the closed host contract, prove its public shadowRoot is null, and prove a scoped button locator finds no internal control.

  • shadow-dom
  • assertions
  • debugging
ExpertPW-SHD-00660 min

Author a truthful Shadow DOM contract test

Write one spec that exercises the open action and shadow form, then asserts the closed host boundary without reaching for its internal button.

  • shadow-dom
  • accessibility
  • debugging
  • locators
BeginnerPW-VIS-00115 min

Capture the frozen v1 baseline

Open v1, wait for local fonts, and capture the reviewed desktop baseline.

  • visual-testing
  • assertions
  • screenshots
IntermediatePW-VIS-00225 min

Assert the v1 release contract

Assert that v1 is Approved with 5 / 5 owned checks and documents the purple baseline.

  • visual-testing
  • locators
  • assertions
IntermediatePW-VIS-00325 min

Capture a tablet comparison

Capture v1 at the documented 834 × 1112 tablet viewport.

  • visual-testing
  • responsive
  • screenshots
AdvancedPW-VIS-00540 min

Protect the mobile visual contract

Capture v2 at 390 × 844 and assert that the release dashboard remains readable.

  • visual-testing
  • responsive
  • accessibility
ExpertPW-VIS-00660 min

Author a deterministic visual suite

Write one suite that validates both versions at desktop, tablet, and mobile sizes with reviewed baselines.

  • visual-testing
  • automation
  • quality
BeginnerPW-MOCK-00115 min

Fulfil a replacement catalogue response

Intercept the documented Store catalogue request, fulfil it with a replacement product, and assert the rendered row.

  • network-mocking
  • assertions
IntermediatePW-MOCK-00225 min

Fulfil an empty catalogue contract

Fulfil the documented request with HTTP 200 and data: [], then assert the empty response message.

  • network-mocking
  • assertions
IntermediatePW-MOCK-00325 min

Recover from a controlled route error

Return HTTP 503 on the first request, then fulfil the learner-controlled retry with one replacement product.

  • network-mocking
  • error-recovery
AdvancedPW-MOCK-00440 min

Assert a network abort outcome

Abort the documented request and assert its labelled network-error state and explicit retry control.

  • network-mocking
  • error-recovery
AdvancedPW-MOCK-00540 min

Assert a delayed route fulfilment

Delay one route fulfilment for a bounded 150 ms, assert the in-progress status, then assert the fulfilled row.

  • network-mocking
  • waits
ExpertPW-MOCK-00660 min

Validate a controlled contract variation

Fulfil the request with an item missing name and price, then assert the controlled contract-mismatch outcome and learner retry.

  • network-mocking
  • api
  • assertions
BeginnerPW-MFA-00115 min

Enroll a synthetic MFA identity

Sign in, start MFA enrollment, verify the documented public OTP, and assert that the enrollment becomes enabled.

  • authentication
  • api
  • assertions
IntermediatePW-MFA-00225 min

Verify a role-aware OTP challenge

Create an Admin challenge with the public credentials, verify its OTP, and assert both the required policy and signed-in dashboard.

  • authentication
  • api
  • roles
IntermediatePW-MFA-00325 min

Assert an expired MFA challenge

Request the expired scenario and verify it with the documented OTP.

  • authentication
  • api
  • error-recovery
AdvancedPW-MFA-00440 min

Recover a synthetic MFA challenge

Enable MFA for admin_user, use the public recovery code, then complete the returned recovery challenge.

  • authentication
  • api
  • recovery
ExpertPW-MFA-00660 min

Reuse an MFA-verified session

Verify an Admin MFA challenge, save browser storage state, and reuse it to read the current authenticated identity.

  • authentication
  • storage-state
  • roles

Starter projects

Download and run locally

TypeScript is the complete cloneable starter. Python and Java include setup pointers and three equivalent examples each.