M1: the reference e2e suite follows the stored 2FA verify count
The verify count now survives a restart of the site, so the specs can no longer share one test admin across server runs: create-test-admin.ts makes two test admins and clears their stored counts; the setup spec signs in as the second. The whole suite passes in one run (20 passed, 1 skipped). Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
83356ab4ed
commit
81cee02e78
@@ -1,6 +1,6 @@
|
||||
import { type APIRequestContext, expect, type Page, test } from '@playwright/test'
|
||||
|
||||
import { totp } from './totp'
|
||||
import { secondTestAdmin, totp } from './totp'
|
||||
|
||||
/**
|
||||
* "2FA setup required" in a real browser: an account that has not set two-step verification up sees only the setup
|
||||
@@ -17,7 +17,8 @@ const EDITOR = { email: `e2e-editor-${stamp}@example.com`, password: `editor-${s
|
||||
/** The admin the later tests act as: the owner made in the first test, else the smoke-test admin. */
|
||||
let admin: { email: string; password: string; secret: string } | null =
|
||||
process.env.E2E_ADMIN_EMAIL && process.env.E2E_ADMIN_PASSWORD && process.env.E2E_TOTP_SECRET
|
||||
? { email: process.env.E2E_ADMIN_EMAIL, password: process.env.E2E_ADMIN_PASSWORD, secret: process.env.E2E_TOTP_SECRET }
|
||||
? // the second test admin: the other specs spend the first one's verify attempts (5 per account in 10 minutes)
|
||||
{ email: secondTestAdmin(process.env.E2E_ADMIN_EMAIL), password: process.env.E2E_ADMIN_PASSWORD, secret: process.env.E2E_TOTP_SECRET }
|
||||
: null
|
||||
let editorId: string | undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user