browser-monkey icon indicating copy to clipboard operation
browser-monkey copied to clipboard

shouldNotExist passes when it should fail

Open dereke opened this issue 9 years ago • 2 comments

when you are checking that something does not exist:

browser.find('.irrelevant-option').shouldNotExist()

but it is dependent on a previous action making it display in the first place:

browser.find('.show').click().then(function(){
  return browser.find('.irrelevant-option').shouldNotExist();
})

The assertion will often pass as the browser has not had a chance to render the previous action (which erroneously displays the irrelevant option). Therefore I think shouldNotExist should be run inside a setTimeout 0. This seems to fix the issue in my testing.

dereke avatar Jan 23 '16 10:01 dereke

perhaps shouldDisappear() ? So we first check that it exists, then ensure that it disappears.

refractalize avatar Apr 19 '16 16:04 refractalize

yeah that might be a good option actually!

dereke avatar Apr 19 '16 16:04 dereke