Bug 1326236 - Use get_property() to retrieve the selectedIndex of decks and wizards. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 29 Dec 2016 20:02:57 +0100
changeset 454582 2e66156585e44f973357ccc2acd4e38544a9d8a0
parent 454520 87efd66165ddaa1b97608b92cd651b73c11aca6f
child 540756 647e96f22783f15a30b5748ab8c9fafdf34b3f95
push id39982
push userbmo:hskupin@gmail.com
push dateThu, 29 Dec 2016 19:05:07 +0000
bugs1326236
milestone53.0a1
Bug 1326236 - Use get_property() to retrieve the selectedIndex of decks and wizards. MozReview-Commit-ID: K45rcHDM6YC
testing/firefox-ui/tests/puppeteer/test_about_window.py
testing/firefox-ui/tests/puppeteer/test_update_wizard.py
testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/about_window/deck.py
testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/update_wizard/wizard.py
--- 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'))