Last active
December 19, 2015 16:29
-
-
Save andreastt/5983873 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<meta charset=utf-8> | |
<title>Parent node visible with absolutely positioned children, where ancestor overflow is hidden</title> | |
<style> | |
body { | |
overflow: hidden; | |
height: 0; | |
width: 0 | |
} | |
.child { position: absolute } | |
</style> | |
<div id=parent> | |
<div class=child>grated</div> | |
<div class=child>cheese</div> |
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
def test_parent_of_absolutely_positioned_elements_visible_where_ancestor_overflow_is_hidden(self): | |
"""When a parent's ancestor hides any overflow, absolutely positioned child elements are | |
still visible. The parent container is also considered visible by webdriver for this | |
reason.""" | |
self.driver.get(self.webserver.where_is("element_state/absolute-children-ancestor-hidden-overflow.html")) | |
ancestor = self.driver.find_element_by_tag_name("body") | |
assert not ancestor.is_displayed() | |
children = self.driver.find_elements_by_class("child") | |
assert all(child.is_displayed() for child in children) | |
parent = self.driver.find_element_by_id("parent") | |
assert parent.is_displayed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment