diff --git a/e2e/fixtures/test.fixture.ts b/e2e/fixtures/test.fixture.ts index c441f7b4c9..e18c421f69 100644 --- a/e2e/fixtures/test.fixture.ts +++ b/e2e/fixtures/test.fixture.ts @@ -50,6 +50,15 @@ export const test = base.extend({ page: async ({ isolatedContext }, use) => { const page = await isolatedContext.newPage(); + // Skip onboarding, hints, and example tasks before the app boots. + // This runs before any page JavaScript, so Angular sees the flags immediately. + await page.addInitScript(() => { + localStorage.setItem('SUP_ONBOARDING_PRESET_DONE', 'true'); + localStorage.setItem('SUP_ONBOARDING_HINTS_DONE', 'true'); + localStorage.setItem('SUP_IS_SHOW_TOUR', 'true'); + localStorage.setItem('SUP_EXAMPLE_TASKS_CREATED', 'true'); + }); + try { // Always log uncaught page errors — they are almost always test-relevant page.on('pageerror', (error) => { diff --git a/e2e/tests/import-export/archive-import-persistence.spec.ts b/e2e/tests/import-export/archive-import-persistence.spec.ts index b295d36159..9c6c4c9c0a 100644 --- a/e2e/tests/import-export/archive-import-persistence.spec.ts +++ b/e2e/tests/import-export/archive-import-persistence.spec.ts @@ -1,4 +1,5 @@ -import { test, expect, type Page, type Download } from '@playwright/test'; +import { test, expect } from '../../fixtures/test.fixture'; +import { type Page, type Download } from '@playwright/test'; import { ImportPage } from '../../pages/import.page'; import * as fs from 'fs'; diff --git a/e2e/tests/import-export/archive-subtasks.spec.ts b/e2e/tests/import-export/archive-subtasks.spec.ts index 65bb0b4c78..f30c603ef2 100644 --- a/e2e/tests/import-export/archive-subtasks.spec.ts +++ b/e2e/tests/import-export/archive-subtasks.spec.ts @@ -1,4 +1,5 @@ -import { test, expect, type Page, type Download } from '@playwright/test'; +import { test, expect } from '../../fixtures/test.fixture'; +import { type Page, type Download } from '@playwright/test'; import { ImportPage } from '../../pages/import.page'; import * as fs from 'fs'; diff --git a/e2e/utils/waits.ts b/e2e/utils/waits.ts index 226a0b3273..ef85123fd7 100644 --- a/e2e/utils/waits.ts +++ b/e2e/utils/waits.ts @@ -66,9 +66,12 @@ const dismissOnboardingPresets = async (page: Page): Promise => { .then(() => true) .catch(() => false); if (isVisible) { - await page.evaluate(() => - localStorage.setItem('SUP_ONBOARDING_PRESET_DONE', 'true'), - ); + await page.evaluate(() => { + localStorage.setItem('SUP_ONBOARDING_PRESET_DONE', 'true'); + localStorage.setItem('SUP_ONBOARDING_HINTS_DONE', 'true'); + localStorage.setItem('SUP_IS_SHOW_TOUR', 'true'); + localStorage.setItem('SUP_EXAMPLE_TASKS_CREATED', 'true'); + }); await page.reload({ waitUntil: 'domcontentloaded' }); await page.waitForTimeout(500); }