fix(test): rsolve race conditions with toast and item

This commit is contained in:
Liam DeBeasi
2019-06-12 11:41:26 -04:00
parent 320719b904
commit b85b7c6b9d
2 changed files with 10 additions and 5 deletions

View File

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

View File

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