You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updatedis_displayed functionality to ensure that form elements with child id's of "tagName" are handled safely. Added a test
Description
Updated Domcore.js to handle FormHTMLElements safely
Added form element with child input id of "tagName" to JavascriptPage.html for testing
Added line in test_should_allow_the_user_to_tell_if_an_element_is_displayed_or_not() in Visibility_Tests.py to ensure this functionality is tested moving forward
-assert driver.find_element(by=By.ID, value="aParentFormId").is_displayed() is True+element = driver.find_element(by=By.ID, value="aParentFormId")+assert element is not None and element.is_displayed() is True
Apply this suggestion
Suggestion importance[1-10]: 9
Why: This suggestion addresses a potential bug by ensuring the element exists before performing operations on it, which can prevent runtime errors.
9
Enhancement
Improve tag name comparison to handle different cases
Replace the strict equality check "FORM" == opt_tagName with opt_tagName.toUpperCase() == "FORM" to handle different cases of opt_tagName and improve the function's flexibility.
Why: This suggestion improves the flexibility of the function by handling different cases of the tag name, which enhances robustness and usability.
8
Simplify the condition by removing the redundant instance check
The condition node instanceof HTMLFormElement is redundant because the subsequent checks already ensure that the node is an element and optionally matches the tag name "FORM". Simplify the condition by removing the instance check.
Why: The suggestion simplifies the code by removing a redundant check, which improves readability and maintainability without altering functionality.
7
Add a submit type to the form's input element for better usability
Add a type="submit" attribute to the input element within the form to clarify its function as a submit button, enhancing form usability and accessibility.
Why: While adding a submit type can improve usability, the current context does not indicate that the input is intended to be a submit button, making this suggestion less relevant.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Updatedis_displayed functionality to ensure that form elements with child id's of "tagName" are handled safely. Added a test
Description
Motivation and Context
Bug #14229
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
isElement
function indomcore.js
to handleHTMLFormElement
safely and prevent failures whentagName
is "tagName".javascriptPage.html
for testing.test_should_allow_the_user_to_tell_if_an_element_is_displayed_or_not
invisibility_tests.py
to include the new form element.Changes walkthrough 📝
domcore.js
Handle HTMLFormElement safely in isElement function
javascript/atoms/domcore.js
HTMLFormElement
safely inisElement
function.
node.tagName.toUpperCase()
does not fail whentagName
is"tagName".
visibility_tests.py
Add test for form element visibility with specific child input id
py/test/selenium/webdriver/common/visibility_tests.py
id of "tagName".
javascriptPage.html
Add form element with specific child input id for testing
common/src/web/javascriptPage.html
purposes.