From 068de45365b51e8e77fde9f5218ba849509383ef Mon Sep 17 00:00:00 2001 From: Harlan GitHub Agent Date: Mon, 12 Oct 2026 22:21:38 +1100 Subject: [PATCH 1/2] test(usercentrics): use the repo cold-start budget for the loader tag wait --- test/e2e/_usercentrics-suite.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/e2e/_usercentrics-suite.ts b/test/e2e/_usercentrics-suite.ts index 1894c0baf..0e8ee17a3 100644 --- a/test/e2e/_usercentrics-suite.ts +++ b/test/e2e/_usercentrics-suite.ts @@ -1,6 +1,11 @@ import { getBrowser, url } from '@nuxt/test-utils/e2e' import { expect, it } from 'vitest' +// The v3 loader tag renders after Nuxt resolves suspense and the idle callback +// runs. A cold fixture start on CI can push that well past domcontentloaded, +// so this wait needs the same cold-start budget as the other suites. +const COLD_START_TIMEOUT_MS = 30000 + // The real Usercentrics CMP v3 loader validates `data-ruleset-id` against // registered domains and silently no-ops on unknown origins. Tests stub the // loader request and inject a minimal `__ucCmp` shim plus synthesised @@ -45,7 +50,7 @@ export function defineUsercentricsSuite() { const page = await newPage() try { await page.goto(url('/'), { waitUntil: 'domcontentloaded', timeout: 30000 }) - await page.waitForSelector('script#usercentrics-cmp', { state: 'attached', timeout: 15000 }) + await page.waitForSelector('script#usercentrics-cmp', { state: 'attached', timeout: COLD_START_TIMEOUT_MS }) const attrs = await page.evaluate(() => { const el = document.getElementById('usercentrics-cmp') as HTMLScriptElement | null if (!el) @@ -62,7 +67,7 @@ export function defineUsercentricsSuite() { finally { await page.close() } - }, 60000) + }, 90000) it('fires UC_UI_CMP_EVENT events that the composable surfaces via onConsentChange', async () => { const page = await newPage() From cf712e0281c535731c6652b63332dd4e6ee9b4dd Mon Sep 17 00:00:00 2001 From: Harlan GitHub Agent Date: Mon, 12 Oct 2026 22:40:47 +1100 Subject: [PATCH 2/2] test(ahrefs): use the repo cold-start budget for the loader tag wait --- test/e2e/_ahrefs-analytics-suite.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/_ahrefs-analytics-suite.ts b/test/e2e/_ahrefs-analytics-suite.ts index cf79d1d11..f2970ef81 100644 --- a/test/e2e/_ahrefs-analytics-suite.ts +++ b/test/e2e/_ahrefs-analytics-suite.ts @@ -52,6 +52,11 @@ function buildStubAnalyticsJs(endpoint: string): string { ` } +// The loader tag renders after Nuxt resolves suspense and the idle callback +// runs. A cold fixture start on CI can push that well past domcontentloaded, +// so the wait needs a cold-start budget the 60s test timeout cannot cover. +const COLD_START_TIMEOUT_MS = 30000 + const CDN_STUB = buildStubAnalyticsJs('https://analytics.ahrefs.com/api/event') const BUNDLED_PROXY_PATH = '/_scripts/p/analytics.ahrefs.com/api/event' @@ -153,7 +158,7 @@ export function defineAhrefsAnalyticsSuite(opts: SuiteOptions) { const scriptSelector = opts.bundled ? 'script[src*="/_scripts/assets/"]' : 'script[src*="analytics.ahrefs.com/analytics.js"]' - await page.waitForSelector(scriptSelector, { state: 'attached', timeout: 30000 }) + await page.waitForSelector(scriptSelector, { state: 'attached', timeout: COLD_START_TIMEOUT_MS }) const tag = await page.evaluate((sel: string) => { const el = document.querySelector(sel) return el ? { src: el.src, key: el.getAttribute('data-key') } : null