-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
upgraded EC::toBeClickable for pointer-events: none #14432
base: trunk
Are you sure you want to change the base?
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 |
User description
Upgraded
ExpectedCondition::toBeClickable
methods to correctly handle pointer-events: none.Description
ExpectedCondition::toBeClickable
methods to correctly handle pointer-events: none.Motivation and Context
Bug #14427
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
ExpectedCondition::elementToBeClickable
methods to correctly handle elements withpointer-events: none
.webdriverwait_tests.py
to verify that elements withpointer-events: none
are not considered clickable.javascriptPage.html
to include a button withpointer-events: none
for testing purposes.Changes walkthrough 📝
ExpectedConditions.java
Enhance elementToBeClickable to handle pointer-events: none
java/src/org/openqa/selenium/support/ui/ExpectedConditions.java
elementToBeClickable
methods to check forpointer-events:
none
.pointer-events: none
are not consideredclickable.
webdriverwait_tests.py
Add test for pointer-events: none in clickable elements
py/test/selenium/webdriver/common/webdriverwait_tests.py
pointer-events: none
.pointer-events: none
are not clickable.javascriptPage.html
Add example button with pointer-events: none
common/src/web/javascriptPage.html
pointer-events: none
for testing.