chore(): update e2e structure for accordion tests so screenshots run (#23370)

This commit is contained in:
Liam DeBeasi
2021-05-26 11:54:41 -04:00
committed by GitHub
parent 7d47c91641
commit 8c6163c5b6
3 changed files with 21 additions and 19 deletions

View File

@@ -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);
});

View File

@@ -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();
});

View File

@@ -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);
});