Bug 1275249 - Update UI tests to get property where applicable; r?whimboo
In
bug 1272653, Get Element Attribute was split into Get Element Attribute
for attributes and boolean attributes, and Get Element Property for
properties.
This patch addresses the fallout in the Firefox UI tests caused by
those patches.
MozReview-Commit-ID: 9S4epjmpU0o
--- a/testing/firefox-ui/tests/functional/security/test_enable_privilege.py
+++ b/testing/firefox-ui/tests/functional/security/test_enable_privilege.py
@@ -14,9 +14,9 @@ class TestEnablePrivilege(FirefoxTestCas
self.url = self.marionette.absolute_url('security/enable_privilege.html')
def test_enable_privilege(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
result = self.marionette.find_element(By.ID, 'result')
- self.assertEqual(result.get_attribute('textContent'), 'PASS')
+ self.assertEqual(result.get_property('textContent'), 'PASS')
--- a/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
@@ -31,19 +31,19 @@ class TestSSLDisabledErrorPage(FirefoxTe
self.assertRaises(MarionetteException, self.marionette.navigate, self.url)
# Wait for the DOM to receive events
time.sleep(1)
# Verify "Secure Connection Failed" error page title
title = self.marionette.find_element(By.CLASS_NAME, 'title-text')
nss_failure2title = self.browser.get_entity('nssFailure2.title')
- self.assertEquals(title.get_attribute('textContent'), nss_failure2title)
+ self.assertEquals(title.get_property('textContent'), nss_failure2title)
# Verify "Try Again" button appears
try_again_button = self.marionette.find_element(By.ID, 'errorTryAgain')
self.assertTrue(try_again_button.is_displayed())
# Verify the error message is correct
short_description = self.marionette.find_element(By.ID, 'errorShortDescText')
self.assertIn('SSL_ERROR_UNSUPPORTED_VERSION',
- short_description.get_attribute('textContent'))
- self.assertIn('mozqa.com', short_description.get_attribute('textContent'))
+ short_description.get_property('textContent'))
+ self.assertIn('mozqa.com', short_description.get_property('textContent'))
--- a/testing/firefox-ui/tests/functional/security/test_submit_unencrypted_info_warning.py
+++ b/testing/firefox-ui/tests/functional/security/test_submit_unencrypted_info_warning.py
@@ -52,9 +52,9 @@ class TestSubmitUnencryptedInfoWarning(F
# TODO: Bug 1140470: use replacement for mozmill's waitforPageLoad
Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
' document.readyState == "complete";')
)
# Check that search_term contains the test string.
search_term = self.marionette.find_element(By.ID, 'search-term')
- self.assertEqual(search_term.get_attribute('textContent'), self.test_string)
+ self.assertEqual(search_term.get_property('textContent'), self.test_string)
--- a/testing/firefox-ui/tests/functional/security/test_unknown_issuer.py
+++ b/testing/firefox-ui/tests/functional/security/test_unknown_issuer.py
@@ -22,14 +22,14 @@ class TestUnknownIssuer(FirefoxTestCase)
# Go to a site that has a cert with an unknown issuer
self.assertRaises(MarionetteException, self.marionette.navigate, self.url)
# Wait for the DOM to receive events
time.sleep(1)
# Check for the correct error code
error = self.marionette.find_element(By.ID, 'errorCode')
- self.assertEquals(error.get_attribute('textContent'),
+ self.assertEquals(error.get_property('textContent'),
'SEC_ERROR_UNKNOWN_ISSUER')
# Verify the "Go Back" and "Advanced" buttons appear
self.assertIsNotNone(self.marionette.find_element(By.ID, 'returnButton'))
self.assertIsNotNone(self.marionette.find_element(By.ID, 'advancedButton'))