Skip to content

Commit

Permalink
test(e2e): fix e2e screenshot wait (ionic-team#17110)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley authored Jan 14, 2019
1 parent a9a23af commit 003eb2f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/src/components/item/test/inputs/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ test('item: inputs', async () => {
// check form
await page.click('#submit');
await checkFormResult(page, '{"date":"","select":"n64","toggle":"","input":"","input2":"","checkbox":""}');
await page.waitFor(100);

// Default case, enabled and no value
let compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();

// Disable everything
await page.click('#btnDisabled');
await page.waitFor(250);

// check form
await page.click('#submit');
await checkFormResult(page, '{}');
await page.waitFor(100);

// screenshot
compare = await page.compareScreenshot('should disable all');
Expand All @@ -33,27 +34,28 @@ test('item: inputs', async () => {
// check form
await page.click('#submit');
await checkFormResult(page, '{"date":"2016-12-09","select":"nes","toggle":"on","input":"Some text","input2":"Some text","checkbox":"on"}');
await page.waitFor(100);

compare = await page.compareScreenshot('should reenable and set value');
expect(compare).toMatchScreenshot();

// Set "null"
await page.click('#btnNullValue');
await page.waitFor(250);
await page.waitFor(100);

compare = await page.compareScreenshot('should set null');
expect(compare).toMatchScreenshot();

// Set "empty"
await page.click('#btnEmptyValue');
await page.waitFor(250);
await page.waitFor(100);

compare = await page.compareScreenshot('should set empty');
expect(compare).toMatchScreenshot();

// Set "empty"
await page.click('#btnEmptyValue');
await page.waitFor(250);
await page.waitFor(100);

compare = await page.compareScreenshot('should set empty');
expect(compare).toMatchScreenshot();
Expand Down
6 changes: 6 additions & 0 deletions core/src/components/menu/test/basic/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ test('menu: basic', async () => {
]);

await start.callMethod('open');
await start.waitForVisible();
await page.waitFor(250);
expect(await page.compareScreenshot('start menu')).toMatchScreenshot();

await start.callMethod('close');
await page.waitFor(250);

const end = await page.find('ion-menu[side="end"]');
expect(end).toHaveClasses([
Expand All @@ -24,5 +28,7 @@ test('menu: basic', async () => {
]);

await end.callMethod('open');
await end.waitForVisible();
await page.waitFor(250);
expect(await page.compareScreenshot('end menu')).toMatchScreenshot();
});
6 changes: 6 additions & 0 deletions core/src/components/menu/test/standalone/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ test('menu: standalone', async () => {
]);

await start.callMethod('open');
await start.waitForVisible();
await page.waitFor(250);
expect(await page.compareScreenshot('start menu')).toMatchScreenshot();

await start.callMethod('close');
await page.waitFor(250);

const end = await page.find('ion-menu[side="end"]');
expect(end).toHaveClasses([
Expand All @@ -25,5 +29,7 @@ test('menu: standalone', async () => {
]);

await end.callMethod('open');
await end.waitForVisible();
await page.waitFor(250);
expect(await page.compareScreenshot('end menu')).toMatchScreenshot();
});

0 comments on commit 003eb2f

Please sign in to comment.