How do i use jasmine to simply check if element exist on the page by id?
I went over the matchers, toExist()
not seems to solve this issue.
This is what i tried:
1. expect(by.id('my-id')).not.toExist();
2. expect($(document)).not.toContain($(#my-id));
can you help?
Using Protractor v1.x (without angularjs-jasmine-matchers):
expect(element(by.id('my-id')).isPresent()).toBe(true);
To use the angularjs-jasmine-matchers, you could write the test like this:
expect('#my-id').not.toExist();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With