nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.85k stars 1.34k forks source link

Add `isActive()` command to new Element API #4261

Closed dikwickley closed 2 weeks ago

dikwickley commented 2 months ago

This PR adds a new isActive() command to the new Element API Fixes: https://github.com/dikwickley/gsoc24/issues/6

Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.

github-actions[bot] commented 2 months ago

Status

dikwickley commented 1 month ago

@garg3133 added some tests.

garg3133 commented 1 month ago

@dikwickley I just found out that we in fact already have the implementations for the computedrole and computedlabel under the command names of getAriaRole and getAccessibleName. So, instead of creating a new command for these two, we just need to add aliases in the existing commands (along with added test cases in the existing test files and types).

Also, for the isActive command, it would be better to use the endpoint itself (following the standards). I see a method already present in the method-mappings file for getting the active element, we could use that method inside the isElementActive method to get the element id of the currently active element and then compare it with the id of the element passed. Also, the isActive command would also require some basic tests.

garg3133 commented 4 weeks ago

@dikwickley Any updates here?

dikwickley commented 4 weeks ago

@garg3133 i will add the new aliases and will send in the code for isActive soon.