Bug 1333069 - Skip test_should_report_key_code_of_arrow_keys_up_down_events for test failures for Fennec. r=maja_zf, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Mon, 23 Jan 2017 16:18:33 +0100
changeset 375638 618ab47306e41b496995d087596536309726c68d
parent 375637 aff1199e39e9d3d0670c443c4364a56cfda39b12
child 375639 3a2b54dddbe21c11e174c17ab3dd94096528980d
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1333069
milestone53.0a2
Bug 1333069 - Skip test_should_report_key_code_of_arrow_keys_up_down_events for test failures for Fennec. r=maja_zf, a=test-only Lets skip this test for Fennec. And while doing it we should make use of self.assertIn() when checking if some characters are contained in a string. MozReview-Commit-ID: 5qXENTPFkQH
testing/marionette/harness/marionette_harness/tests/unit/test_text.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_text.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_text.py
@@ -1,16 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.keys import Keys
 
-from marionette_harness import MarionetteTestCase
+from marionette_harness import MarionetteTestCase, skip_if_mobile
 
 
 class TestText(MarionetteTestCase):
     def test_getText(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         l = self.marionette.find_element(By.ID, "mozLink")
         self.assertEqual("Click me!", l.text)
@@ -48,35 +48,35 @@ class TestText(MarionetteTestCase):
 
     def test_should_fire_key_press_events(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("a")
 
         result = self.marionette.find_element(By.ID, "result")
-        self.assertTrue("press:" in result.text)
+        self.assertIn("press:", result.text)
 
     def test_should_fire_key_down_events(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("a")
 
         result = self.marionette.find_element(By.ID, "result")
-        self.assertTrue("down:" in result.text)
+        self.assertIn("down:", result.text)
 
     def test_should_fire_key_up_events(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("a")
 
         result = self.marionette.find_element(By.ID, "result")
-        self.assertTrue("up:" in result.text)
+        self.assertIn("up:", result.text)
 
     def test_should_type_lowercase_characters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         key_reporter = self.marionette.find_element(By.ID, "keyReporter")
         key_reporter.send_keys("abc def")
 
         self.assertEqual("abc def", key_reporter.get_property("value"))
@@ -178,36 +178,37 @@ class TestText(MarionetteTestCase):
         element = self.marionette.find_element(By.ID, "keyPressArea")
         element.send_keys("I like cheese")
 
         result = self.marionette.find_element(By.ID, "result")
         # Because the key down gets the result before the input element is
         # filled, we're a letter short here
         self.assertEqual(result.text, "I like chees")
 
+    @skip_if_mobile("Bug 1333069 - Assertion: 'down: 40' not found in u''")
     def test_should_report_key_code_of_arrow_keys_up_down_events(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         result = self.marionette.find_element(By.ID, "result")
         element = self.marionette.find_element(By.ID, "keyReporter")
         element.send_keys(Keys.ARROW_DOWN)
-        self.assertTrue("down: 40" in result.text.strip())
-        self.assertTrue("up: 40" in result.text.strip())
+        self.assertIn("down: 40", result.text.strip())
+        self.assertIn("up: 40", result.text.strip())
 
         element.send_keys(Keys.ARROW_UP)
-        self.assertTrue("down: 38" in result.text.strip())
-        self.assertTrue("up: 38" in result.text.strip())
+        self.assertIn("down: 38", result.text.strip())
+        self.assertIn("up: 38", result.text.strip())
 
         element.send_keys(Keys.ARROW_LEFT)
-        self.assertTrue("down: 37" in result.text.strip())
-        self.assertTrue("up: 37" in result.text.strip())
+        self.assertIn("down: 37", result.text.strip())
+        self.assertIn("up: 37", result.text.strip())
 
         element.send_keys(Keys.ARROW_RIGHT)
-        self.assertTrue("down: 39" in result.text.strip())
-        self.assertTrue("up: 39" in result.text.strip())
+        self.assertIn("down: 39", result.text.strip())
+        self.assertIn("up: 39", result.text.strip())
 
         #  And leave no rubbish/printable keys in the "keyReporter"
         self.assertEqual("", element.get_property("value"))
 
     def testNumericNonShiftKeys(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element(By.ID, "keyReporter")