--- a/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
@@ -24,60 +24,62 @@ class TestDVCertificate(PuppeteerMixin,
self.puppeteer.windows.close_all([self.browser])
finally:
super(TestDVCertificate, self).tearDown()
def test_dv_cert(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
- self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
+ self.assertEqual(self.locationbar.identity_box.get_property('className'),
'verifiedDomain')
# Open the identity popup
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.view.main.host.get_attribute('textContent'),
+ self.assertEqual(self.identity_popup.view.main.host.get_property('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')
self.identity_popup.view.main.expander.click()
- Wait(self.marionette).until(lambda _: self.identity_popup.view.security.selected)
+ Wait(self.marionette).until(
+ lambda _: self.identity_popup.view.security.selected,
+ message='Security view of identity popup has not been selected.')
# Only the secure label is visible in the security view
secure_label = self.identity_popup.view.security.secure_connection_label
self.assertNotEqual(secure_label.value_of_css_property('display'), 'none')
insecure_label = self.identity_popup.view.security.insecure_connection_label
self.assertEqual(insecure_label.value_of_css_property('display'), 'none')
verifier_label = self.browser.localize_property('identity.identified.verifier')
- self.assertEqual(self.identity_popup.view.security.verifier.get_attribute('textContent'),
+ self.assertEqual(self.identity_popup.view.security.verifier.get_property('textContent'),
verifier_label.replace("%S", cert['issuerOrganization']))
def opener(mn):
self.identity_popup.view.security.more_info_button.click()
page_info_window = self.browser.open_page_info_window(opener)
deck = page_info_window.deck
self.assertEqual(deck.selected_panel, deck.security)
- self.assertEqual(deck.security.domain.get_attribute('value'),
+ self.assertEqual(deck.security.domain.get_property('value'),
cert['commonName'])
- self.assertEqual(deck.security.owner.get_attribute('value'),
+ self.assertEqual(deck.security.owner.get_property('value'),
page_info_window.localize_property('securityNoOwner'))
- self.assertEqual(deck.security.verifier.get_attribute('value'),
+ self.assertEqual(deck.security.verifier.get_property('value'),
cert['issuerOrganization'])
--- a/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
@@ -25,37 +25,37 @@ class TestEVCertificate(PuppeteerMixin,
finally:
super(TestEVCertificate, self).tearDown()
def test_ev_certificate(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
# Check the identity box
- self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
+ self.assertEqual(self.locationbar.identity_box.get_property('className'),
'verifiedIdentity')
# Get the information from the certificate
cert = self.browser.tabbar.selected_tab.certificate
address = self.puppeteer.security.get_address_from_certificate(cert)
# Check the identity popup label displays
- self.assertEqual(self.locationbar.identity_organization_label.get_attribute('value'),
+ self.assertEqual(self.locationbar.identity_organization_label.get_property('value'),
cert['organization'])
- self.assertEqual(self.locationbar.identity_country_label.get_attribute('value'),
+ self.assertEqual(self.locationbar.identity_country_label.get_property('value'),
'(' + address['country'] + ')')
# 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.view.main.host.get_attribute('textContent'),
+ self.assertEqual(self.identity_popup.view.main.host.get_property('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')
@@ -68,48 +68,45 @@ class TestEVCertificate(PuppeteerMixin,
# Only the secure label is visible in the security view
secure_label = security_view.secure_connection_label
self.assertNotEqual(secure_label.value_of_css_property('display'), 'none')
insecure_label = security_view.insecure_connection_label
self.assertEqual(insecure_label.value_of_css_property('display'), 'none')
# Check the organization name
- self.assertEqual(security_view.owner.get_attribute('textContent'),
- cert['organization'])
+ self.assertEqual(security_view.owner.get_property('textContent'), cert['organization'])
# Check the owner location string
# More information:
# hg.mozilla.org/mozilla-central/file/eab4a81e4457/browser/base/content/browser.js#l7012
location = self.browser.localize_property('identity.identified.state_and_country')
location = location.replace('%S', address['state'], 1).replace('%S', address['country'])
location = address['city'] + '\n' + location
- self.assertEqual(security_view.owner_location.get_attribute('textContent'),
- location)
+ self.assertEqual(security_view.owner_location.get_property('textContent'), location)
# Check the verifier
l10n_verifier = self.browser.localize_property('identity.identified.verifier')
l10n_verifier = l10n_verifier.replace('%S', cert['issuerOrganization'])
- self.assertEqual(security_view.verifier.get_attribute('textContent'),
- l10n_verifier)
+ self.assertEqual(security_view.verifier.get_property('textContent'), l10n_verifier)
# Open the Page Info window by clicking the More Information button
page_info = self.browser.open_page_info_window(
lambda _: self.identity_popup.view.security.more_info_button.click())
try:
# Verify that the current panel is the security panel
self.assertEqual(page_info.deck.selected_panel, page_info.deck.security)
# Verify the domain listed on the security panel
self.assertIn(cert['commonName'],
- page_info.deck.security.domain.get_attribute('value'))
+ page_info.deck.security.domain.get_property('value'))
# Verify the owner listed on the security panel
- self.assertEqual(page_info.deck.security.owner.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.owner.get_property('value'),
cert['organization'])
# Verify the verifier listed on the security panel
- self.assertEqual(page_info.deck.security.verifier.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.verifier.get_property('value'),
cert['issuerOrganization'])
finally:
page_info.close()
self.browser.focus()
--- a/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
@@ -20,17 +20,17 @@ class TestMixedContentPage(PuppeteerMixi
self.identity_popup.close(force=True)
finally:
super(TestMixedContentPage, self).tearDown()
def test_mixed_content(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
- self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
+ self.assertEqual(self.locationbar.identity_box.get_property('className'),
'unknownIdentity mixedDisplayContent')
# Open the identity popup
self.locationbar.open_identity_popup()
# Only the insecure label is visible in the main view
secure_label = self.identity_popup.view.main.secure_connection_label
self.assertEqual(secure_label.value_of_css_property('display'), 'none')
--- a/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
@@ -41,17 +41,17 @@ class TestMixedScriptContentBlocking(Pup
color, identity, state = (
'rgb(255, 0, 0)',
'unknownIdentity mixedActiveContent',
'unblocked'
)
# First call to Wait() needs a longer timeout due to the reload of the web page.
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
- lambda _: self.locationbar.identity_box.get_attribute('className') == identity,
+ lambda _: self.locationbar.identity_box.get_property('className') == identity,
message='Expected identity "{}" not found'.format(identity)
)
with self.marionette.using_context('content'):
for identifier, description in self.test_elements:
el = self.marionette.find_element(By.ID, identifier)
Wait(self.marionette).until(
lambda mn: el.value_of_css_property('color') == color,
--- a/testing/firefox-ui/tests/functional/security/test_no_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_no_certificate.py
@@ -34,17 +34,17 @@ class TestNoCertificate(PuppeteerMixin,
# Check the favicon
# TODO: find a better way to check, e.g., mozmill's isDisplayed
favicon_hidden = self.marionette.execute_script("""
return arguments[0].hasAttribute("hidden");
""", script_args=[self.browser.navbar.locationbar.identity_icon])
self.assertFalse(favicon_hidden, 'The identity icon is visible')
# Check that the identity box organization label is blank
- self.assertEqual(self.locationbar.identity_organization_label.get_attribute('value'), '',
+ self.assertEqual(self.locationbar.identity_organization_label.get_property('value'), '',
'The organization has no label')
# Open the identity popup
self.locationbar.open_identity_popup()
# Check the idenity popup doorhanger
self.assertEqual(self.identity_popup.element.get_attribute('connection'), 'not-secure')
@@ -65,17 +65,17 @@ class TestNoCertificate(PuppeteerMixin,
page_info = self.browser.open_page_info_window(
lambda _: self.identity_popup.view.security.more_info_button.click())
# Verify that the current panel is the security panel
self.assertEqual(page_info.deck.selected_panel, page_info.deck.security)
# Check the domain listed on the security panel contains the url's host name
self.assertIn(urlparse(self.url).hostname,
- page_info.deck.security.domain.get_attribute('value'))
+ page_info.deck.security.domain.get_property('value'))
# Check the owner label equals localized 'securityNoOwner'
- self.assertEqual(page_info.deck.security.owner.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.owner.get_property('value'),
page_info.localize_property('securityNoOwner'))
# Check the verifier label equals localized 'notset'
- self.assertEqual(page_info.deck.security.verifier.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.verifier.get_property('value'),
page_info.localize_property('notset'))
--- a/testing/firefox-ui/tests/functional/security/test_security_notification.py
+++ b/testing/firefox-ui/tests/functional/security/test_security_notification.py
@@ -45,18 +45,18 @@ class TestSecurityNotification(Puppeteer
# Verify the error code is correct
self.assertIn('SEC_ERROR_EXPIRED_CERTIFICATE', text.get_property('textContent'))
def test_secure_website(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.urls[1])
Wait(self.marionette).until(lambda _: (
- self.identity_box.get_attribute('className') == 'verifiedIdentity')
+ self.identity_box.get_property('className') == 'verifiedIdentity')
)
def test_insecure_website(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.urls[2])
Wait(self.marionette).until(lambda _: (
- self.identity_box.get_attribute('className') == 'unknownIdentity')
+ self.identity_box.get_property('className') == 'unknownIdentity')
)
--- a/testing/firefox-ui/tests/functional/security/test_ssl_status_after_restart.py
+++ b/testing/firefox-ui/tests/functional/security/test_ssl_status_after_restart.py
@@ -71,54 +71,54 @@ class TestSSLStatusAfterRestart(Puppetee
# TODO: find a better way to check, e.g., mozmill's isDisplayed
favicon_hidden = self.marionette.execute_script("""
return arguments[0].hasAttribute("hidden");
""", script_args=[self.browser.navbar.locationbar.identity_icon])
self.assertFalse(favicon_hidden)
self.locationbar.open_identity_popup()
- # Check the type shown on the idenity popup doorhanger
+ # Check the type shown on the identity popup doorhanger
self.assertEqual(self.identity_popup.element.get_attribute('connection'),
cert_type)
self.identity_popup.view.main.expander.click()
Wait(self.marionette).until(lambda _: self.identity_popup.view.security.selected)
# Check the identity label
- self.assertEqual(self.locationbar.identity_organization_label.get_attribute('value'),
+ self.assertEqual(self.locationbar.identity_organization_label.get_property('value'),
identity)
# Get the information from the certificate
cert = self.browser.tabbar.selected_tab.certificate
# Open the Page Info window by clicking the More Information button
page_info = self.browser.open_page_info_window(
lambda _: self.identity_popup.view.security.more_info_button.click())
# Verify that the current panel is the security panel
self.assertEqual(page_info.deck.selected_panel, page_info.deck.security)
# Verify the domain listed on the security panel
# If this is a wildcard cert, check only the domain
if cert['commonName'].startswith('*'):
self.assertIn(self.puppeteer.security.get_domain_from_common_name(cert['commonName']),
- page_info.deck.security.domain.get_attribute('value'),
+ page_info.deck.security.domain.get_property('value'),
'Expected domain found in certificate for ' + url)
else:
- self.assertEqual(page_info.deck.security.domain.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.domain.get_property('value'),
cert['commonName'],
'Domain value matches certificate common name.')
# Verify the owner listed on the security panel
if identity != '':
owner = cert['organization']
else:
owner = page_info.localize_property('securityNoOwner')
- self.assertEqual(page_info.deck.security.owner.get_attribute('value'), owner,
+ self.assertEqual(page_info.deck.security.owner.get_property('value'), owner,
'Expected owner label found for ' + url)
# Verify the verifier listed on the security panel
- self.assertEqual(page_info.deck.security.verifier.get_attribute('value'),
+ self.assertEqual(page_info.deck.security.verifier.get_property('value'),
cert['issuerOrganization'],
'Verifier matches issuer of certificate for ' + url)
page_info.close()
--- a/testing/firefox-ui/tests/puppeteer/test_about_window.py
+++ b/testing/firefox-ui/tests/puppeteer/test_about_window.py
@@ -22,41 +22,41 @@ class TestAboutWindow(PuppeteerMixin, Ma
def test_basic(self):
self.assertEqual(self.about_window.window_type, 'Browser:About')
def test_elements(self):
"""Test correct retrieval of elements."""
self.assertNotEqual(self.about_window.dtds, [])
- self.assertEqual(self.deck.element.get_attribute('localName'), 'deck')
+ self.assertEqual(self.deck.element.get_property('localName'), 'deck')
# apply panel
panel = self.deck.apply
- self.assertEqual(panel.element.get_attribute('localName'), 'hbox')
- self.assertEqual(panel.button.get_attribute('localName'), 'button')
+ self.assertEqual(panel.element.get_property('localName'), 'hbox')
+ self.assertEqual(panel.button.get_property('localName'), 'button')
# check_for_updates panel
panel = self.deck.check_for_updates
- self.assertEqual(panel.element.get_attribute('localName'), 'hbox')
- self.assertEqual(panel.button.get_attribute('localName'), 'button')
+ self.assertEqual(panel.element.get_property('localName'), 'hbox')
+ self.assertEqual(panel.button.get_property('localName'), 'button')
# checking_for_updates panel
- self.assertEqual(self.deck.checking_for_updates.element.get_attribute('localName'), 'hbox')
+ self.assertEqual(self.deck.checking_for_updates.element.get_property('localName'), 'hbox')
# download_and_install panel
panel = self.deck.download_and_install
- self.assertEqual(panel.element.get_attribute('localName'), 'hbox')
- self.assertEqual(panel.button.get_attribute('localName'), 'button')
+ self.assertEqual(panel.element.get_property('localName'), 'hbox')
+ self.assertEqual(panel.button.get_property('localName'), 'button')
# download_failed panel
- self.assertEqual(self.deck.download_failed.element.get_attribute('localName'), 'hbox')
+ self.assertEqual(self.deck.download_failed.element.get_property('localName'), 'hbox')
# downloading panel
- self.assertEqual(self.deck.downloading.element.get_attribute('localName'), 'hbox')
+ self.assertEqual(self.deck.downloading.element.get_property('localName'), 'hbox')
def test_open_window(self):
"""Test various opening strategies."""
def opener(win):
self.browser.menubar.select_by_id('helpMenu', 'aboutName')
open_strategies = ('menu',
opener,
--- a/testing/firefox-ui/tests/puppeteer/test_page_info_window.py
+++ b/testing/firefox-ui/tests/puppeteer/test_page_info_window.py
@@ -16,42 +16,42 @@ class TestPageInfoWindow(PuppeteerMixin,
def test_elements(self):
"""Test correct retrieval of elements."""
page_info = self.browser.open_page_info_window()
self.assertNotEqual(page_info.dtds, [])
self.assertNotEqual(page_info.properties, [])
- self.assertEqual(page_info.deck.element.get_attribute('localName'), 'deck')
+ self.assertEqual(page_info.deck.element.get_property('localName'), 'deck')
# feed panel
- self.assertEqual(page_info.deck.feed.element.get_attribute('localName'), 'vbox')
+ self.assertEqual(page_info.deck.feed.element.get_property('localName'), 'vbox')
# general panel
- self.assertEqual(page_info.deck.general.element.get_attribute('localName'), 'vbox')
+ self.assertEqual(page_info.deck.general.element.get_property('localName'), 'vbox')
# media panel
- self.assertEqual(page_info.deck.media.element.get_attribute('localName'), 'vbox')
+ self.assertEqual(page_info.deck.media.element.get_property('localName'), 'vbox')
# permissions panel
- self.assertEqual(page_info.deck.permissions.element.get_attribute('localName'), 'vbox')
+ self.assertEqual(page_info.deck.permissions.element.get_property('localName'), 'vbox')
# security panel
panel = page_info.deck.select(page_info.deck.security)
- self.assertEqual(panel.element.get_attribute('localName'), 'vbox')
+ self.assertEqual(panel.element.get_property('localName'), 'vbox')
- self.assertEqual(panel.domain.get_attribute('localName'), 'textbox')
- self.assertEqual(panel.owner.get_attribute('localName'), 'textbox')
- self.assertEqual(panel.verifier.get_attribute('localName'), 'textbox')
+ self.assertEqual(panel.domain.get_property('localName'), 'textbox')
+ self.assertEqual(panel.owner.get_property('localName'), 'textbox')
+ self.assertEqual(panel.verifier.get_property('localName'), 'textbox')
- self.assertEqual(panel.view_certificate.get_attribute('localName'), 'button')
- self.assertEqual(panel.view_cookies.get_attribute('localName'), 'button')
- self.assertEqual(panel.view_passwords.get_attribute('localName'), 'button')
+ self.assertEqual(panel.view_certificate.get_property('localName'), 'button')
+ self.assertEqual(panel.view_cookies.get_property('localName'), 'button')
+ self.assertEqual(panel.view_passwords.get_property('localName'), 'button')
def test_select(self):
"""Test properties and methods for switching between panels."""
page_info = self.browser.open_page_info_window()
deck = page_info.deck
self.assertEqual(deck.selected_panel, deck.general)
--- a/testing/firefox-ui/tests/puppeteer/test_tabbar.py
+++ b/testing/firefox-ui/tests/puppeteer/test_tabbar.py
@@ -18,18 +18,18 @@ class TestTabBar(PuppeteerMixin, Marione
def test_basics(self):
tabbar = self.browser.tabbar
self.assertEqual(tabbar.window, self.browser)
self.assertEqual(len(tabbar.tabs), 1)
self.assertEqual(tabbar.tabs[0].handle, self.marionette.current_window_handle)
- self.assertEqual(tabbar.newtab_button.get_attribute('localName'), 'toolbarbutton')
- self.assertEqual(tabbar.toolbar.get_attribute('localName'), 'tabs')
+ self.assertEqual(tabbar.newtab_button.get_property('localName'), 'toolbarbutton')
+ self.assertEqual(tabbar.toolbar.get_property('localName'), 'tabs')
def test_open_close(self):
tabbar = self.browser.tabbar
self.assertEqual(len(tabbar.tabs), 1)
self.assertEqual(tabbar.selected_index, 0)
# Open with default trigger, and force closing the tab
@@ -122,18 +122,18 @@ class TestTab(PuppeteerMixin, Marionette
finally:
super(TestTab, self).tearDown()
def test_basic(self):
tab = self.browser.tabbar.tabs[0]
self.assertEqual(tab.window, self.browser)
- self.assertEqual(tab.tab_element.get_attribute('localName'), 'tab')
- self.assertEqual(tab.close_button.get_attribute('localName'), 'toolbarbutton')
+ self.assertEqual(tab.tab_element.get_property('localName'), 'tab')
+ self.assertEqual(tab.close_button.get_property('localName'), 'toolbarbutton')
def test_certificate(self):
url = self.marionette.absolute_url('layout/mozilla.html')
with self.marionette.using_context(self.marionette.CONTEXT_CONTENT):
self.marionette.navigate(url)
with self.assertRaises(NoCertificateError):
self.browser.tabbar.tabs[0].certificate
--- a/testing/firefox-ui/tests/puppeteer/test_toolbars.py
+++ b/testing/firefox-ui/tests/puppeteer/test_toolbars.py
@@ -21,21 +21,21 @@ class TestNavBar(PuppeteerMixin, Marione
# TODO: check why self.puppeteer.places.remove_all_history() does not work here
self.marionette.execute_script("""
let count = gBrowser.sessionHistory.count;
gBrowser.sessionHistory.PurgeHistory(count);
""")
def test_elements(self):
- self.assertEqual(self.navbar.back_button.get_attribute('localName'), 'toolbarbutton')
- self.assertEqual(self.navbar.forward_button.get_attribute('localName'), 'toolbarbutton')
- self.assertEqual(self.navbar.home_button.get_attribute('localName'), 'toolbarbutton')
- self.assertEqual(self.navbar.menu_button.get_attribute('localName'), 'toolbarbutton')
- self.assertEqual(self.navbar.toolbar.get_attribute('localName'), 'toolbar')
+ self.assertEqual(self.navbar.back_button.get_property('localName'), 'toolbarbutton')
+ self.assertEqual(self.navbar.forward_button.get_property('localName'), 'toolbarbutton')
+ self.assertEqual(self.navbar.home_button.get_property('localName'), 'toolbarbutton')
+ self.assertEqual(self.navbar.menu_button.get_property('localName'), 'toolbarbutton')
+ self.assertEqual(self.navbar.toolbar.get_property('localName'), 'toolbar')
def test_buttons(self):
self.marionette.set_context('content')
# Load initial web page
self.marionette.navigate(self.url)
Wait(self.marionette).until(expected.element_present(lambda m:
m.find_element(By.ID, 'mozilla_logo')))
@@ -80,34 +80,34 @@ class TestNavBar(PuppeteerMixin, Marione
class TestLocationBar(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestLocationBar, self).setUp()
self.locationbar = self.browser.navbar.locationbar
def test_elements(self):
- self.assertEqual(self.locationbar.urlbar.get_attribute('localName'), 'textbox')
- self.assertIn('urlbar-input', self.locationbar.urlbar_input.get_attribute('className'))
+ self.assertEqual(self.locationbar.urlbar.get_property('localName'), 'textbox')
+ self.assertIn('urlbar-input', self.locationbar.urlbar_input.get_property('className'))
- self.assertEqual(self.locationbar.connection_icon.get_attribute('localName'), 'image')
- self.assertEqual(self.locationbar.identity_box.get_attribute('localName'), 'box')
- self.assertEqual(self.locationbar.identity_country_label.get_attribute('localName'),
+ self.assertEqual(self.locationbar.connection_icon.get_property('localName'), 'image')
+ self.assertEqual(self.locationbar.identity_box.get_property('localName'), 'box')
+ self.assertEqual(self.locationbar.identity_country_label.get_property('localName'),
'label')
- self.assertEqual(self.locationbar.identity_organization_label.get_attribute('localName'),
+ self.assertEqual(self.locationbar.identity_organization_label.get_property('localName'),
'label')
- self.assertEqual(self.locationbar.identity_icon.get_attribute('localName'), 'image')
- self.assertEqual(self.locationbar.history_drop_marker.get_attribute('localName'),
+ self.assertEqual(self.locationbar.identity_icon.get_property('localName'), 'image')
+ self.assertEqual(self.locationbar.history_drop_marker.get_property('localName'),
'dropmarker')
- self.assertEqual(self.locationbar.reload_button.get_attribute('localName'),
+ self.assertEqual(self.locationbar.reload_button.get_property('localName'),
'toolbarbutton')
- self.assertEqual(self.locationbar.stop_button.get_attribute('localName'),
+ self.assertEqual(self.locationbar.stop_button.get_property('localName'),
'toolbarbutton')
- self.assertEqual(self.locationbar.contextmenu.get_attribute('localName'), 'menupopup')
+ self.assertEqual(self.locationbar.contextmenu.get_property('localName'), 'menupopup')
self.assertEqual(self.locationbar.get_contextmenu_entry('paste').get_attribute('cmd'),
'cmd_paste')
def test_reload(self):
event_types = ["shortcut", "shortcut2", "button"]
for event in event_types:
# TODO: Until we have waitForPageLoad, this only tests API
# compatibility.
@@ -157,17 +157,17 @@ class TestAutoCompleteResults(PuppeteerM
# in the default profile.
self.assertFalse(self.autocomplete_results.is_open)
self.browser.navbar.locationbar.urlbar.send_keys('a')
results = self.autocomplete_results.results
Wait(self.marionette).until(lambda _: self.autocomplete_results.is_complete)
visible_result_count = len(self.autocomplete_results.visible_results)
self.assertTrue(visible_result_count > 0)
self.assertEqual(visible_result_count,
- int(results.get_attribute('itemCount')))
+ int(results.get_property('itemCount')))
def test_close(self):
self.browser.navbar.locationbar.urlbar.send_keys('a')
Wait(self.marionette).until(lambda _: self.autocomplete_results.is_open)
# The Wait in the library implementation will fail this if this doesn't
# end up closing.
self.autocomplete_results.close()
@@ -221,49 +221,49 @@ class TestIdentityPopup(PuppeteerMixin,
finally:
super(TestIdentityPopup, self).tearDown()
def test_elements(self):
self.locationbar.open_identity_popup()
# Test main view elements
main = self.identity_popup.view.main
- self.assertEqual(main.element.get_attribute('localName'), 'panelview')
+ self.assertEqual(main.element.get_property('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'),
+ self.assertEqual(main.expander.get_property('localName'), 'button')
+ self.assertEqual(main.host.get_property('localName'), 'label')
+ self.assertEqual(main.insecure_connection_label.get_property('localName'),
'description')
- self.assertEqual(main.internal_connection_label.get_attribute('localName'),
+ self.assertEqual(main.internal_connection_label.get_property('localName'),
'description')
- self.assertEqual(main.secure_connection_label.get_attribute('localName'),
+ self.assertEqual(main.secure_connection_label.get_property('localName'),
'description')
- self.assertEqual(main.permissions.get_attribute('localName'), 'vbox')
+ self.assertEqual(main.permissions.get_property('localName'), 'vbox')
# Test security view elements
security = self.identity_popup.view.security
- self.assertEqual(security.element.get_attribute('localName'), 'panelview')
+ self.assertEqual(security.element.get_property('localName'), 'panelview')
- self.assertEqual(security.host.get_attribute('localName'), 'label')
- self.assertEqual(security.insecure_connection_label.get_attribute('localName'),
+ self.assertEqual(security.host.get_property('localName'), 'label')
+ self.assertEqual(security.insecure_connection_label.get_property('localName'),
'description')
- self.assertEqual(security.secure_connection_label.get_attribute('localName'),
+ self.assertEqual(security.secure_connection_label.get_property('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')
+ self.assertEqual(security.owner.get_property('localName'), 'description')
+ self.assertEqual(security.owner_location.get_property('localName'), 'description')
+ self.assertEqual(security.verifier.get_property('localName'), 'description')
- self.assertEqual(security.disable_mixed_content_blocking_button.get_attribute('localName'),
+ self.assertEqual(security.disable_mixed_content_blocking_button.get_property('localName'),
'button')
- self.assertEqual(security.enable_mixed_content_blocking_button.get_attribute('localName'),
+ self.assertEqual(security.enable_mixed_content_blocking_button.get_property('localName'),
'button')
- self.assertEqual(security.more_info_button.get_attribute('localName'), 'button')
+ self.assertEqual(security.more_info_button.get_property('localName'), 'button')
def test_open_close(self):
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)
self.assertFalse(self.identity_popup.is_open)
self.locationbar.open_identity_popup()
--- a/testing/firefox-ui/tests/puppeteer/test_update_wizard.py
+++ b/testing/firefox-ui/tests/puppeteer/test_update_wizard.py
@@ -31,32 +31,32 @@ class TestUpdateWizard(PuppeteerMixin, M
def test_basic(self):
self.assertEqual(self.dialog.window_type, 'Update:Wizard')
self.assertNotEqual(self.dialog.dtds, [])
self.assertNotEqual(self.dialog.properties, [])
def test_elements(self):
"""Test correct retrieval of elements."""
- self.assertEqual(self.wizard.element.get_attribute('localName'), 'wizard')
+ self.assertEqual(self.wizard.element.get_property('localName'), 'wizard')
buttons = ('cancel_button', 'extra1_button', 'extra2_button',
'finish_button', 'next_button', 'previous_button',
)
for button in buttons:
- self.assertEqual(getattr(self.wizard, button).get_attribute('localName'),
+ self.assertEqual(getattr(self.wizard, button).get_property('localName'),
'button')
panels = ('checking', 'downloading', 'dummy', 'error_patching', 'error',
'error_extra', 'finished', 'finished_background',
'manual_update', 'no_updates_found', 'updates_found_basic',
)
for panel in panels:
- self.assertEqual(getattr(self.wizard, panel).element.get_attribute('localName'),
+ self.assertEqual(getattr(self.wizard, panel).element.get_property('localName'),
'wizardpage')
# elements of the checking panel
- self.assertEqual(self.wizard.checking.progress.get_attribute('localName'),
+ self.assertEqual(self.wizard.checking.progress.get_property('localName'),
'progressmeter')
# elements of the downloading panel
- self.assertEqual(self.wizard.downloading.progress.get_attribute('localName'),
+ self.assertEqual(self.wizard.downloading.progress.get_property('localName'),
'progressmeter')
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py
@@ -57,17 +57,17 @@ class TabBar(UIBaseLib):
# Properties for helpers when working with the tabs toolbar #
@property
def selected_index(self):
"""The index of the currently selected tab.
:return: Index of the selected tab.
"""
- return int(self.toolbar.get_attribute('selectedIndex'))
+ return int(self.toolbar.get_property('selectedIndex'))
@property
def selected_tab(self):
"""A :class:`Tab` instance of the currently selected tab.
:returns: :class:`Tab` instance.
"""
return self.tabs[self.selected_index]
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/toolbars.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/toolbars.py
@@ -93,17 +93,17 @@ class LocationBar(UIBaseLib):
return self._autocomplete_results
def clear(self):
"""Clears the contents of the url bar (via the DELETE shortcut)."""
self.focus('shortcut')
self.urlbar.send_keys(keys.Keys.DELETE)
Wait(self.marionette).until(
- lambda _: self.urlbar.get_attribute('value') == '',
+ lambda _: self.value == '',
message='Contents of location bar could not be cleared.')
def close_context_menu(self):
"""Closes the Location Bar context menu by a key event."""
# TODO: This method should be implemented via the menu API.
self.contextmenu.send_keys(keys.Keys.ESCAPE)
@property
@@ -293,17 +293,17 @@ class LocationBar(UIBaseLib):
return self.urlbar.find_element(By.ANON_ATTRIBUTE, {'anonid': 'input'})
@property
def value(self):
"""Provides access to the currently displayed value of the urlbar.
:returns: The urlbar value.
"""
- return self.urlbar.get_attribute('value')
+ return self.urlbar.get_property('value')
class AutocompleteResults(UIBaseLib):
"""Wraps DOM elements and methods for interacting with autocomplete results."""
def close(self, force=False):
"""Closes the urlbar autocomplete popup.
@@ -337,25 +337,25 @@ class AutocompleteResults(UIBaseLib):
'"title" or "url", not %s' % match_type)
# Search for nodes of the given type with emphasized text
emphasized_nodes = result.find_elements(
By.ANON_ATTRIBUTE,
{'class': 'ac-emphasize-text ac-emphasize-text-%s' % match_type}
)
- return [node.get_attribute('textContent') for node in emphasized_nodes]
+ return [node.get_property('textContent') for node in emphasized_nodes]
@property
def visible_results(self):
"""Supplies the list of visible autocomplete result nodes.
:returns: The list of visible results.
"""
- match_count = self.element.get_attribute('_matchCount')
+ match_count = self.element.get_property('_matchCount')
return self.marionette.execute_script("""
let rv = [];
let node = arguments[0];
let count = arguments[1];
for (let i = 0; i < count; ++i) {
rv.push(node.getItemAtIndex(i));
@@ -365,17 +365,17 @@ class AutocompleteResults(UIBaseLib):
""", script_args=[self.results, match_count])
@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'
+ return self.element.get_property('state') == 'open'
@property
def is_complete(self):
"""Returns when this popup is open and autocomplete results are complete.
:returns: True, when autocomplete results have been populated.
"""
return self.marionette.execute_script("""
@@ -399,34 +399,34 @@ class AutocompleteResults(UIBaseLib):
{'anonid': 'richlistbox'})
@property
def selected_index(self):
"""Provides the index of the selected item in the autocomplete list.
:returns: The index.
"""
- return self.results.get_attribute('selectedIndex')
+ return self.results.get_property('selectedIndex')
class IdentityPopup(UIBaseLib):
"""Wraps DOM elements and methods for interacting with the identity popup."""
def __init__(self, *args, **kwargs):
super(IdentityPopup, self).__init__(*args, **kwargs)
self._view = None
@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'
+ return self.element.get_property('state') == 'open'
def close(self, force=False):
"""Closes the identity popup by hitting the escape key.
:param force: Optional, If `True` force close the popup.
Defaults to `False`
"""
if not self.is_open:
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/pageinfo/deck.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/pageinfo/deck.py
@@ -93,17 +93,17 @@ class Deck(UIBaseLib):
# Properties for helpers when working with the deck #
@property
def selected_index(self):
"""The index of the currently selected panel.
:return: Index of the selected panel.
"""
- return int(self.element.get_attribute('selectedIndex'))
+ return int(self.element.get_property('selectedIndex'))
@property
def selected_panel(self):
"""A :class:`Panel` instance of the currently selected panel.
:returns: :class:`Panel` instance.
"""
return self.panels[self.selected_index]
@@ -128,17 +128,17 @@ class Deck(UIBaseLib):
class PageInfoPanel(Panel):
@property
def tab(self):
"""The DOM element which represents the corresponding tab element at the top.
:returns: Reference to the tab element.
"""
- name = self.element.get_attribute('id').split('Panel')[0]
+ name = self.element.get_property('id').split('Panel')[0]
return self.window.window_element.find_element(By.ID, name + 'Tab')
class FeedPanel(PageInfoPanel):
pass
class GeneralPanel(PageInfoPanel):