Bug 1326236 - Use get_property() to retrieve the selectedIndex of decks and wizards.
MozReview-Commit-ID: K45rcHDM6YC
--- a/testing/firefox-ui/tests/puppeteer/test_about_window.py
+++ b/testing/firefox-ui/tests/puppeteer/test_about_window.py
@@ -48,16 +48,20 @@ class TestAboutWindow(PuppeteerMixin, Ma
self.assertEqual(panel.button.get_property('localName'), 'button')
# download_failed panel
self.assertEqual(self.deck.download_failed.element.get_property('localName'), 'hbox')
# downloading panel
self.assertEqual(self.deck.downloading.element.get_property('localName'), 'hbox')
+ # check deck attributes
+ self.assertIsInstance(self.deck.selected_index, int)
+ self.assertEqual(self.deck.selected_panel, self.deck.check_for_updates)
+
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_update_wizard.py
+++ b/testing/firefox-ui/tests/puppeteer/test_update_wizard.py
@@ -55,8 +55,12 @@ class TestUpdateWizard(PuppeteerMixin, M
# elements of the checking panel
self.assertEqual(self.wizard.checking.progress.get_property('localName'),
'progressmeter')
# elements of the downloading panel
self.assertEqual(self.wizard.downloading.progress.get_property('localName'),
'progressmeter')
+
+ # check wizard attributes
+ self.assertIsInstance(self.wizard.selected_index, int)
+ self.assertEqual(self.wizard.selected_panel, self.wizard.checking)
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/about_window/deck.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/about_window/deck.py
@@ -109,17 +109,17 @@ class Deck(UIBaseLib):
return [self._create_panel_for_id(panel) for panel in panels]
@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]
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/update_wizard/wizard.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/update_wizard/wizard.py
@@ -202,17 +202,17 @@ class Wizard(UIBaseLib):
return [self._create_panel_for_id(panel) for panel in panels]
@property
def selected_index(self):
"""The index of the currently selected panel.
:return: Index of the selected panel.
"""
- return int(self.element.get_attribute('pageIndex'))
+ return int(self.element.get_property('pageIndex'))
@property
def selected_panel(self):
"""A :class:`Panel` instance of the currently selected panel.
:returns: :class:`Panel` instance.
"""
return self._create_panel_for_id(self.element.get_attribute('currentpageid'))