-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expect.element(...).to.not.to.present fails when using index for the selector #3810
Comments
A very weird observation this gives the same Element .hero__title not found. An element could not be located on the page using the given search parameters. error
but just adding a console log, makes it pass
investigating more on this... |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the bug/issue
When I attempt to assert a specific index of an element is not present and the element is not present I except the assertion to pass, but instead I receive error
Steps to reproduce
Use
.expect.element({selector: 'some selector', index: 1}).to.not.be.present
in a test where the selector is present on the page, but only one instance of it is present...so there would be an index 0 but not index 1. The scenario I am trying to verify is that there aren't more than one of this particular item on the page.myPageObject.expect.element({selector: '@validSelectorAlias',
index: 1}).to.not.be.present;
Instead of passing the check that it is not present the test fails because it can't locate that selector at index 1. This works fine without using an index.
Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
2.6.21
Node Version
18
Browser
Chrome 114
Operating System
Windows 11
Additional Information
No response
The text was updated successfully, but these errors were encountered: