test(e2e): fix e2e screenshot wait (#17110)

This commit is contained in:
Adam Bradley
2019-01-14 16:56:08 -06:00
committed by GitHub
parent a9a23afce6
commit 003eb2faff
3 changed files with 18 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ 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();
@@ -15,11 +16,11 @@ test('item: inputs', async () => {
// 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');
@@ -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();

View File

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

View File

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