Bug 1326236 - Use get_property() to retrieve the selectedIndex of decks and wizards. r=maja_zf a=test-only
authorHenrik Skupin <mail@hskupin.info>
Thu, 29 Dec 2016 20:02:57 +0100
changeset 353310 286cc5f7a92de651814fa733f8f54081d6cfaff3
parent 353309 f7b123f1e6231c3460f1a2efd852832a7f636069
child 353311 c57768314ac5046680ada6798ce46138c27f115a
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1326236, 1277090
milestone52.0a2
Bug 1326236 - Use get_property() to retrieve the selectedIndex of decks and wizards. r=maja_zf a=test-only Fix for a regression as introduced by bug 1277090. get_attribute() no longer returns values of Element properties. For the latter get_property() has to be used now. 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
@@ -1,13 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from firefox_puppeteer import PuppeteerMixin
+from firefox_puppeteer.ui.deck import Panel
 from marionette_harness import MarionetteTestCase
 
 
 class TestAboutWindow(PuppeteerMixin, MarionetteTestCase):
 
     def setUp(self):
         super(TestAboutWindow, self).setUp()
 
@@ -48,16 +49,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.assertIsInstance(self.deck.selected_panel, Panel)
+
     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
@@ -1,13 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from firefox_puppeteer import PuppeteerMixin
+from firefox_puppeteer.ui.deck import Panel
 from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog
 from marionette_harness import MarionetteTestCase
 
 
 class TestUpdateWizard(PuppeteerMixin, MarionetteTestCase):
 
     def setUp(self):
         super(TestUpdateWizard, self).setUp()
@@ -55,8 +56,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.assertIsInstance(self.wizard.selected_panel, Panel)
--- 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'))