From 8c6163c5b6dcc4e7945d181a249c43fbfc05ee88 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 26 May 2021 11:54:41 -0400 Subject: [PATCH] chore(): update e2e structure for accordion tests so screenshots run (#23370) --- .../accordion/test/{ => a11y}/e2e.ts | 19 ------------------- .../components/accordion/test/basic/e2e.ts | 10 ++++++++++ .../accordion/test/standalone/e2e.ts | 11 +++++++++++ 3 files changed, 21 insertions(+), 19 deletions(-) rename core/src/components/accordion/test/{ => a11y}/e2e.ts (72%) create mode 100644 core/src/components/accordion/test/basic/e2e.ts create mode 100644 core/src/components/accordion/test/standalone/e2e.ts diff --git a/core/src/components/accordion/test/e2e.ts b/core/src/components/accordion/test/a11y/e2e.ts similarity index 72% rename from core/src/components/accordion/test/e2e.ts rename to core/src/components/accordion/test/a11y/e2e.ts index 305fdc7dca..95082c90db 100644 --- a/core/src/components/accordion/test/e2e.ts +++ b/core/src/components/accordion/test/a11y/e2e.ts @@ -1,5 +1,4 @@ import { newE2EPage } from '@stencil/core/testing'; -import { AxePuppeteer } from '@axe-core/puppeteer'; const getActiveElementText = async (page) => { const activeElement = await page.evaluateHandle(() => document.activeElement); @@ -15,15 +14,6 @@ test('accordion: a11y', async () => { expect(compare).toMatchScreenshot(); }); -test('accordion: basic', async () => { - const page = await newE2EPage({ - url: '/src/components/accordion/test/basic?ionic:_testing=true' - }); - - const compare = await page.compareScreenshot(); - expect(compare).toMatchScreenshot(); -}); - test('accordion:rtl: a11y', async () => { const page = await newE2EPage({ url: '/src/components/accordion/test/a11y?ionic:_testing=true&rtl=true' @@ -53,12 +43,3 @@ test('accordion: keyboard navigation', async () => { await page.keyboard.press('ArrowUp'); expect(await getActiveElementText(page)).toEqual('Shipping Address'); }); - -test('accordion: axe', async () => { - const page = await newE2EPage({ - url: '/src/components/accordion/test/standalone?ionic:_testing=true' - }); - - const results = await new AxePuppeteer(page).analyze(); - expect(results.violations.length).toEqual(0); -}); diff --git a/core/src/components/accordion/test/basic/e2e.ts b/core/src/components/accordion/test/basic/e2e.ts new file mode 100644 index 0000000000..2b55cd527d --- /dev/null +++ b/core/src/components/accordion/test/basic/e2e.ts @@ -0,0 +1,10 @@ +import { newE2EPage } from '@stencil/core/testing'; + +test('accordion: basic', async () => { + const page = await newE2EPage({ + url: '/src/components/accordion/test/basic?ionic:_testing=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +}); diff --git a/core/src/components/accordion/test/standalone/e2e.ts b/core/src/components/accordion/test/standalone/e2e.ts new file mode 100644 index 0000000000..cfb1c05054 --- /dev/null +++ b/core/src/components/accordion/test/standalone/e2e.ts @@ -0,0 +1,11 @@ +import { newE2EPage } from '@stencil/core/testing'; +import { AxePuppeteer } from '@axe-core/puppeteer'; + +test('accordion: axe', async () => { + const page = await newE2EPage({ + url: '/src/components/accordion/test/standalone?ionic:_testing=true' + }); + + const results = await new AxePuppeteer(page).analyze(); + expect(results.violations.length).toEqual(0); +});