test(dashboard): stabilize the e2e suite under parallel runs
Three issues found while running the full B1–B8 suite together: - The B1 logout test was driving the shared admin storageState token, invalidating it for every subsequent test. Switched it to a fresh login so its session is disposable. - Bumped navigationTimeout to 30s and capped local workers at 4 to cope with the Vite dev server's first-compile cost under parallel load. Local also gets one retry to absorb intermittent warmup flakiness. - Cleared a few lint warnings (unused appId / _adminPage vars) and belt-and-braces gitignore for playwright artifacts written to the repo root when the CLI is invoked from there by accident. Suite now: 55/55 passing in ~21s. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,9 +97,16 @@ test.describe('B1 auth — authenticated', () => {
|
||||
await page.goto('/admin/login');
|
||||
await expect(page).toHaveURL(/\/admin\/apps$/);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('B1 auth — logout', () => {
|
||||
// Logout must NOT use the shared storageState token, or it would
|
||||
// invalidate the session every other test relies on. Each run
|
||||
// here logs in fresh so its session is disposable.
|
||||
test.use({ storageState: { cookies: [], origins: [] } });
|
||||
|
||||
test('logout clears the session and lands on /login', async ({ page }) => {
|
||||
await page.goto('/admin/apps');
|
||||
await loginAsAdmin(page);
|
||||
await expect(page.getByRole('heading', { name: 'Apps', level: 1 })).toBeVisible();
|
||||
await logout(page);
|
||||
const token = await page.evaluate(() => localStorage.getItem('picloud.admin.token'));
|
||||
|
||||
Reference in New Issue
Block a user