Bug 1441437 - [marionette] Remove dependency to cssTransform.html and cssTransform2.html in test_visibility.py. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 10 Jan 2019 14:27:20 +0000
changeset 510386 e15fb11a5c6d64f8b58be4516722fe30e4ca671b
parent 510385 b2c7cc1f129cedf78d77c097358ecd67a888d74c
child 510387 3fc0d08d2c0db25a55e18c590a6b3b25a5f3d15c
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1441437
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
testing/marionette/harness/marionette_harness/www/cssTransform.html
testing/marionette/harness/marionette_harness/www/cssTransform2.html
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_visibility.py
@@ -69,46 +69,51 @@ class TestVisibility(MarionetteTestCase)
     def testHiddenInputElementsAreNeverVisible(self):
         test_html = self.marionette.absolute_url("visibility.html")
         self.marionette.navigate(test_html)
 
         shown = self.marionette.find_element(By.NAME, "hidden")
 
         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("""
+            <div id="y" style="transform: translateY(-200%);">hidden</div>
+            <div id="x" style="transform: translateX(-200%);">hidden</div>
+        """))
 
-        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("""
+            <div style="transform: translateY(-200%);"><p id="y">hidden</p></div>
+            <div style="transform: translateX(-200%);"><p id="x">hidden</p></div>
+        """))
 
-        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())
-
-    def testShouldSayElementWithZeroTransformIsVisible(self):
-        test_html = self.marionette.absolute_url("cssTransform.html")
-        self.marionette.navigate(test_html)
+        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())
 
-        zero_tranform = self.marionette.find_element(By.ID, 'zero-tranform')
-        self.assertTrue(zero_tranform.is_displayed())
+    def test_element_displayed_with_zero_transform(self):
+        self.marionette.navigate(inline("""
+            <div style="transform: translate(0px, 0px);">not hidden</div>
+        """))
+        element = self.marionette.find_element(By.TAG_NAME, 'div')
+        self.assertTrue(element.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("""
+            <div style="margin-top: 1em; transform: translateY(-75%);">not hidden</div>
+            """))
+        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")
         self.marionette.navigate(test_html)
         overflow_x = self.marionette.find_element(By.ID, "assertMe2")
         self.assertFalse(overflow_x.is_displayed())
 
     def testShouldShowElementNotVisibleWithHiddenAttribute(self):
deleted file mode 100644
--- a/testing/marionette/harness/marionette_harness/www/cssTransform.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<style>
-#parentY {
-  transform: translateY(-10000px);
-  -webkit-transform: translateY(-10000px);
-  -o-transform: translateY(-10000px);
-  -ms-transform: translateY(-10000px);
-  -moz-transform: translateY(-10000px);
-}
-#parentX {
-  transform: translateX(-10000px);
-  -webkit-transform: translateX(-10000px);
-  -o-transform: translateX(-10000px);
-  -ms-transform: translateX(-10000px);
-  -moz-transform: translateX(-10000px);
-}
-#transformX {
-  transform: translateX(-10000px);
-  -webkit-transform: translateX(-10000px);
-  -o-transform: translateX(-10000px);
-  -ms-transform: translateX(-10000px);
-  -moz-transform: translateX(-10000px);
-}
-#transformY {
-  transform: translateY(-10000px);
-  -webkit-transform: translateY(-10000px);
-  -o-transform: translateY(-10000px);
-  -ms-transform: translateY(-10000px);
-  -moz-transform: translateY(-10000px);
-}
-
-#zero-transform {
-  transform: translateY(0px);
-  -webkit-transform: translateY(0px);
-  -o-transform: translateY(0px);
-  -ms-transform: translateY(0px);
-  -moz-transform: translateY(0px);
-  transform: translateX(0px);
-  -webkit-transform: translateX(0px);
-  -o-transform: translateX(0px);
-  -ms-transform: translateX(0px);
-  -moz-transform: translateX(0px);
-}
-</style>
-<div id='zero-tranform'>
-You shouldn't see anything other than this sentence on the page
-</div>
-<div id='parentY'>
-  I have a hidden child
-  <div id='childY'>
-    I am a hidden child
-  </div>
-</div>
-<div id='parentX'>
-  I have a hidden child
-  <div id='childX'>
-    I am a hidden child
-  </div>
-</div>
-<div id='transformX'>I am a hidden element </div>
-<div id='transformY'>I am a hidden element </div>
deleted file mode 100644
--- a/testing/marionette/harness/marionette_harness/www/cssTransform2.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<style>
-#negative-percentage-transformY{
-  transform: translateY(-75px);
-  -webkit-transform: translateY(-75%);
-  -o-transform: translateY(-75%);
-  -ms-transform: translateY(-75%);
-  -moz-transform: translateY(-75%);
-}
-.block {
-  display = block;
-}
-</style>
-<div class='block'>
-  <br/>
-</div>
-  <br/>
-<div class='block'>
-</div>
-<div id='negative-percentage-transformY'>I am not a hidden element </div>