From 21ea1d89eb06b04a1b60a51028a3bbf3f326e14f Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Wed, 22 Nov 2023 17:53:09 -0600 Subject: [PATCH] Page reload #1634 --- tests/styleguide.spec.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/styleguide.spec.ts b/tests/styleguide.spec.ts index 77ea56c0b6..78c7e25079 100644 --- a/tests/styleguide.spec.ts +++ b/tests/styleguide.spec.ts @@ -39,14 +39,13 @@ test.beforeAll(async ({ browser }) => { }); // Iterate over all sample sections and take a screenshot of each one. -test('UI regression test - Styleguide sections', async ({ context }) => { +test('UI regression test - Styleguide sections', async ({ page }) => { for (let i = 0; i < sampleSectionIds.length; i += 1) { - const page = await context.newPage(); - const id = sampleSectionIds[i]; // Isolate the section await page.goto(`/ide/styleguide?isolateSection=true#${id}`); + await page.reload(); const sampleSection = page.locator(`#${id}`); @@ -55,8 +54,6 @@ test('UI regression test - Styleguide sections', async ({ context }) => { await expect(sampleSection).toHaveScreenshot( `${id.replace(/^sample-section-/, '')}.png` ); - - await page.close(); } });