Merge lp:~elopio/unity8/revert_open_preview into lp:unity8

Proposed by Leo Arias
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 799
Merged at revision: 814
Proposed branch: lp:~elopio/unity8/revert_open_preview
Merge into: lp:unity8
Diff against target: 55 lines (+12/-6)
2 files modified
tests/autopilot/unity8/shell/emulators/dash.py (+9/-1)
tests/autopilot/unity8/shell/tests/test_emulators.py (+3/-5)
To merge this branch: bzr merge lp:~elopio/unity8/revert_open_preview
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Richard Huddie (community) Approve
Review via email: mp+213771@code.launchpad.net

Commit message

Reverted the open_preview autopilot helper to return a Preview object.

Description of the change

One of the most important things of the page object pattern[1] is that actions should return other page objects representing the state of the UI after the action if performed.

That's why the autopilot helper open_preview returns a Preview object.
With the new scope changes I didn't notice that this was changed to return a the list of previews. I'm reverting that here.

[1]https://code.google.com/p/selenium/wiki/PageObjects

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
799. By Leo Arias

Merged with trunk.

Revision history for this message
Richard Huddie (rhuddie) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:799
http://jenkins.qa.ubuntu.com/job/unity8-ci/2715/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4464/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4064/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1585
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1236
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1240
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1240/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1236
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3857/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4570
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4570/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4099
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4099/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6316/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5566

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2715/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:799
http://jenkins.qa.ubuntu.com/job/unity8-ci/2726/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4489
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4090
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1596
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1247
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1251
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1251/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1247
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3879
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4598
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4598/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4125
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4125/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6335
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5594

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2726/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks OK

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
No, it's tests

 * Did CI run pass? If not, please explain why.
No, something unrelated broke

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2014-03-28 15:24:11 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-04-02 14:25:28 +0000
@@ -142,6 +142,7 @@
142142
143 :parameter category: The name of the category where the application is.143 :parameter category: The name of the category where the application is.
144 :app_name: The name of the application.144 :app_name: The name of the application.
145 :return: The opened preview.
145146
146 """147 """
147 category_element = self._get_category_element(category)148 category_element = self._get_category_element(category)
@@ -150,8 +151,11 @@
150 # Some categories do not show previews, like recent apps.151 # Some categories do not show previews, like recent apps.
151 # --elopio - 2014-1-14152 # --elopio - 2014-1-14
152 self.pointing_device.click_object(icon)153 self.pointing_device.click_object(icon)
153 return self.get_root_instance().wait_select_single(154 preview_list = self.get_root_instance().wait_select_single(
154 'PreviewListView', objectName='dashContentPreviewList')155 'PreviewListView', objectName='dashContentPreviewList')
156 preview_list.x.wait_for(0)
157 return preview_list.select_single(
158 Preview, objectName='preview{}'.format(preview_list.currentIndex))
155159
156 def _get_category_element(self, category):160 def _get_category_element(self, category):
157 try:161 try:
@@ -180,3 +184,7 @@
180 if card.objectName != 'cardToolCard':184 if card.objectName != 'cardToolCard':
181 result.append(card)185 result.append(card)
182 return result186 return result
187
188
189class Preview(emulators.UnityEmulatorBase):
190 """Autopilot custom proxy object for generic previews."""
183191
=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-03-28 15:24:11 +0000
+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-04-02 14:25:28 +0000
@@ -141,7 +141,9 @@
141141
142 def test_open_preview(self):142 def test_open_preview(self):
143 preview = self.generic_scope.open_preview('0', 'Title.0.0')143 preview = self.generic_scope.open_preview('0', 'Title.0.0')
144 preview.x.wait_for(0)144 self.assertIsInstance(preview, dash_emulators.Preview)
145 self.assertTrue(preview.isCurrent)
146
145147
146class DashAppsEmulatorTestCase(DashBaseTestCase):148class DashAppsEmulatorTestCase(DashBaseTestCase):
147149
@@ -186,7 +188,3 @@
186 category)188 category)
187 grid = category_element.select_single('CardFilterGrid')189 grid = category_element.select_single('CardFilterGrid')
188 return grid.columns * grid.rows190 return grid.columns * grid.rows
189
190 def test_open_preview(self):
191 preview = self.applications_scope.open_preview('2', 'Title.2.1')
192 preview.x.wait_for(0)

Subscribers

People subscribed via source and target branches