-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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 isEnabled to handle pointer-events: none; updated formPage.h… #14428
Conversation
…tml with example; added pytest
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation is logically wrong.
Please read #14427 (comment)
def test_should_return_false_for_enabled_element_with_pointer_events_set_to_none(driver, pages): | ||
pages.load("formPage.html") | ||
inputElement = driver.find_element(By.ID, "pointerEventsNone") | ||
assert not inputElement.is_enabled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong:
- The element is enabled.
- The element is only not clickable (does not receive pointer events)
- The element can still be triggered by keyboard
Please read #14427 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -190,5 +190,8 @@ | |||
</form> | |||
|
|||
<input id="vsearchGadget" name="SearchableText" type="text" size="18" value="" title="Hvad søger du?" accesskey="4" class="inputLabel" /> | |||
|
|||
<button id="pointerEventsNone" style="pointer-events: none;"><span>I'm an effectively disabled button</span></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. This is not a disabled button.
It does only not receive any pointer events. It can still be triggered by keyboard.
Also see #14427 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User description
Upgraded isEnabled() to handle attribute pointer-events: none
Description
Motivation and Context
Bug #14427
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
isEnabled
function to handle elements withpointer-events: none
, ensuring they are treated as disabled.element_attribute_tests.py
to verify that elements withpointer-events: none
are correctly identified as not enabled.formPage.html
to include a button withpointer-events: none
for testing purposes.Changes walkthrough 📝
dom.js
Enhance isEnabled function to handle pointer-events: none
javascript/atoms/dom.js
pointer-events: none
inisEnabled
function.pointer-events: none
.element_attribute_tests.py
Add test for pointer-events: none handling in isEnabled
py/test/selenium/webdriver/common/element_attribute_tests.py
pointer-events: none
.is_enabled
returns false for such elements.formPage.html
Add test element with pointer-events: none to formPage
common/src/web/formPage.html
pointer-events: none
for testing.