Skip to content

Commit

Permalink
Adding visibility tests to show elements with HIDDEN attribute are no…
Browse files Browse the repository at this point in the history
…t visble
  • Loading branch information
AutomatedTester committed Aug 27, 2013
1 parent fc7e746 commit d895e16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webdriver/element_state/hidden.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<div id='singleHidden' hidden>This will not be visible</div>
<div id='parent' hidden>
<div id='child'>My parent is hidden so you can't see me</div>
</div>
10 changes: 10 additions & 0 deletions webdriver/element_state/visibility_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ def test_visibility_hidden_on_parent_takes_presedence_over_display_block(self):
def test_visibility_hidden_set_dynamically(self):
pass

def test_should_show_element_not_visible_with_hidden_attribute(self):
self.driver.get(self.webserver.where_is("element_state/hidden.html"))
singleHidden = self.driver.find_element('id', 'singleHidden')
self.assertFalse(singleHidden.is_displayed())

def test_should_show_element_not_visible_when_parent_element_has_hidden_attribute(self):
self.driver.get(self.webserver.where_is("element_state/hidden.html"))
child = self.driver.find_element('id', 'child')
self.assertFalse(child.is_displayed())


class VisibilityInteractionTest(base_test.WebDriverBaseTest):
def test_input_hidden_is_unclickable(self):
Expand Down

0 comments on commit d895e16

Please sign in to comment.