new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · all subjects

authentication/shared-account

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Basic shared account strategy for tests without server-side state

For tests that do not modify server-side state and can run in parallel with the same account: create a setup project file `tests/auth.setup.ts` that authenticates once and saves state to `playwright/.auth/user.json`. In the Playwright config, declare a setup project with testMatch `/.*\.setup\.ts/` and set each testing project's `storageState` to `playwright/.auth/user.json` with `dependencies: ['setup']`.

Authentication setup example with UI interaction

Example setup file that authenticates via UI interaction: ```js import { test as setup, expect } from '@playwright/test'; import path from 'path'; const authFile = path.join(__dirname, '../playwright/.auth/user.json'); setup('authenticate', async ({ page }) => { await page.goto('https://github.com/login'); await page.getByLabel('Username or email address').fill('username'); await page.getByLabel('Password').fill('password'); await page.getByRole('button', { name: 'Sign in' }).click(); await page.waitForURL('https://github.com/'); await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible(); await page.context().storageState({ path: authFile }); }); ``` Wait for the final URL after login to ensure cookies are set, or wait for an element that confirms successful authentication.

Give your agent this brain