lecture 6 of 170 completed

Multi-user and role-based testing

Two users in one test, and permission matrices across many roles. Playwright is unusually good at both, and both are hard to design well.

What you'll learn

  • How two contexts let one test act as two users
  • How to model a permission matrix
  • Why permissions must be checked at the API, not just the UI

Some of the most valuable tests in a business application involve two people. An admin approves a request and the requester sees it appear. A support agent updates a ticket while the customer watches. A document is shared and the recipient's list updates.

These are exactly the flows that break in production and exactly the ones most suites never cover, because in most tools they are painful. In Playwright they are straightforward, and knowing how is a strong senior signal.

Two users in one test.

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →