Bug 1270040 - Fix host usage in control center for fx ui tests. r=Gijs
authorHenrik Skupin <mail@hskupin.info>
Wed, 04 May 2016 13:50:00 +0200
changeset 296355 8ba069d19cf1b4066d747ec7b5f3d211bcba6157
parent 296354 974d89198e8c25530804ae733ca452faf480e4ff
child 296356 ecda4cb9380646791abe09dc88f3f44c554a3547
push id76307
push userhskupin@mozilla.com
push dateFri, 06 May 2016 10:03:19 +0000
treeherdermozilla-inbound@8ba069d19cf1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1270040
milestone49.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 1270040 - Fix host usage in control center for fx ui tests. r=Gijs MozReview-Commit-ID: 65RpUfoJEiW
testing/firefox-ui/tests/functional/security/test_dv_certificate.py
testing/firefox-ui/tests/functional/security/test_ev_certificate.py
testing/firefox-ui/tests/puppeteer/test_toolbars.py
testing/puppeteer/firefox/firefox_puppeteer/ui/browser/toolbars.py
--- a/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
@@ -40,17 +40,18 @@ class TestDVCertificate(FirefoxTestCase)
         self.locationbar.open_identity_popup()
 
         # Check the identity popup doorhanger
         self.assertEqual(self.identity_popup.element.get_attribute('connection'), 'secure')
 
         cert = self.browser.tabbar.selected_tab.certificate
 
         # The shown host equals to the certificate
-        self.assertEqual(self.identity_popup.host.get_attribute('value'), cert['commonName'])
+        self.assertEqual(self.identity_popup.view.main.host.get_attribute('textContent'),
+                         cert['commonName'])
 
         # Only the secure label is visible in the main view
         secure_label = self.identity_popup.view.main.secure_connection_label
         self.assertNotEqual(secure_label.value_of_css_property('display'), 'none')
 
         insecure_label = self.identity_popup.view.main.insecure_connection_label
         self.assertEqual(insecure_label.value_of_css_property('display'), 'none')
 
--- a/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
@@ -49,17 +49,17 @@ class TestEVCertificate(FirefoxTestCase)
 
         # Open the identity popup
         self.locationbar.open_identity_popup()
 
         # Check the idenity popup doorhanger
         self.assertEqual(self.identity_popup.element.get_attribute('connection'), 'secure-ev')
 
         # For EV certificates no hostname but the organization name is shown
-        self.assertEqual(self.identity_popup.host.get_attribute('value'),
+        self.assertEqual(self.identity_popup.view.main.host.get_attribute('textContent'),
                          cert['organization'])
 
         # Only the secure label is visible in the main view
         secure_label = self.identity_popup.view.main.secure_connection_label
         self.assertNotEqual(secure_label.value_of_css_property('display'), 'none')
 
         insecure_label = self.identity_popup.view.main.insecure_connection_label
         self.assertEqual(insecure_label.value_of_css_property('display'), 'none')
--- a/testing/firefox-ui/tests/puppeteer/test_toolbars.py
+++ b/testing/firefox-ui/tests/puppeteer/test_toolbars.py
@@ -215,36 +215,36 @@ class TestIdentityPopup(FirefoxTestCase)
         try:
             self.identity_popup.close(force=True)
         finally:
             FirefoxTestCase.tearDown(self)
 
     def test_elements(self):
         self.locationbar.open_identity_popup()
 
-        self.assertEqual(self.identity_popup.host.get_attribute('localName'), 'broadcaster')
-
         # Test main view elements
         main = self.identity_popup.view.main
         self.assertEqual(main.element.get_attribute('localName'), 'panelview')
 
         self.assertEqual(main.expander.get_attribute('localName'), 'button')
+        self.assertEqual(main.host.get_attribute('localName'), 'label')
         self.assertEqual(main.insecure_connection_label.get_attribute('localName'),
                          'description')
         self.assertEqual(main.internal_connection_label.get_attribute('localName'),
                          'description')
         self.assertEqual(main.secure_connection_label.get_attribute('localName'),
                          'description')
 
         self.assertEqual(main.permissions.get_attribute('localName'), 'vbox')
 
         # Test security view elements
         security = self.identity_popup.view.security
         self.assertEqual(security.element.get_attribute('localName'), 'panelview')
 
+        self.assertEqual(security.host.get_attribute('localName'), 'label')
         self.assertEqual(security.insecure_connection_label.get_attribute('localName'),
                          'description')
         self.assertEqual(security.secure_connection_label.get_attribute('localName'),
                          'description')
 
         self.assertEqual(security.owner.get_attribute('localName'), 'description')
         self.assertEqual(security.owner_location.get_attribute('localName'), 'description')
         self.assertEqual(security.verifier.get_attribute('localName'), 'description')
--- a/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/toolbars.py
+++ b/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/toolbars.py
@@ -419,24 +419,16 @@ class IdentityPopup(UIBaseLib):
     """Wraps DOM elements and methods for interacting with the identity popup."""
 
     def __init__(self, *args, **kwargs):
         UIBaseLib.__init__(self, *args, **kwargs)
 
         self._view = None
 
     @property
-    def host(self):
-        """The DOM element which represents the identity-popup content host.
-
-        :returns: Reference to the identity-popup content host.
-        """
-        return self.marionette.find_element(By.ID, 'identity-popup-content-host')
-
-    @property
     def is_open(self):
         """Returns whether this popup is currently open.
 
         :returns: True when the popup is open, otherwise false.
         """
         return self.element.get_attribute('state') == 'open'
 
     def close(self, force=False):
@@ -533,16 +525,24 @@ class IdentityPopupMainView(IdentityPopu
     def expander(self):
         """The DOM element which represents the expander button for the security content.
 
         :returns: Reference to the identity popup expander button.
         """
         return self.element.find_element(By.CLASS_NAME, 'identity-popup-expander')
 
     @property
+    def host(self):
+        """The DOM element which represents the identity-popup content host.
+
+        :returns: Reference to the identity-popup content host.
+        """
+        return self.element.find_element(By.CLASS_NAME, 'identity-popup-headline host')
+
+    @property
     def insecure_connection_label(self):
         """The DOM element which represents the identity popup insecure connection label.
 
         :returns: Reference to the identity-popup insecure connection label.
         """
         return self.element.find_element(By.CLASS_NAME, 'identity-popup-connection-not-secure')
 
     @property
@@ -586,16 +586,24 @@ class IdentityPopupSecurityView(Identity
         """The DOM element which represents the enable mixed content blocking button.
 
         :returns: Reference to the enable mixed content blocking button.
         """
         return self.element.find_element(By.CSS_SELECTOR,
                                          'button[when-mixedcontent=active-loaded]')
 
     @property
+    def host(self):
+        """The DOM element which represents the identity-popup content host.
+
+        :returns: Reference to the identity-popup content host.
+        """
+        return self.element.find_element(By.CLASS_NAME, 'identity-popup-headline host')
+
+    @property
     def insecure_connection_label(self):
         """The DOM element which represents the identity popup insecure connection label.
 
         :returns: Reference to the identity-popup insecure connection label.
         """
         return self.element.find_element(By.CLASS_NAME, 'identity-popup-connection-not-secure')
 
     @property