Merge lp:~elopio/ubuntu-ui-toolkit/loadItem-no_more into lp:ubuntu-ui-toolkit/staging

Proposed by Leo Arias
Status: Merged
Merged at revision: 1103
Proposed branch: lp:~elopio/ubuntu-ui-toolkit/loadItem-no_more
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 220 lines (+26/-54)
7 files modified
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+1/-14)
tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py (+15/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py (+1/-3)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py (+4/-19)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py (+1/-3)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py (+2/-6)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py (+2/-8)
To merge this branch: bzr merge lp:~elopio/ubuntu-ui-toolkit/loadItem-no_more
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu SDK team Pending
Review via email: mp+221553@code.launchpad.net

This proposal supersedes a proposal from 2014-05-30.

Commit message

Remove the loadItem helper from the gallery autopilot tests.

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

FAILED: Continuous integration, rev:1090
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/313/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/598
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/545
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/145
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/145
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/145
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1040
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1144
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1144/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7954
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/486
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/684
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/684/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/313/rebuild

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

PASSED: Continuous integration, rev:1090
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/352/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/720
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/666
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/184
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/184
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/184/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/184
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1358
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1358/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8173
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/593
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/805
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/805/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/352/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
2--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-04-23 08:50:20 +0000
3+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-05-30 14:31:22 +0000
4@@ -1,6 +1,6 @@
5 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
6 #
7-# Copyright (C) 2012, 2013 Canonical Ltd.
8+# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU Lesser General Public License as published by
12@@ -161,19 +161,6 @@
13 self.assertThat(listView.visible, Eventually(Equals(True)))
14 return (contentLoader, listView)
15
16- def loadItem(self, item):
17- self.selectItem(item)
18- contentLoader = self.main_view.select_single(
19- "QQuickLoader", objectName="contentLoader")
20- self.assertThat(contentLoader.progress, Eventually(Equals(1.0)))
21- loadedPage = self.getListItem(item)
22- self.assertThat(loadedPage, Not(Is(None)))
23- #loadedPage is not a page, it is the list item which goes in
24- #background when the item is selected, which changes the visible
25- #property of item in list itself to False. So followin check
26- #fails on Nexus 4. Commenting it for now.
27- #self.assertThat(loadedPage.visible, Eventually(Equals(True)))
28-
29 def drag(self, itemText, itemTextTo):
30 item = self.getListItem(itemText)
31 itemTo = self.getListItem(itemTextTo)
32
33=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py'
34--- tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2013-10-24 11:01:03 +0000
35+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-05-30 14:31:22 +0000
36@@ -1,6 +1,6 @@
37 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
38 #
39-# Copyright (C) 2012, 2013 Canonical Ltd.
40+# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
41 #
42 # This program is free software; you can redistribute it and/or modify
43 # it under the terms of the GNU Lesser General Public License as published by
44@@ -19,6 +19,7 @@
45 import os
46 import shutil
47
48+import ubuntuuitoolkit
49 from ubuntuuitoolkit import tests
50
51
52@@ -71,6 +72,19 @@
53 else:
54 return desktop_file_path
55
56+ def open_page(self, page):
57+ """Open a page of the widget gallery.
58+
59+ :param page: The objectName of the element in the index list that opens
60+ the page.
61+
62+ """
63+ list_view = self.main_view.select_single(
64+ ubuntuuitoolkit.QQuickListView, objectName="widgetList")
65+ list_view.click_element(page)
66+ element = self.main_view.select_single('Standard', objectName=page)
67+ element.selected.wait_for(True)
68+
69 def tearDown(self):
70 super(GalleryTestCase, self).tearDown()
71 # We can't delete the desktop file before we close the application,
72
73=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py'
74--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-02-11 01:55:49 +0000
75+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-05-30 14:31:22 +0000
76@@ -45,9 +45,7 @@
77 ]
78
79 def test_buttons(self):
80- item = "Buttons"
81- self.loadItem(item)
82- self.checkPageHeader(item)
83+ self.open_page('buttonsElement')
84
85 button = self.app.select_single(objectName=self.button_name)
86 self.assertIsNot(button, None)
87
88=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py'
89--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-05-26 12:37:32 +0000
90+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-05-30 14:31:22 +0000
91@@ -19,7 +19,6 @@
92 from autopilot.matchers import Eventually
93 from testtools.matchers import Is, Not, Equals
94
95-from ubuntuuitoolkit import emulators
96 from ubuntuuitoolkit.tests import gallery
97
98
99@@ -33,15 +32,8 @@
100 self.assertThat(rootItem, Not(Is(None)))
101 self.assertThat(rootItem.visible, Eventually(Equals(True)))
102
103- def test_navigation(self):
104- item = "Navigation"
105- self.loadItem(item)
106- self.checkPageHeader(item)
107-
108 def test_slider(self):
109- item = "Slider"
110- self.loadItem(item)
111- self.checkPageHeader(item)
112+ self.open_page('slidersElement')
113
114 item_data = [
115 ["slider_standard"],
116@@ -57,9 +49,7 @@
117 # TODO: move slider value
118
119 def test_progress_and_activity(self):
120- item = "Progress and activity"
121- self.loadItem(item)
122- self.checkPageHeader(item)
123+ self.open_page('progressBarsElement')
124
125 item_data = [
126 ["progressbar_standard"],
127@@ -79,9 +69,7 @@
128 # FIXME: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1308979
129 return
130
131- item = "Ubuntu Shape"
132- self.loadItem(item)
133- self.checkPageHeader(item)
134+ self.open_page('ubuntuShapesElement')
135
136 item_data = [
137 ["ubuntushape_color_hex"],
138@@ -115,12 +103,9 @@
139 ]
140
141 def test_open_page(self):
142- list_view = self.main_view.select_single(
143- emulators.QQuickListView, objectName="widgetList")
144- list_view.click_element(self.element_name)
145+ self.open_page(self.element_name)
146 element = self.main_view.select_single(
147 'Standard', objectName=self.element_name)
148- element.selected.wait_for(True)
149 self.checkPageHeader(element.text)
150 if self.template_name == 'textinputsTemplate':
151 page_type = 'TextInputs'
152
153=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
154--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-05-23 09:50:42 +0000
155+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-05-30 14:31:22 +0000
156@@ -24,9 +24,7 @@
157
158 def setUp(self):
159 super(OptionSelectorTestCase, self).setUp()
160- item = "Option Selector"
161- self.loadItem(item)
162- self.checkPageHeader(item)
163+ self.open_page('optionSelectorsElement')
164
165 def test_select_option_from_collapsed_optionselector(self):
166 collapsed_option_selector = self.main_view.select_single(
167
168=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py'
169--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-04-30 09:40:17 +0000
170+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-05-30 14:31:22 +0000
171@@ -54,9 +54,7 @@
172 # Apply the user locale from the environment
173 # The UITK does the same, so the test must be localized
174 locale.setlocale(locale.LC_ALL, "")
175- item = 'Text Field'
176- self.loadItem(item)
177- self.checkPageHeader(item)
178+ self.open_page('textinputsElement')
179
180 def test_write_on_textfield_must_update_text(self):
181 textfield = self.main_view.select_single(
182@@ -78,9 +76,7 @@
183
184 def setUp(self):
185 super(DisabledTextInputTestCase, self).setUp()
186- item = 'Text Field'
187- self.loadItem(item)
188- self.checkPageHeader(item)
189+ self.open_page('textinputsElement')
190
191 def test_textfield_disabled(self):
192 textfield_disabled = self.main_view.select_single(
193
194=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py'
195--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2013-11-01 15:15:30 +0000
196+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-05-30 14:31:22 +0000
197@@ -35,10 +35,7 @@
198
199 def setUp(self):
200 super(EnabledTogglesTestCase, self).setUp()
201- item = "Toggles"
202- self.checkListItem(item)
203- self.loadItem(item)
204- self.checkPageHeader(item)
205+ self.open_page('togglesElement')
206
207 def test_change_toggles_state(self):
208 toggle = self.main_view.select_single(
209@@ -65,10 +62,7 @@
210
211 def setUp(self):
212 super(DisabledTogglesTestCase, self).setUp()
213- item = "Toggles"
214- self.checkListItem(item)
215- self.loadItem(item)
216- self.checkPageHeader(item)
217+ self.open_page('togglesElement')
218
219 def test_change_toggles_state(self):
220 toggle = self.main_view.select_single(

Subscribers

People subscribed via source and target branches