From 9cfd6d7ff061ef01fe90783821f299c6b63ea760 Mon Sep 17 00:00:00 2001 From: literat Date: Mon, 25 Sep 2023 12:32:55 +0200 Subject: [PATCH] fixup! Test(demo): Introduce E2E test for homepage refs #DS-869 --- tests/e2e/demo-homepages.spec.ts | 4 ++-- tests/e2e/example.spec.ts | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 tests/e2e/example.spec.ts diff --git a/tests/e2e/demo-homepages.spec.ts b/tests/e2e/demo-homepages.spec.ts index 1b72617682..9c67161966 100644 --- a/tests/e2e/demo-homepages.spec.ts +++ b/tests/e2e/demo-homepages.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; test.describe('Demo Homepages', () => { const demos = [ @@ -15,7 +15,7 @@ test.describe('Demo Homepages', () => { for (const demo of demos) { test(`test demo homepage ${demo.package}`, async ({ page }) => { await page.goto(demo.url); - await expect(page).toHaveScreenshot(`${demo.package}.png`, { fullPage: true }); + await expect(page).toHaveScreenshot(`${demo.package}.png`, { fullPage: true, maxDiffPixelRatio: 0.01 }); }); } }); diff --git a/tests/e2e/example.spec.ts b/tests/e2e/example.spec.ts deleted file mode 100644 index 54a906a4e8..0000000000 --- a/tests/e2e/example.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('has title', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Expect a title "to contain" a substring. - await expect(page).toHaveTitle(/Playwright/); -}); - -test('get started link', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Click the get started link. - await page.getByRole('link', { name: 'Get started' }).click(); - - // Expects page to have a heading with the name of Installation. - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -});