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.

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →