nightwatch icon indicating copy to clipboard operation
nightwatch copied to clipboard

(feat): added isPresent command to Element API

Open AritraLeo opened this issue 11 months ago • 1 comments

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 !

AritraLeo avatar Mar 06 '24 16:03 AritraLeo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 06 '24 16:03 CLAassistant

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.

garg3133 avatar May 22 '24 22:05 garg3133