browser-monkey
browser-monkey copied to clipboard
shouldNotExist passes when it should fail
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.
perhaps shouldDisappear() ? So we first check that it exists, then ensure that it disappears.
yeah that might be a good option actually!