mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(e2e): fix e2e screenshot wait (#17110)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user