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