Bug 1270040 - Fix host usage in control center for fx ui tests. r=Gijs, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Wed, 04 May 2016 13:50:00 +0200
changeset 332782 0e7f650568bbd910b20bdf7c8c2f1d193475cf2a
parent 332781 11be3fa64aa0ddc1d94407f2075a43943b57a5ab
child 332783 afe313884a55cfa3f3029fc7cee3e0e5d6ff37f6
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1270040
milestone48.0a2
Bug 1270040 - Fix host usage in control center for fx ui tests. r=Gijs, a=test-only 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