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

Proposed by Leo Arias
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 798
Merged at revision: 840
Proposed branch: lp:~elopio/unity8/revert_get_applications
Merge into: lp:unity8
Diff against target: 40 lines (+6/-8)
2 files modified
tests/autopilot/unity8/shell/emulators/dash.py (+5/-3)
tests/autopilot/unity8/shell/tests/test_emulators.py (+1/-5)
To merge this branch: bzr merge lp:~elopio/unity8/revert_get_applications
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Allan LeSage (community) Approve
Review via email: mp+213693@code.launchpad.net

Commit message

Reverted the change that returns application cards instead of titles.

Description of the change

One of the most important things of the page object pattern[1] is that we shouldn't expose the internals of the UI.

That's why the autopilot helper get_applications returns just what's visible to the user, the list of application names.
With the new scope changes I didn't notice that this was changed to return the autopilot proxy objects for application cards. I'm reverting that here.

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

 * Are there any related MPs required for this MP to build/function as expected? Please list.

No.

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes, I ran the tests before and after. I explored the QML tree and confirmed that this was the right change.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

No packaging changes.

 * If you changed the UI, has there been a design review?

No UI changes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:797
http://jenkins.qa.ubuntu.com/job/unity8-ci/2705/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4434
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4032
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1575
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1226
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1230
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1230/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1226
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3834
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4538
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4538/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4056
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4056/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6290
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5504

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

review: Needs Fixing (continuous-integration)
798. By Leo Arias

Merged with trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:798
http://jenkins.qa.ubuntu.com/job/unity8-ci/2716/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4465/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4065
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1586
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1237
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1241
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1241/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1237
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3858/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4571
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4571/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4100
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4100/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6317
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5569

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

No objection to just using names; I see that this only affects a test, went to the trouble of running 'em all, noticing a bit of flakiness in test_open_generic_scope but not seeing this as related to this change, will pursue separately.

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

PASSED: Continuous integration, rev:798
http://jenkins.qa.ubuntu.com/job/unity8-ci/2753/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/97
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1623
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1274
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1278
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1278/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1274
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/94
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4211
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4211/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5750
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3974
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4742
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4742/artifact/work/output/*zip*/output.zip

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

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

I disagree with that pattern, but you're the one maintaining the tests, so let's do it

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

 * Did CI run pass? If not, please explain why.
Yes

review: Approve

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:24:04 +0000
4@@ -172,11 +172,13 @@
5
6 """
7 category_element = self._get_category_element(category)
8- application_tiles = category_element.select_many('Card')
9+ application_cards = category_element.select_many('Card')
10 # TODO return them on the same order they are displayed.
11 # --elopio - 2014-1-15
12 result = []
13- for card in application_tiles:
14+ for card in application_cards:
15 if card.objectName != 'cardToolCard':
16- result.append(card)
17+ card_header = card.select_single('CardHeader')
18+ result.append(card_header.title)
19+
20 return result
21
22=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
23--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-03-28 15:24:11 +0000
24+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-04-02 14:24:04 +0000
25@@ -172,14 +172,10 @@
26 :expected_apps_count]
27
28 applications = self.applications_scope.get_applications(category)
29- applications_titles = []
30- for application in applications:
31- cardHeader = application.select_single('CardHeader')
32- applications_titles.append(cardHeader.title)
33
34 self.assertThat(applications, HasLength(expected_apps_count))
35 for expected in expected_applications:
36- self.assertThat(applications_titles, Contains(expected))
37+ self.assertThat(applications, Contains(expected))
38
39 def _get_number_of_application_slots(self, category):
40 category_element = self.applications_scope._get_category_element(

Subscribers

People subscribed via source and target branches