Playwright / Quiz

Log In Once, Fight Everywhere

storageState, setup projects with dependencies, and why 400 tests should not each type a password into a login form.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
9 min

// MISSION BRIEF

Your Mission

Four hundred tests, each spending eleven seconds on the login page. That is 73 minutes of CI time re-testing one form. Playwright's answer: authenticate once, save the state, reuse it everywhere.

This quiz covers storageState mechanics, the setup-project pattern, what gets saved (and what does not), and multi-role strategies.

Speed bonus active.

// FIRST CONTACT

Battle teaser

context.storageState({ path: 'auth.json' }) persists:

  1. AA full disk image of the browser profile
  2. BCookies and localStorage (per origin) into a JSON file that new contexts can load
  3. COnly the URL of the last visited page
  4. DYour operating system keychain
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

playwrightauthenticationstoragestateci-cde2e-testing