pioneer icon indicating copy to clipboard operation
pioneer copied to clipboard

isVisible and isPresent should never throw and only return booleans

Open samccone opened this issue 10 years ago • 1 comments

samccone avatar Oct 22 '14 18:10 samccone

Isn't this already how it works? I tried to check if a DOM element is not present today and this (sadly) didn't work:

@Then /^there should be no "([^"]*)" form field$/, (fieldClass) ->
    @currentForm.isPresent(".#{fieldClass}").should.eventually.be.rejected

But this works:

@Then /^there should be no "([^"]*)" form field$/, (fieldClass) ->
    @currentForm.isPresent(".#{fieldClass}")
    .then((isPresent) -> isPresent.should.be.false)

So it seems that isPresent never throws but only returns boolean values :wink:

DominikGuzei avatar Apr 16 '15 10:04 DominikGuzei