Merge lp:~elopio/ubuntu-ui-toolkit/missingcompoutds into lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/missingcompounds

Proposed by Leo Arias
Status: Merged
Merged at revision: 782
Proposed branch: lp:~elopio/ubuntu-ui-toolkit/missingcompoutds
Merge into: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/missingcompounds
Prerequisite: lp:~elopio/ubuntu-ui-toolkit/listview_emulator
Diff against target: 389 lines (+85/-24)
19 files modified
examples/ubuntu-ui-toolkit-gallery/Animations.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Buttons.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Dialog.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Icons.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Label.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Navigation.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Pickers.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Popover.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Sheet.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/Sliders.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/TextInputs.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Toggles.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml (+2/-0)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+16/-0)
examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml (+1/-0)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py (+37/-23)
To merge this branch: bzr merge lp:~elopio/ubuntu-ui-toolkit/missingcompoutds
Reviewer Review Type Date Requested Status
Cris Dywan Pending
Review via email: mp+197040@code.launchpad.net

Commit message

Refactor the tests to use testscenarios and objectNames.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/ubuntu-ui-toolkit-gallery/Animations.qml'
2--- examples/ubuntu-ui-toolkit-gallery/Animations.qml 2013-05-14 14:24:25 +0000
3+++ examples/ubuntu-ui-toolkit-gallery/Animations.qml 2013-11-28 11:13:39 +0000
4@@ -18,6 +18,8 @@
5 import Ubuntu.Components 0.1
6
7 Template {
8+ objectName: "animationsTemplate"
9+
10 TemplateSection {
11 title: i18n.tr("NumberAnimation")
12 className: "UbuntuNumberAnimation"
13
14=== modified file 'examples/ubuntu-ui-toolkit-gallery/Buttons.qml'
15--- examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2013-08-30 07:08:50 +0000
16+++ examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2013-11-28 11:13:39 +0000
17@@ -18,6 +18,8 @@
18 import Ubuntu.Components 0.1
19
20 Template {
21+ objectName: "buttonsTemplate"
22+
23 TemplateSection {
24 className: "Button"
25
26
27=== modified file 'examples/ubuntu-ui-toolkit-gallery/Dialog.qml'
28--- examples/ubuntu-ui-toolkit-gallery/Dialog.qml 2013-07-05 11:59:11 +0000
29+++ examples/ubuntu-ui-toolkit-gallery/Dialog.qml 2013-11-28 11:13:39 +0000
30@@ -19,6 +19,8 @@
31 import Ubuntu.Components.Popups 0.1
32
33 Template {
34+ objectName: "dialogsTemplate"
35+
36 TemplateSection {
37 className: "Dialog"
38 documentation: "qml-ubuntu-components-popups0-%1.html".arg(className.toLowerCase())
39
40=== modified file 'examples/ubuntu-ui-toolkit-gallery/Icons.qml'
41--- examples/ubuntu-ui-toolkit-gallery/Icons.qml 2013-08-28 14:09:31 +0000
42+++ examples/ubuntu-ui-toolkit-gallery/Icons.qml 2013-11-28 11:13:39 +0000
43@@ -18,6 +18,8 @@
44 import Ubuntu.Components 0.1
45
46 Template {
47+ objectName: "iconsTemplate"
48+
49 TemplateSection {
50 className: "Icon"
51
52
53=== modified file 'examples/ubuntu-ui-toolkit-gallery/Label.qml'
54--- examples/ubuntu-ui-toolkit-gallery/Label.qml 2013-04-24 17:09:29 +0000
55+++ examples/ubuntu-ui-toolkit-gallery/Label.qml 2013-11-28 11:13:39 +0000
56@@ -18,6 +18,8 @@
57 import Ubuntu.Components 0.1
58
59 Template {
60+ objectName: "labelsTemplate"
61+
62 TemplateSection {
63 className: "Label"
64
65
66=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
67--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-11-22 14:49:12 +0000
68+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-11-28 11:13:39 +0000
69@@ -19,6 +19,8 @@
70 import Ubuntu.Components.ListItems 0.1 as ListItem
71
72 Template {
73+ objectName: "listItemsTemplate"
74+
75 ListItemsSection {
76 title: i18n.tr("Standard")
77 className: "Standard"
78
79=== modified file 'examples/ubuntu-ui-toolkit-gallery/Navigation.qml'
80--- examples/ubuntu-ui-toolkit-gallery/Navigation.qml 2013-04-24 17:09:29 +0000
81+++ examples/ubuntu-ui-toolkit-gallery/Navigation.qml 2013-11-28 11:13:39 +0000
82@@ -18,6 +18,8 @@
83 import Ubuntu.Components 0.1
84
85 Template {
86+ objectName: "navigationTemplate"
87+
88 Label {
89 anchors.left: parent.left
90 anchors.right: parent.right
91
92=== modified file 'examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml'
93--- examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2013-11-22 14:49:12 +0000
94+++ examples/ubuntu-ui-toolkit-gallery/OptionSelectors.qml 2013-11-28 11:13:39 +0000
95@@ -18,6 +18,8 @@
96 import Ubuntu.Components 0.1
97
98 Template {
99+ objectName: "optionSelectorsTemplate"
100+
101 TemplateSection {
102 title: i18n.tr("Option Selector")
103 className: "Option Selector"
104
105=== modified file 'examples/ubuntu-ui-toolkit-gallery/Pickers.qml'
106--- examples/ubuntu-ui-toolkit-gallery/Pickers.qml 2013-09-12 07:54:12 +0000
107+++ examples/ubuntu-ui-toolkit-gallery/Pickers.qml 2013-11-28 11:13:39 +0000
108@@ -19,6 +19,8 @@
109 import Ubuntu.Components.Pickers 0.1
110
111 Template {
112+ objectName: "pickersTemplate"
113+
114 TemplateSection {
115 className: "Picker"
116 documentation: "qml-ubuntu-components-pickers0-picker.html"
117
118=== modified file 'examples/ubuntu-ui-toolkit-gallery/Popover.qml'
119--- examples/ubuntu-ui-toolkit-gallery/Popover.qml 2013-07-01 22:49:45 +0000
120+++ examples/ubuntu-ui-toolkit-gallery/Popover.qml 2013-11-28 11:13:39 +0000
121@@ -19,6 +19,8 @@
122 import Ubuntu.Components.Popups 0.1
123
124 Template {
125+ objectName: "popoversTemplate"
126+
127 tools: ToolbarItems {
128 ToolbarButton {
129 id: actionsButton
130
131=== modified file 'examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml'
132--- examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2013-05-21 14:39:57 +0000
133+++ examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2013-11-28 11:13:39 +0000
134@@ -18,6 +18,8 @@
135 import Ubuntu.Components 0.1
136
137 Template {
138+ objectName: "progressBarsTemplate"
139+
140 TemplateSection {
141 title: i18n.tr("Progress Bar")
142 className: "ProgressBar"
143
144=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sheet.qml'
145--- examples/ubuntu-ui-toolkit-gallery/Sheet.qml 2013-04-25 12:38:04 +0000
146+++ examples/ubuntu-ui-toolkit-gallery/Sheet.qml 2013-11-28 11:13:39 +0000
147@@ -19,6 +19,8 @@
148 import Ubuntu.Components.Popups 0.1
149
150 Template {
151+ objectName: "sheetsTemplate"
152+
153 Label {
154 anchors.left: parent.left
155 anchors.right: parent.right
156
157=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sliders.qml'
158--- examples/ubuntu-ui-toolkit-gallery/Sliders.qml 2013-07-13 15:12:28 +0000
159+++ examples/ubuntu-ui-toolkit-gallery/Sliders.qml 2013-11-28 11:13:39 +0000
160@@ -18,6 +18,8 @@
161 import Ubuntu.Components 0.1
162
163 Template {
164+ objectName: "slidersTemplate"
165+
166 TemplateSection {
167 className: "Slider"
168 spacing: units.gu(5)
169
170=== modified file 'examples/ubuntu-ui-toolkit-gallery/TextInputs.qml'
171--- examples/ubuntu-ui-toolkit-gallery/TextInputs.qml 2013-05-21 14:39:57 +0000
172+++ examples/ubuntu-ui-toolkit-gallery/TextInputs.qml 2013-11-28 11:13:39 +0000
173@@ -18,7 +18,7 @@
174 import Ubuntu.Components 0.1
175
176 Template {
177- objectName: "textinputs"
178+ objectName: "textfieldsTemplate"
179 property string longText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +
180 "Suspendisse sed nulla in arcu dapibus vehicula ac eu tellus. "+
181 "Mauris malesuada nisl vitae neque auctor placerat. Ut vitae "+
182
183=== modified file 'examples/ubuntu-ui-toolkit-gallery/Toggles.qml'
184--- examples/ubuntu-ui-toolkit-gallery/Toggles.qml 2013-05-21 14:39:57 +0000
185+++ examples/ubuntu-ui-toolkit-gallery/Toggles.qml 2013-11-28 11:13:39 +0000
186@@ -18,6 +18,8 @@
187 import Ubuntu.Components 0.1
188
189 Template {
190+ objectName: "togglesTemplate"
191+
192 TemplateSection {
193 title: "Checkbox"
194 className: "CheckBox"
195
196=== modified file 'examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml'
197--- examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml 2013-07-01 06:33:24 +0000
198+++ examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml 2013-11-28 11:13:39 +0000
199@@ -18,6 +18,8 @@
200 import Ubuntu.Components 0.1
201
202 Template {
203+ objectName: "ubuntuShapesTemplate"
204+
205 TemplateSection {
206 title: "Ubuntu Shape"
207 className: "UbuntuShape"
208
209=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
210--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2013-09-06 13:38:06 +0000
211+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2013-11-28 11:13:39 +0000
212@@ -19,74 +19,90 @@
213 ListModel {
214 // Already in design guidelines
215 ListElement {
216+ objectName: "navigationElement"
217 label: "Navigation"
218 source: "Navigation.qml"
219 }
220
221 ListElement {
222+ objectName: "togglesElement"
223 label: "Toggles"
224 source: "Toggles.qml"
225 }
226 ListElement {
227+ objectName: "buttonsElement"
228 label: "Buttons"
229 source: "Buttons.qml"
230 }
231 ListElement {
232+ objectName: "slidersElement"
233 label: "Slider"
234 source: "Sliders.qml"
235 }
236 ListElement {
237+ objectName: "textfieldsElement"
238 label: "Text Field"
239 source: "TextInputs.qml"
240 }
241
242 ListElement {
243+ objectName: "optionSelectorsElement"
244 label: "Option Selector"
245 source: "OptionSelectors.qml"
246 }
247
248 // Not in design guidelines yet
249 ListElement {
250+ objectName: "pickersElement"
251 label: "Pickers"
252 source: "Pickers.qml"
253 }
254 ListElement {
255+ objectName: "progressBarsElement"
256 label: "Progress and activity"
257 source: "ProgressBars.qml"
258 }
259 ListElement {
260+ objectName: "ubuntuShapesElement"
261 label: "Ubuntu Shape"
262 source: "UbuntuShape.qml"
263 }
264 ListElement {
265+ objectName: "iconsElement"
266 label: "Icons"
267 source: "Icons.qml"
268 }
269 ListElement {
270+ objectName: "labelsElement"
271 label: "Label"
272 source: "Label.qml"
273 }
274
275 // Already in design guidelines but should be reordered
276 ListElement {
277+ objectName: "listItemsElement"
278 label: "List Items"
279 source: "ListItems.qml"
280 }
281 ListElement {
282+ objectName: "dialogsElement"
283 label: "Dialog"
284 source: "Dialog.qml"
285 }
286 ListElement {
287+ objectName: "popoversElement"
288 label: "Popover"
289 source: "Popover.qml"
290 }
291 ListElement {
292+ objectName: "sheetsElement"
293 label: "Sheet"
294 source: "Sheet.qml"
295 }
296
297 // Not in design guidelines yet
298 ListElement {
299+ objectName: "animationsElement"
300 label: "Animations"
301 source: "Animations.qml"
302 }
303
304=== modified file 'examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml'
305--- examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2013-10-22 11:52:34 +0000
306+++ examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2013-11-28 11:13:39 +0000
307@@ -85,6 +85,7 @@
308 anchors.fill: parent
309 model: widgetsModel
310 delegate: ListItem.Standard {
311+ objectName: model.objectName
312 text: model.label
313 enabled: model.source != ""
314 progression: true
315
316=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py'
317--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2013-11-27 15:12:42 +0000
318+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2013-11-28 11:13:39 +0000
319@@ -18,10 +18,12 @@
320
321 from autopilot.matchers import Eventually
322 from testtools.matchers import Is, Not, Equals
323-from ubuntuuitoolkit.tests.gallery import GalleryTestCase
324-
325-
326-class GenericTests(GalleryTestCase):
327+
328+from ubuntuuitoolkit import emulators
329+from ubuntuuitoolkit.tests import gallery
330+
331+
332+class GenericTests(gallery.GalleryTestCase):
333 """Generic tests for the Gallery"""
334
335 def test_0_can_select_mainwindow(self):
336@@ -92,22 +94,34 @@
337 objName = data[0]
338 self.getObject(objName)
339
340- def test_all_pages_load(self):
341- contentLoader, listView = self.getWidgetLoaderAndListView()
342- for child in listView.select_many('Standard'):
343- item = child.text
344- # FIXME: Text Field doesn't work
345- if item == 'Text Field':
346- # select_many doesn't return anything
347- continue
348- # FIXME: Label doesn't work
349- if item == 'Label':
350- # More than one item was returned for query
351- continue
352- # FIXME: The following fail in loadItem in selectItem
353- if item in ['List Items', 'Label', 'Popover', 'Dialog', 'Animations', 'Sheet']:
354- continue
355- self.loadItem(item)
356- self.checkPageHeader(item)
357- assert len(self.app.select_many('Template')) > 0, \
358- ('%s can be loaded in gallery' % item)
359+
360+class OpenPagesTestCase(gallery.GalleryTestCase):
361+
362+ names = [
363+ 'navigation', 'toggles', 'buttons', 'sliders', 'textfields',
364+ 'optionSelectors', 'pickers', 'progressBars', 'ubuntuShapes', 'icons',
365+ 'labels', 'listItems', 'dialogs', 'popovers', 'sheets', 'animations'
366+ ]
367+
368+ scenarios = [
369+ (name, dict(
370+ element_name=name+'Element',
371+ template_name=name+'Template'))
372+ for name in names
373+ ]
374+
375+ def test_open_page(self):
376+ list_view = self.main_view.select_single(
377+ emulators.QQuickListView, objectName="widgetList")
378+ list_view.click_element(self.element_name)
379+ element = self.main_view.select_single(
380+ 'Standard', objectName=self.element_name)
381+ element.selected.wait_for(True)
382+ self.checkPageHeader(element.text)
383+ if self.template_name == 'textfieldsTemplate':
384+ page_type = 'TextInputs'
385+ else:
386+ page_type = 'Template'
387+ self.main_view.wait_select_single(
388+ page_type, objectName=self.template_name)
389+ # TODO check that the template is visible. --elopio - 2013-11-28

Subscribers

People subscribed via source and target branches

to all changes: