Skip to content
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

Add isDisplayed() as an alias command for isVisible() in new Element API. #4105

Closed
3 tasks
garg3133 opened this issue Mar 8, 2024 · 5 comments · Fixed by #4107
Closed
3 tasks

Add isDisplayed() as an alias command for isVisible() in new Element API. #4105

garg3133 opened this issue Mar 8, 2024 · 5 comments · Fixed by #4107
Assignees

Comments

@garg3133
Copy link
Member

garg3133 commented Mar 8, 2024

Description of the bug/issue

For the newly added .isVisible() command on the new Element API, we should also add .isDisplayed() as an alias to it, so that we can use either browser.element().isVisible() or browser.element().isDisplayed() in our tests. .isDisplayed() is the standard command name in Selenium for checking the "visibility" of an element.

Steps to reproduce

Go to ecosia.js test in examples/tests directory and add browser.element('input[name=q]').isDisplayed(); at the top of the first test case (it block). You will see an error that browser.element(...).isDisplayed is not a function.

But if you replace isDisplayed() with isVisible() it will work fine.

So, we need to get isDisplayed() command working as well, similar to the isVisible() command, without the need to add any new file in the codebase.

TODO

  • Add isDisplayed as an alias to isVisible command.
  • Add some more test cases to test isDisplayed alias to the already present web-element/testIsVisible.js test file.
  • Add types and tests for types.
@uditrajput03
Copy link
Contributor

@garg3133 I have to write just one test case for IsDisplayed() into testIsVisible.js file or just replicate all that are present in that file

@Ritika8081
Copy link

@garg3133 please have a look on my PR Added isDisplayed() as an alias command for isVisible() in new Element API and added extra test cases #4109

@AritraLeo
Copy link
Contributor

@garg3133 Please have a look at my PR. I have tested the feature and ran the tests similar to isVisible(). Tests are passing for all provided cases.

@rampantvoid
Copy link

Generated a pull request. Completed all the TODO's, also ran tests locally and tried to reproduce the bug after making changes, no error was generated. Please have a look at my PR. @garg3133

@garg3133
Copy link
Member Author

garg3133 commented Mar 9, 2024

Assigning this issue to @uditrajput03 as he's the first one to come up with the correct solution for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment