Testing the contents of a temporary element with protractor

后端 未结 6 1692
清酒与你
清酒与你 2021-01-04 09:12

I\'m trying to test the login page on my site using protractor.

If you log in incorrectly, the site displays a \"toast\" message that pops up for 5 seconds, then dis

6条回答
  •  走了就别回头了
    2021-01-04 09:34

    Chris-Traynor's answer worked for me but i've got an update.

    ignoreSynchronization is now deprecated. For those using angular and protractor to test this, the below works nicely for me.

    $(locators.button).click();
    await browser.waitForAngularEnabled(false);
    const isDisplayed = await $(locators.notification).isPresent();
    await browser.waitForAngularEnabled(true);
    expect(isDisplayed).toEqual(true);
    

    I've simplified this to make it easier to see, I would normally place this inside a method to make the locators dynamic.

提交回复
热议问题