test(utils): migrate utils e2e tests to playwright (#26377)

This commit is contained in:
Liam DeBeasi
2022-11-30 15:53:25 -05:00
committed by GitHub
parent 13fe669dc1
commit db4cdeb444
36 changed files with 485 additions and 1480 deletions

View File

@ -1,10 +0,0 @@
import { newE2EPage } from '@stencil/core/testing';
test('slides: basic', async () => {
const page = await newE2EPage({
url: '/src/components/slides/test/basic?ionic:_testing=true',
});
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});

View File

@ -1,10 +0,0 @@
import { newE2EPage } from '@stencil/core/testing';
test('slides: image', async () => {
const page = await newE2EPage({
url: '/src/components/slides/test/image?ionic:_testing=true',
});
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});

View File

@ -1,33 +0,0 @@
import { newE2EPage } from '@stencil/core/testing';
test('slides: prevent-default', async () => {
// For this specific test, _testing=false to import tap-click in app.tsx
const page = await newE2EPage({
url: '/src/components/slides/test/prevent-default?ionic:_testing=false',
});
const screenshotCompares = [];
screenshotCompares.push(await page.compareScreenshot());
const scroller = await page.find('#scrollDownButton');
const button = await page.find('#changeBackgroundButton');
const contentWithBackground = await page.find('#contentWithBackground');
await page.waitForTimeout(500);
await scroller.click();
await page.waitForTimeout(500);
screenshotCompares.push(await page.compareScreenshot('scroll down button'));
await button.click();
screenshotCompares.push(await page.compareScreenshot('change background'));
expect(contentWithBackground).toHaveClasses(['blueBackground']);
for (const screenshotCompare of screenshotCompares) {
expect(screenshotCompare).toMatchScreenshot();
}
});

View File

@ -1,10 +0,0 @@
import { newE2EPage } from '@stencil/core/testing';
test('slides: vertical', async () => {
const page = await newE2EPage({
url: '/src/components/slides/test/vertical?ionic:_testing=true',
});
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});