From 941be3d64d5da86be84b1747ee47ca56963db116 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 10 Jan 2019 14:27:20 +0000 Subject: [PATCH] Bug 1441437 - [marionette] Remove dependency to cssTransform.html and cssTransform2.html in test_visibility.py. r=ato Differential Revision: https://phabricator.services.mozilla.com/D16182 --HG-- extra : moz-landing-system : lando --- .../tests/unit/test_visibility.py | 55 +++++++++-------- .../marionette_harness/www/cssTransform.html | 61 ------------------- .../marionette_harness/www/cssTransform2.html | 20 ------ 3 files changed, 30 insertions(+), 106 deletions(-) delete mode 100644 testing/marionette/harness/marionette_harness/www/cssTransform.html delete mode 100644 testing/marionette/harness/marionette_harness/www/cssTransform2.html diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py b/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py index 8fdb0310de8e..a7e13108af29 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py @@ -74,36 +74,41 @@ class TestVisibility(MarionetteTestCase): self.assertFalse(shown.is_displayed()) - def testShouldSayElementsWithNegativeTransformAreNotDisplayed(self): - test_html = self.marionette.absolute_url("cssTransform.html") - self.marionette.navigate(test_html) + def test_elements_not_displayed_with_negative_transform(self): + self.marionette.navigate(inline(""" +
hidden
+
hidden
+ """)) - elementX = self.marionette.find_element(By.ID, 'parentX') - self.assertFalse(elementX.is_displayed()) - elementY = self.marionette.find_element(By.ID, 'parentY') - self.assertFalse(elementY.is_displayed()) + element_x = self.marionette.find_element(By.ID, 'x') + self.assertFalse(element_x.is_displayed()) + element_y = self.marionette.find_element(By.ID, 'y') + self.assertFalse(element_y.is_displayed()) - def testShouldSayElementsWithParentWithNegativeTransformAreNotDisplayed(self): - test_html = self.marionette.absolute_url("cssTransform.html") - self.marionette.navigate(test_html) + def test_elements_not_displayed_with_parents_having_negative_transform(self): + self.marionette.navigate(inline(""" +

hidden

+

hidden

+ """)) - elementX = self.marionette.find_element(By.ID, 'childX') - self.assertFalse(elementX.is_displayed()) - elementY = self.marionette.find_element(By.ID, 'childY') - self.assertFalse(elementY.is_displayed()) + element_x = self.marionette.find_element(By.ID, 'x') + self.assertFalse(element_x.is_displayed()) + element_y = self.marionette.find_element(By.ID, 'y') + self.assertFalse(element_y.is_displayed()) - def testShouldSayElementWithZeroTransformIsVisible(self): - test_html = self.marionette.absolute_url("cssTransform.html") - self.marionette.navigate(test_html) + def test_element_displayed_with_zero_transform(self): + self.marionette.navigate(inline(""" +
not hidden
+ """)) + element = self.marionette.find_element(By.TAG_NAME, 'div') + self.assertTrue(element.is_displayed()) - zero_tranform = self.marionette.find_element(By.ID, 'zero-tranform') - self.assertTrue(zero_tranform.is_displayed()) - - def testShouldSayElementIsVisibleWhenItHasNegativeTransformButElementisntInANegativeSpace(self): - test_html = self.marionette.absolute_url("cssTransform2.html") - self.marionette.navigate(test_html) - negative_percent__tranform = self.marionette.find_element(By.ID, 'negative-percentage-transformY') - self.assertTrue(negative_percent__tranform.is_displayed()) + def test_element_displayed_with_negative_transform_but_in_viewport(self): + self.marionette.navigate(inline(""" +
not hidden
+ """)) + element = self.marionette.find_element(By.TAG_NAME, "div") + self.assertTrue(element.is_displayed()) def testShouldSayElementIsInvisibleWhenOverflowXIsHiddenAndOutOfViewport(self): test_html = self.marionette.absolute_url("bug814037.html") diff --git a/testing/marionette/harness/marionette_harness/www/cssTransform.html b/testing/marionette/harness/marionette_harness/www/cssTransform.html deleted file mode 100644 index c3b99648acac..000000000000 --- a/testing/marionette/harness/marionette_harness/www/cssTransform.html +++ /dev/null @@ -1,61 +0,0 @@ - - -
-You shouldn't see anything other than this sentence on the page -
-
- I have a hidden child -
- I am a hidden child -
-
-
- I have a hidden child -
- I am a hidden child -
-
-
I am a hidden element
-
I am a hidden element
diff --git a/testing/marionette/harness/marionette_harness/www/cssTransform2.html b/testing/marionette/harness/marionette_harness/www/cssTransform2.html deleted file mode 100644 index 602924bfbbab..000000000000 --- a/testing/marionette/harness/marionette_harness/www/cssTransform2.html +++ /dev/null @@ -1,20 +0,0 @@ - - -
-
-
-
-
-
-
I am not a hidden element