diff --git a/tests/about.spec.ts b/tests/about.spec.ts index 7512c9a4..a39a90aa 100644 --- a/tests/about.spec.ts +++ b/tests/about.spec.ts @@ -1,6 +1,7 @@ import { test, expect } from './utils' test.describe('About Page Tests', () => { - test.beforeEach(({ advancedRouteFromHAR }) => { + test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) advancedRouteFromHAR('tests/HAR/clearbutton.har', { updateContent: 'embed', update: false, diff --git a/tests/clearButton.spec.ts b/tests/clearButton.spec.ts index 2904d6a3..95ce7e68 100644 --- a/tests/clearButton.spec.ts +++ b/tests/clearButton.spec.ts @@ -24,6 +24,7 @@ async function selectLineNumberAndRoute(page: Page, lineNumber: Locator, route: test.describe('clearButton functionality', () => { test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) await i18next.use(Backend).init({ lng: 'he', backend: { diff --git a/tests/dashboard.spec.ts b/tests/dashboard.spec.ts index 6a40f95b..e6dce262 100644 --- a/tests/dashboard.spec.ts +++ b/tests/dashboard.spec.ts @@ -2,6 +2,7 @@ import { test, urlMatcher } from './utils' test.describe('dashboard tests', () => { test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) advancedRouteFromHAR('tests/HAR/dashboard.har', { updateContent: 'embed', update: false, diff --git a/tests/mainHeader.spec.ts b/tests/mainHeader.spec.ts index f8af4d95..4022b0c3 100644 --- a/tests/mainHeader.spec.ts +++ b/tests/mainHeader.spec.ts @@ -1,6 +1,7 @@ import { test, expect } from './utils' test.beforeEach(async ({ page }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) await page.goto('/') }) diff --git a/tests/menu.spec.ts b/tests/menu.spec.ts index c82e5385..69e3995e 100644 --- a/tests/menu.spec.ts +++ b/tests/menu.spec.ts @@ -1,6 +1,7 @@ import { test, expect, urlMatcher } from './utils' test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) advancedRouteFromHAR('tests/HAR/menu.har', { updateContent: 'embed', update: false, diff --git a/tests/realtimemap.spec.ts b/tests/realtimemap.spec.ts index d96e17f4..5ef609a3 100644 --- a/tests/realtimemap.spec.ts +++ b/tests/realtimemap.spec.ts @@ -1,6 +1,7 @@ import { test, urlMatcher } from './utils' test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) advancedRouteFromHAR('tests/HAR/realtimemap.har', { updateContent: 'embed', update: false, diff --git a/tests/singlelineTest.spec.ts b/tests/singlelineTest.spec.ts index 1279be56..f0c80913 100644 --- a/tests/singlelineTest.spec.ts +++ b/tests/singlelineTest.spec.ts @@ -5,6 +5,7 @@ test.describe('Single line page tests', () => { let singleLinePage: SinglelinePage test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) advancedRouteFromHAR('tests/HAR/singleline.har', { updateContent: 'embed', update: false, diff --git a/tests/timeline.spec.ts b/tests/timeline.spec.ts index 3d40620b..103f1b50 100644 --- a/tests/timeline.spec.ts +++ b/tests/timeline.spec.ts @@ -7,6 +7,7 @@ test.describe('Timeline Page Tests', () => { let timelinePage: TimelinePage test.beforeEach(async ({ page, advancedRouteFromHAR }) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) await i18next.use(Backend).init({ lng: 'he', backend: { diff --git a/tests/visual.spec.ts b/tests/visual.spec.ts index 0540d588..a7f6599a 100644 --- a/tests/visual.spec.ts +++ b/tests/visual.spec.ts @@ -19,6 +19,7 @@ test.describe('Visual Tests', () => { }) test.beforeEach(async ({ page }, testinfo) => { + await page.route(/google-analytics\.com|googletagmanager\.com/, (route) => route.abort()) if (!process.env.APPLITOOLS_API_KEY) { eyes.setIsDisabled(true) console.log('APPLITOOLS_API_KEY is not defined, please ask noamgaash for the key')