nightwatch
nightwatch copied to clipboard
(feat): added isPresent command to Element API
I've added the isPresent() command as per the issue . Although the code encountered a error in unit testing at - .navigateTo('https://duckduckgo.com') line : 7 of duckDuckGo.js file.
I am mainly raising the PR to get my code reviewed to get a better understanding if I am moving in the right direction or not !
Closing this PR because the current solution is incorrect (it will always return true
because the webElementOrId
argument to isElementPresent
will always be a WebElementPromise
, which in turn is an instance of WebElement
. So, element instanceof WebElement
will always return true
even if the element actually does not exist.
Also, as it turns out, the solution to this is not going to be simple and will take a lot more efforts to implement, so we'll be doing it ourselves.