From 979d7841236c7464af8c02a734ddbf309116810f Mon Sep 17 00:00:00 2001 From: Bernardo Cardoso Date: Tue, 9 Apr 2024 16:43:37 +0100 Subject: [PATCH] Improve shape test --- .../components/chip/test/shape/chip.e2e.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/core/src/components/chip/test/shape/chip.e2e.ts b/core/src/components/chip/test/shape/chip.e2e.ts index 457970c3b5..57e53b8108 100644 --- a/core/src/components/chip/test/shape/chip.e2e.ts +++ b/core/src/components/chip/test/shape/chip.e2e.ts @@ -6,12 +6,12 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh * This behavior only applies to Ionic Theme. */ test.describe(title('chip: shape'), () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/src/components/chip/test/shape`, config); + }); + test.describe('default', () => { test('should not have visual regressions', async ({ page }) => { - await page.goto(`/src/components/chip/test/shape`, config); - - await page.setIonViewport(); - const container = page.locator('#default'); await expect(container).toHaveScreenshot(screenshot(`chip-default`)); @@ -20,10 +20,6 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh test.describe('soft', () => { test('should not have visual regressions', async ({ page }) => { - await page.goto(`/src/components/chip/test/shape`, config); - - await page.setIonViewport(); - const container = page.locator('#soft'); await expect(container).toHaveScreenshot(screenshot(`chip-soft`)); @@ -32,10 +28,6 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh test.describe('round', () => { test('should not have visual regressions', async ({ page }) => { - await page.goto(`/src/components/chip/test/shape`, config); - - await page.setIonViewport(); - const container = page.locator('#round'); await expect(container).toHaveScreenshot(screenshot(`chip-round`)); @@ -44,10 +36,6 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh test.describe('rectangular', () => { test('should not have visual regressions', async ({ page }) => { - await page.goto(`/src/components/chip/test/shape`, config); - - await page.setIonViewport(); - const container = page.locator('#rectangular'); await expect(container).toHaveScreenshot(screenshot(`chip-rectangular`));