mardi 28 août 2018

Better way to do positive assertions in protractor

Test:

  1. Send keys to a text box --> use sendKeys

  2. Verify that no error message is seen --> use EC.invisibility or not of isDisplayed

We have a bug in our system and displays the error message, though input text is right. However above test succeeds because Angular took few additional microseconds to display error message, but in the meantime protractor already verified no error message.

To get away from it, I added browser.sleep between steps 1 and 2, but that is not a good way. Is there a better approach for it?

Aucun commentaire:

Enregistrer un commentaire