mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
fix(test): rsolve race conditions with toast and item
This commit is contained in:
@ -15,8 +15,10 @@ test('item: inputs', async () => {
|
|||||||
expect(compare).toMatchScreenshot();
|
expect(compare).toMatchScreenshot();
|
||||||
|
|
||||||
// Disable everything
|
// Disable everything
|
||||||
await page.click('#btnDisabled');
|
const disableToggle = await page.find('#btnDisabled');
|
||||||
await page.waitFor(500);
|
await disableToggle.waitForVisible();
|
||||||
|
await disableToggle.click();
|
||||||
|
await page.waitFor(100);
|
||||||
|
|
||||||
// check form
|
// check form
|
||||||
await page.click('#submit');
|
await page.click('#submit');
|
||||||
@ -28,7 +30,7 @@ test('item: inputs', async () => {
|
|||||||
expect(compare).toMatchScreenshot();
|
expect(compare).toMatchScreenshot();
|
||||||
|
|
||||||
// Reenable and set some value
|
// Reenable and set some value
|
||||||
await page.click('#btnDisabled');
|
await disableToggle.click();
|
||||||
await page.click('#btnSomeValue');
|
await page.click('#btnSomeValue');
|
||||||
await page.waitFor(100);
|
await page.waitFor(100);
|
||||||
|
|
||||||
@ -64,5 +66,6 @@ test('item: inputs', async () => {
|
|||||||
|
|
||||||
async function checkFormResult(page: E2EPage, content: string) {
|
async function checkFormResult(page: E2EPage, content: string) {
|
||||||
const div = await page.find('#form-result');
|
const div = await page.find('#form-result');
|
||||||
|
|
||||||
expect(div.textContent).toEqual(content);
|
expect(div.textContent).toEqual(content);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,10 +16,12 @@ export async function testToast(
|
|||||||
|
|
||||||
const screenshotCompares = [];
|
const screenshotCompares = [];
|
||||||
|
|
||||||
await page.click(selector);
|
const button = await page.find(selector);
|
||||||
await page.waitForSelector(selector);
|
await button.waitForVisible();
|
||||||
|
await button.click();
|
||||||
|
|
||||||
let toast = await page.find('ion-toast');
|
let toast = await page.find('ion-toast');
|
||||||
|
await toast.waitForVisible();
|
||||||
|
|
||||||
expect(toast).not.toBe(null);
|
expect(toast).not.toBe(null);
|
||||||
await toast.waitForVisible();
|
await toast.waitForVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user