From d5e6965c3c526c2c2e40cdd5b9fec322e5d9fc48 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 17 Nov 2024 22:58:47 +0100 Subject: [PATCH] fix: remove all-tools single e2e spec test --- src/tools/all-tools.e2e.spec.ts | 46 --------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/tools/all-tools.e2e.spec.ts diff --git a/src/tools/all-tools.e2e.spec.ts b/src/tools/all-tools.e2e.spec.ts deleted file mode 100644 index dd2dc24a..00000000 --- a/src/tools/all-tools.e2e.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { expect, test } from '@playwright/test'; - -const ignoredHrefs = new Set(['/camera-recorder']); - -test.describe('IT Tool', () => { - test('Loads all tools correctly', async ({ page }) => { - test.slow(); - - const allTools: string[] = []; - - await page.goto('/'); - await page.waitForSelector('.it-tool-link'); - const allLinks = await page.locator('.it-tool-link').all(); - for (const a of allLinks) { - allTools.push((await a.getAttribute('href')) || '/'); - } - - expect(allTools.length).toBeGreaterThan(0); - - const errors: Array = []; - - page.on('pageerror', (error) => { - // ignore errors related to physical devices (ie camera recorder) - if (error.message.match(/Requested device not found/)) { - return; - } - errors.push(error); - }); - - for (const toolHref of allTools) { - if (ignoredHrefs.has(toolHref)) { - continue; - } - await test.step(toolHref, async () => { - errors.splice(0, errors.length); - - await page.goto(toolHref); - await page.waitForSelector('.tool-header'); - - await expect(page).toHaveTitle(/.+ - IT Tools/); - - expect(errors, `${toolHref} to have no JS error`).toHaveLength(0); - }); - } - }); -});