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
1=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
2--- tests/autopilot/unity8/shell/emulators/dash.py 2014-03-28 15:24:11 +0000
3+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-04-02 14:25:28 +0000
4@@ -142,6 +142,7 @@
5
6 :parameter category: The name of the category where the application is.
7 :app_name: The name of the application.
8+ :return: The opened preview.
9
10 """
11 category_element = self._get_category_element(category)
12@@ -150,8 +151,11 @@
13 # Some categories do not show previews, like recent apps.
14 # --elopio - 2014-1-14
15 self.pointing_device.click_object(icon)
16- return self.get_root_instance().wait_select_single(
17+ preview_list = self.get_root_instance().wait_select_single(
18 'PreviewListView', objectName='dashContentPreviewList')
19+ preview_list.x.wait_for(0)
20+ return preview_list.select_single(
21+ Preview, objectName='preview{}'.format(preview_list.currentIndex))
22
23 def _get_category_element(self, category):
24 try:
25@@ -180,3 +184,7 @@
26 if card.objectName != 'cardToolCard':
27 result.append(card)
28 return result
29+
30+
31+class Preview(emulators.UnityEmulatorBase):
32+ """Autopilot custom proxy object for generic previews."""
33
34=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
35--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-03-28 15:24:11 +0000
36+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-04-02 14:25:28 +0000
37@@ -141,7 +141,9 @@
38
39 def test_open_preview(self):
40 preview = self.generic_scope.open_preview('0', 'Title.0.0')
41- preview.x.wait_for(0)
42+ self.assertIsInstance(preview, dash_emulators.Preview)
43+ self.assertTrue(preview.isCurrent)
44+
45
46 class DashAppsEmulatorTestCase(DashBaseTestCase):
47
48@@ -186,7 +188,3 @@
49 category)
50 grid = category_element.select_single('CardFilterGrid')
51 return grid.columns * grid.rows
52-
53- def test_open_preview(self):
54- preview = self.applications_scope.open_preview('2', 'Title.2.1')
55- preview.x.wait_for(0)

Subscribers

People subscribed via source and target branches