-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java][py] Upgraded EC::toBeClickable for pointer-events: none #14432
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
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
|
It might be better to raise a speaking WebDriverException instead of just returning false, this could help people to understand what is wrong. Beside this, i am not sure this will work as expected. The webdriver will click the center of the element, if this would hit the element or a child inside it is considered as a working click and will be performed, otherwise a So i would expect element.click() to work in case the element has |
|
PS: comparing strings with |
I'm totally up for suggestions and don't mind reworking the solution. What do you think would be a better way of accomplishing this? My thinking was that we already raise a webdriverexception from the element.click() if the element and no children are clickable, so wouldn't adding the pointer-events:none to the check if an element is clickable be sufficient? Or are you saying we should update the exception to tell you what the cause of it not being clickable is?
Good catch |
!= is a reference check in Java, upgraded to .equalsIgnoreCase
|
Don't get me wrong, but i think the only way to check if something is clickable is to click and check exactly the expected action happens. And this check does not cover cases other unexpected things are happening too. And this check is not invertable, e.g. to check the click will open a popup is possible, but it might have run javascript and modified the original page too. It might be possible in the future to implement a People are assuming the So i think it would be the best to deprecate it now and remove it in Selenium 5. |
|
That was one of my original concerns with this bug ticket. At the end of the day I can move my mouse around and click anything I want, things just might not happen. I like the idea of |
|
Adding an EC of |
|
@VietND96 I don't think this should be merged, see my concerns above in #14432 (comment) |
|
Ah yes, I saw. I just adding a label for filtering PRs that have the potential to merge. Of course, the PR needs to be reviewed and approved. |
User description
Upgraded
ExpectedCondition::toBeClickablemethods to correctly handle pointer-events: none.Description
ExpectedCondition::toBeClickablemethods to correctly handle pointer-events: none.Motivation and Context
Bug #14427
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
ExpectedCondition::elementToBeClickablemethods to correctly handle elements withpointer-events: none.webdriverwait_tests.pyto verify that elements withpointer-events: noneare not considered clickable.javascriptPage.htmlto include a button withpointer-events: nonefor testing purposes.Changes walkthrough 📝
ExpectedConditions.java
Enhance elementToBeClickable to handle pointer-events: nonejava/src/org/openqa/selenium/support/ui/ExpectedConditions.java
elementToBeClickablemethods to check forpointer-events:none.pointer-events: noneare not consideredclickable.
webdriverwait_tests.py
Add test for pointer-events: none in clickable elementspy/test/selenium/webdriver/common/webdriverwait_tests.py
pointer-events: none.pointer-events: noneare not clickable.javascriptPage.html
Add example button with pointer-events: nonecommon/src/web/javascriptPage.html
pointer-events: nonefor testing.