From 3e2968079215badc9fa8a6cc48fe807d87428608 Mon Sep 17 00:00:00 2001 From: Tomek Date: Mon, 17 Aug 2026 13:14:47 +0200 Subject: [PATCH] Stabilize visual CI tests (#4506) Co-authored-by: Claude Haiku 4.5 --- packages/gitbook/e2e/customers.spec.ts | 4 +++- packages/gitbook/e2e/internal.spec.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/gitbook/e2e/customers.spec.ts b/packages/gitbook/e2e/customers.spec.ts index d464f4b1a..4c7f417b7 100644 --- a/packages/gitbook/e2e/customers.spec.ts +++ b/packages/gitbook/e2e/customers.spec.ts @@ -360,7 +360,9 @@ const testCases: TestsCase[] = [ { name: 'docs.verifone.com', contentBaseURL: 'https://docs.verifone.com', - tests: [{ name: 'Home', url: '/', run: waitForCookiesDialog }], + // Verifone's custom Cookiebot integration races with and suppresses GitBook's built-in + // banner, so waitForCookiesDialog is not a stable invariant here. + tests: [{ name: 'Home', url: '/' }], }, // Deactivate it because of a custom Ask AI that causes flakiness. // { diff --git a/packages/gitbook/e2e/internal.spec.ts b/packages/gitbook/e2e/internal.spec.ts index 1d85c094c..64cbffbdb 100644 --- a/packages/gitbook/e2e/internal.spec.ts +++ b/packages/gitbook/e2e/internal.spec.ts @@ -2413,7 +2413,7 @@ const testCases: TestsCase[] = [ actions.nth(1).click(), ]); // Verify the new page would have opened with the expected URL - expect(newPage.url()).toContain('gitbook.com'); + await expect(newPage).toHaveURL(/gitbook\.com/); // Close it immediately to avoid navigation await newPage.close(); @@ -2561,7 +2561,7 @@ const testCases: TestsCase[] = [ openInNewTabButton.click(), ]); // Verify the new page would have opened with the expected URL - expect(newPage.url()).toContain('gitbook.gitbook.io'); + await expect(newPage).toHaveURL(/gitbook\.gitbook\.io/); // Close it immediately to avoid navigation await newPage.close(); },