as the title says- is there a difference between (for example)
expect(element).isDisplayed().toBeTruthy();
and
expect(element).isDisplayed().toBe(truth);
and if so what is the difference?
thanks
Many things are Truthy
(i.e. anything that is not one of: false, 0, "", undefined, null, NaN).
So
expect('apple').toBeTruthy();
passes. But:
expect('apple').toBe(true);
fails.
That being said, if you know you are testing a boolean, to me using toBeTruthy
looks nicer.