mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(): update e2e structure for accordion tests so screenshots run (#23370)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
10
core/src/components/accordion/test/basic/e2e.ts
Normal file
10
core/src/components/accordion/test/basic/e2e.ts
Normal 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();
|
||||
});
|
||||
11
core/src/components/accordion/test/standalone/e2e.ts
Normal file
11
core/src/components/accordion/test/standalone/e2e.ts
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user