You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we do browser.element.find(selector).assert.present(), if the element is not found, we get the NoSuchElementError error, but in case of assert.present, this error should be suppressed since the failure of the assertion would anyway signify that the element is not present.
The same also goes for the .assert.not.present() assertion. In this case, if the element is not present, the assertion should normally pass without the NoSuchElementError.
(The test should pass with 0 errors unlike in the above screenshot.)
The text was updated successfully, but these errors were encountered:
Hey @garg3133 I am a beginner at Open Source. So can I contribute to this issue, if yes. can you please specify what parts of the projects do I need to look at for fixing this issue.
Hey, the scoped-element.js file and the assert/element-assertions.js file are the two main files you should try to look at to solve this issue. Also, you can refer to the implementation of the isPresent command in the new Element API, which also automatically suppresses the NoSuchElementFound error as required in this issue: https://github.com/nightwatchjs/nightwatch/pull/4216/files
You might need to use the VSCode JS Debugger to understand how this part of the code works before solving this issue.
Description
When we do
browser.element.find(selector).assert.present()
, if the element is not found, we get theNoSuchElementError
error, but in case ofassert.present
, this error should be suppressed since the failure of the assertion would anyway signify that the element is not present.The same also goes for the
.assert.not.present()
assertion. In this case, if the element is not present, the assertion should normally pass without theNoSuchElementError
.(The test should pass with 0 errors unlike in the above screenshot.)
The text was updated successfully, but these errors were encountered: