diff --git a/tests/scenarios/po/selectors_page.py b/tests/scenarios/po/selectors_page.py index 01a9864..27cea6a 100755 --- a/tests/scenarios/po/selectors_page.py +++ b/tests/scenarios/po/selectors_page.py @@ -6,7 +6,7 @@ class Page(RobotPage): selectors = { "search-button": "css=#go", "inputs": "css=input", - "remove-button": "css=button#remove-content", - "para-to-be-removed": "css=p#disappear", + "hide-button": "css=button#hide-content", + "para-to-be-hidden": "css=p#disappear", "delayed-content-button":"css=button#delayed-content" } diff --git a/tests/scenarios/site/index.html b/tests/scenarios/site/index.html index 4b83777..136d16f 100755 --- a/tests/scenarios/site/index.html +++ b/tests/scenarios/site/index.html @@ -26,10 +26,10 @@

Your source for great widgets



-
-

I am another paragraph added to test remove button

+
+

I am another paragraph added to test hide button

- + @@ -63,10 +63,10 @@

Your source for great widgets

}); // clicking on remove me button removes the delayed content - jQuery("#remove-content").click( function(e) { + jQuery("#hide-content").click( function(e) { e.preventDefault(); setTimeout( function() { - jQuery(".ct-to-be-removed").remove(); + jQuery(".ct-to-be-hidden").hide(); }, 5000); }); diff --git a/tests/scenarios/test_wait_until_not_visible.py b/tests/scenarios/test_wait_until_not_visible.py index ee33f34..1fd0f4c 100755 --- a/tests/scenarios/test_wait_until_not_visible.py +++ b/tests/scenarios/test_wait_until_not_visible.py @@ -8,19 +8,19 @@ def setUp(self): self.p.open() def test_wait_until_element_not_visible(self): - self.p.click_element("remove-button") - self.p.wait_until_element_is_not_visible("para-to-be-removed") - self.p.page_should_not_contain_element("para-to-be-removed") + self.p.click_element("hide-button") + self.p.wait_until_element_is_not_visible("para-to-be-hidden") + self.p.element_should_not_be_visible("para-to-be-hidden") def test_wait_for_element_not_visible(self): - self.p.click_element("remove-button") - self.p.wait_for(lambda: not self.p.is_visible("para-to-be-removed")) - self.p.page_should_not_contain_element("para-to-be-removed") + self.p.click_element("hide-button") + self.p.wait_for(lambda: not self.p.is_visible("para-to-be-hidden")) + self.p.element_should_not_be_visible("para-to-be-hidden") def test_wait_until_element_not_visible_throws_exception(self): try: self.p.click_element("delayed-content-button") - self.p.wait_until_element_is_not_visible("para-to-be-removed", 8) + self.p.wait_until_element_is_not_visible("para-to-be-hidden", 8) except Exception, e: self.assertTrue(isinstance(e, AssertionError)) self.assertIn("still matched after", e.message) @@ -28,7 +28,7 @@ def test_wait_until_element_not_visible_throws_exception(self): def test_wait_for_element_not_visible_throws_exception(self): try: self.p.click_element("delayed-content-button") - self.p.wait_for(lambda: not self.p.is_visible("para-to-be-removed"), 8, 'Element did not disappear') + self.p.wait_for(lambda: not self.p.is_visible("para-to-be-hidden"), 8, 'Element did not disappear') except Exception, e: self.assertIn("Element did not disappear", e.msg)