Skip to content

Commit

Permalink
Bug 14229 fixed (SeleniumHQ#14389)
Browse files Browse the repository at this point in the history
  • Loading branch information
shbenzer authored Aug 14, 2024
1 parent 5e2a630 commit c3dd52e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/src/web/javascriptPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ <h1>Type Stuff</h1>
</div>
</div>

<form id="aParentFormId">
<input type="text" name="tagName">
</form>

</body>
</html>

Expand Down
5 changes: 5 additions & 0 deletions javascript/atoms/domcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ bot.dom.core.isElement = function (node, opt_tagName) {
if (opt_tagName && (typeof opt_tagName !== 'string')) {
opt_tagName = opt_tagName.toString();
}
// because node.tagName.toUpperCase() fails when tagName is "tagName"
if (node instanceof HTMLFormElement) {
return !!node && node.nodeType == goog.dom.NodeType.ELEMENT &&
(!opt_tagName || "FORM" == opt_tagName);
}
return !!node && node.nodeType == goog.dom.NodeType.ELEMENT &&
(!opt_tagName || node.tagName.toUpperCase() == opt_tagName);
};
Expand Down
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/common/visibility_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_should_allow_the_user_to_tell_if_an_element_is_displayed_or_not(driver,
assert driver.find_element(by=By.ID, value="none").is_displayed() is False
assert driver.find_element(by=By.ID, value="suppressedParagraph").is_displayed() is False
assert driver.find_element(by=By.ID, value="hidden").is_displayed() is False
assert driver.find_element(by=By.ID, value="aParentFormId").is_displayed() is True


def test_visibility_should_take_into_account_parent_visibility(driver, pages):
Expand Down

0 comments on commit c3dd52e

Please sign in to comment.