test(e2e): update e2e tests for screenshot (#16056)

This commit is contained in:
Adam Bradley
2018-10-23 23:56:40 -05:00
committed by GitHub
parent 02ef52b85c
commit d800c48734
12 changed files with 19 additions and 4 deletions

View File

@ -19,6 +19,7 @@ it('action-sheet: alertFromActionSheet', async () => {
const alert = await page.find('ion-alert');
await alert.waitForVisible();
await page.waitFor(100);
compare = await page.compareScreenshot(`alert open`);
expect(compare).toMatchScreenshot();

View File

@ -21,6 +21,7 @@ it('alert: standalone', async () => {
const alert = await page.find('ion-alert');
expect(alert).not.toBe(null);
await alert.waitForVisible();
await page.waitFor(100);
const compare = await page.compareScreenshot(message);
expect(compare).toMatchScreenshot();

View File

@ -20,7 +20,10 @@ export class App implements ComponentInterface {
rIC(() => {
const { win, config, queue } = this;
if (!config.getBoolean('_testing')) {
importTapClick(win);
}
importInputShims(win, config);
importStatusTap(win, config, queue);
importHardwareBackButton(win, config);

View File

@ -13,6 +13,7 @@ it('datetime: basic', async () => {
const picker = await page.find('ion-picker');
await picker.waitForVisible();
await page.waitFor(100);
compare = await page.compareScreenshot('should open custom picker');
expect(compare).toMatchScreenshot();

View File

@ -10,6 +10,7 @@ it('loading: standalone', async () => {
expect(loading).not.toBeNull();
await loading.waitForVisible();
await page.waitFor(500);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();

View File

@ -39,7 +39,7 @@
await loadingController.componentOnReady();
const loadingElement = await loadingController.create({
message: 'Hellooo',
duration: 2000
duration: 5000
});
return await loadingElement.present();
}

View File

@ -9,6 +9,9 @@ it('popover: standalone', async () => {
const popover = await page.find('ion-popover');
expect(popover).not.toBeNull();
await popover.waitForVisible();
await page.waitFor(500);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});

View File

@ -13,6 +13,7 @@ it('select: single-value', async () => {
const alert = await page.find('ion-alert');
await alert.waitForVisible();
await page.waitFor(100);
compare = await page.compareScreenshot('should open gender single select');
expect(compare).toMatchScreenshot();

View File

@ -5,6 +5,8 @@ it('slides: basic', async () => {
url: '/src/components/slides/test/basic?ionic:_testing=true'
});
await page.waitFor(500);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});

View File

@ -22,7 +22,7 @@
<ion-content id="content">
<ion-slides style="background: black" id="slides" pager>
<ion-slide style="background: red; color: white;">
<ion-slide style="background: rgb(0, 200, 0); color: white;">
<h1>Slide 1</h1>
</ion-slide>
<ion-slide style="background: white; color: blue;">

View File

@ -5,6 +5,8 @@ it('slides: standalone', async () => {
url: '/src/components/slides/test/standalone?ionic:_testing=true'
});
await page.waitFor(500);
const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
});

View File

@ -13,7 +13,7 @@
<body>
<ion-slides style="background: black" pager="true">
<ion-slide style="background: red; color: white;">
<ion-slide style="background: green; color: white;">
<h1>Slide 1</h1>
</ion-slide>