Merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/update-for-upcoming-autopilot-1.6 into lp:ubuntu-ui-toolkit/staging

Proposed by Christopher Lee on 2015-06-16
Status: Rejected
Rejected by: Tim Peeters on 2015-09-22
Proposed branch: lp:~canonical-platform-qa/ubuntu-ui-toolkit/update-for-upcoming-autopilot-1.6
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 1737 lines (+965/-335)
18 files modified
examples/ubuntu-ui-toolkit-gallery/po/nl.po (+401/-279)
examples/ubuntu-ui-toolkit-gallery/po/pt_BR.po (+412/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py (+6/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+5/-3)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py (+2/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py (+8/-5)
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+14/-6)
tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py (+5/-2)
tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py (+30/-13)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py (+5/-2)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+34/-8)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+23/-7)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py (+6/-3)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py (+4/-1)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py (+6/-2)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/update-for-upcoming-autopilot-1.6
Reviewer Review Type Date Requested Status
Tim Peeters Resubmit on 2015-09-22
Zoltan Balogh (community) Approve on 2015-09-21
PS Jenkins bot continuous-integration Approve on 2015-07-21
Christian Dywan 2015-06-16 Needs Information on 2015-07-09
Review via email: mp+262046@code.launchpad.net

Commit Message

Update autopilot tests and helpers to work with the new Autopilot 1.6 version.

Description of the Change

Update autopilot tests and helpers to work with the new Autopilot 1.6 version.

This branch depends on the release of the latest Autopilot 1.6. This MP will be updated when this will be happening to make sure everything lands nicely.

To post a comment you must log in.
Omer Akram (om26er) wrote :

The build failed due to pyflakes warnings, I fixed that and pushed.

Christian Dywan (kalikiana) wrote :

I've got some questions about this - nothing here is necessarily wrong, but I'm somewhat concerned about code readability with some of the changes.

+ from ubuntuuitoolkit._custom_proxy_objects._flickable import (

These inline import seem odd to me. Why aren't those at the top like usual?

342 - topButton = self.main_view.select_single(objectName='topButton')
343 + topButton = ProxyBase.from_proxy_object(
344 + self.main_view.select_single(objectName='topButton')
345 + )

Is this a new, incompatible pattern in the Autopilot API? Will all apps need to use this? Why wouldn't select_single be fixed instead?

+ UbuntuUIToolkitCustomProxyObjectBase as ProxyBase,

If this is our own API, wouldn't it be clearer to call it ProxyBase instead of locally renaming it? That way it'll be less confusing.

review: Needs Information
1204. By Christopher Lee on 2015-07-20

Merge trunk

1205. By Christopher Lee on 2015-07-20

Remove use of emualtor_base

1206. By Christopher Lee on 2015-07-20

Update with more fixes.

1207. By Christopher Lee on 2015-07-20

Merge changes

Christopher Lee (veebers) wrote :

Sorry for the delay, this work went a little stale but I'm back on it now.

> I've got some questions about this - nothing here is necessarily wrong, but
> I'm somewhat concerned about code readability with some of the changes.
>
> + from ubuntuuitoolkit._custom_proxy_objects._flickable import (
>
> These inline import seem odd to me. Why aren't those at the top like usual?

Oops, that was a mistake on my part, I had meant to move it up to the top once tested.

>
> 342 - topButton =
> self.main_view.select_single(objectName='topButton')
> 343 + topButton = ProxyBase.from_proxy_object(
> 344 + self.main_view.select_single(objectName='topButton')
> 345 + )
>
> Is this a new, incompatible pattern in the Autopilot API? Will all apps need
> to use this? Why wouldn't select_single be fixed instead?

This change is due to how Custom Proxy Objects now work in autopilot 1.6. Previously there was an 'registry' that stored known CPO classes and match them to an application + object 'automagically'. This was prone to failure and confusing issues as populating the registry was non-deterministic (and relied on the python import mechanics).

The registry also meant you launched an application with an 'emulator_base' which meant that any proxy object created for that application will at least have a base class of that.
From 1.6 onwards CPO usage is explicit, i.e. the CPO passed into select_single (or the other query methods) will be the one used to create the proxy object (assuming the validate_dbus matches etc.). If passing None or a string to select_single et. al a 'generated default' is created which is the basic autopilot.dbus.ProxyObject instatiated.

This also means that there is no emulator_base, so if no CPO class is provided to select_single what now is returned is a generated default and not a basic emulator_base type (which used to be a UITK Proxy base and have a swipe_into_view method).

This is a pretty big change to how autopilot proxy objects and custom proxy classes work which is why we're going through and ensuring it works and updating core helpes (UITK & Unity8) and will then move onto the apps.

This change also means that the use of which CPO is used to create a proxy object is obvious and deterministic and does depend on when or if someone import the class at the right time.

So this code used to work because while it only used objectName for select_single, the emaultor_base used to launch the application was used. Now it would only be a gen. default with none of the extra methods.

A different way of doing this would be: http://paste.ubuntu.com/11912767/ declaring a specific CPO that matches Button.

I'm interested to hear thoughts on this because, as I mentioned, this is a big change to how things used to work so there may be some friction with it.

>
> + UbuntuUIToolkitCustomProxyObjectBase as ProxyBase,
>
> If this is our own API, wouldn't it be clearer to call it ProxyBase instead of
> locally renaming it? That way it'll be less confusing.

Very good point, was used purely to get around the 80 char limit of pep8 :-)

1208. By Christopher Lee on 2015-07-21

Moved import to top of file.

1209. By Christopher Lee on 2015-07-21

Make change as per MP comments.

Zoltan Balogh (bzoltan) wrote :

Surprisingly, even if it is an old MR it does not conflict with the staging.

review: Approve
Tim Peeters (tpeeters) wrote :

This MR was merged into our staging, but because we don't have AP 1.6 yet it breaks our tests. I revert the changes here https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/revert-ap16/+merge/272004

When autopilot 1.6 is ready, please make a new MR to propose the needed changes.

review: Resubmit

Unmerged revisions

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/po/nl.po'
2--- examples/ubuntu-ui-toolkit-gallery/po/nl.po 2012-10-25 13:40:27 +0000
3+++ examples/ubuntu-ui-toolkit-gallery/po/nl.po 2015-07-21 06:38:21 +0000
4@@ -1,290 +1,412 @@
5+# Dutch translation for ubuntu-ui-toolkit
6+# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
7+# This file is distributed under the same license as the ubuntu-ui-toolkit package.
8+# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
9+#
10 msgid ""
11 msgstr ""
12-"Project-Id-Version: \n"
13-"POT-Creation-Date: \n"
14-"PO-Revision-Date: \n"
15-"Last-Translator: Tim Peeters <tim.peeters@canonical.com>\n"
16-"Language-Team: \n"
17-"Language: \n"
18+"Project-Id-Version: ubuntu-ui-toolkit\n"
19+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
20+"POT-Creation-Date: 2014-11-11 11:21+0100\n"
21+"PO-Revision-Date: 2015-07-10 15:38+0000\n"
22+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
23+"Language-Team: Dutch <nl@li.org>\n"
24 "MIME-Version: 1.0\n"
25-"Content-Type: text/plain; charset=iso-8859-1\n"
26+"Content-Type: text/plain; charset=UTF-8\n"
27 "Content-Transfer-Encoding: 8bit\n"
28-
29-msgid "Activity Indicator"
30-msgstr "Activiteitsindicator"
31-
32-msgid "Basic"
33-msgstr "Basis"
34-
35-msgid "Button"
36-msgstr "Knop"
37-
38-msgid "Buttons"
39-msgstr "Knoppen"
40-
41+"X-Launchpad-Export-Date: 2015-07-11 05:31+0000\n"
42+"X-Generator: Launchpad (build 17620)\n"
43+
44+#: Animations.qml:24
45+msgid "NumberAnimation"
46+msgstr ""
47+
48+#: Animations.qml:28 Buttons.qml:28 Dialog.qml:29 ListItems.qml:25
49+#: ProgressBars.qml:28 ProgressBars.qml:84 Sheet.qml:40 Sheet.qml:73
50+#: Sliders.qml:28 TextInputs.qml:45
51+msgid "Standard"
52+msgstr ""
53+
54+#: Animations.qml:58
55+msgid "Standard Durations"
56+msgstr ""
57+
58+#: Animations.qml:62
59+msgid "Snap"
60+msgstr ""
61+
62+#: Animations.qml:98
63+msgid "Fast"
64+msgstr ""
65+
66+#: Animations.qml:134
67+msgid "Slow"
68+msgstr ""
69+
70+#: Animations.qml:159
71+msgid "Sleepy"
72+msgstr ""
73+
74+#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:51 Buttons.qml:71 Buttons.qml:79
75+#: Buttons.qml:89
76 msgid "Call"
77-msgstr "Bellen"
78-
79-msgid "Captions and Dividers"
80-msgstr "Bijschriften en verdelers"
81-
82-msgid "Check Box"
83-msgstr "Selectievakje"
84-
85-msgid "Checked"
86-msgstr "Aangevinkt"
87-
88-msgid "Colors"
89-msgstr "Kleuren"
90-
91-msgid "Content"
92-msgstr "Inhoud"
93-
94-msgid "Controls"
95-msgstr "Controls"
96-
97-msgid "Custom icon"
98-msgstr "Aangepast icoon"
99-
100-msgid "Date Picker"
101-msgstr "Datum kiezer"
102-
103-msgid "Default"
104-msgstr "Standaard"
105-
106+msgstr ""
107+
108+#: Buttons.qml:37
109+msgid "Stroke"
110+msgstr ""
111+
112+#: Buttons.qml:47 UbuntuShape.qml:28
113+msgid "Color"
114+msgstr ""
115+
116+#: Buttons.qml:57 Buttons.qml:114 ListItems.qml:43
117+msgid "Icon"
118+msgstr ""
119+
120+#: Buttons.qml:66 Buttons.qml:128
121+msgid "Icon+Text"
122+msgstr ""
123+
124+#: Buttons.qml:85 TextInputs.qml:88 Toggles.qml:45 Toggles.qml:83
125 msgid "Disabled"
126-msgstr "Uitgeschakeld"
127-
128+msgstr ""
129+
130+#: Buttons.qml:99 OptionSelectors.qml:34
131+msgid "Collapsed"
132+msgstr ""
133+
134+#: Buttons.qml:142 ListItems.qml:120 OptionSelectors.qml:43
135 msgid "Expanded"
136-msgstr "Uitgebreid"
137-
138-msgid "External page"
139-msgstr "Externe pagina"
140-
141-msgid "First page"
142-msgstr "Eerste pagina"
143-
144-msgid "Grid View"
145-msgstr "Rasterweergave"
146-
147-msgid "Grouped List"
148-msgstr "Gegroepeerde lijst"
149-
150-msgid "Icon"
151-msgstr "Icoon"
152-
153-msgid "Idle"
154-msgstr "Inactief"
155-
156-msgid "It also works well with icons and progression."
157-msgstr "Het werkt ook goed met icoontjes en voortgang."
158-
159-msgid "Item"
160-msgstr "Item"
161-
162-msgid "Known"
163-msgstr "Bekend"
164-
165+msgstr ""
166+
167+#: Colors.qml:30
168+msgid "Orange"
169+msgstr ""
170+
171+#: Colors.qml:36
172+msgid "Light grey"
173+msgstr ""
174+
175+#: Colors.qml:42
176+msgid "Dark grey"
177+msgstr ""
178+
179+#: Colors.qml:48
180+msgid "Red"
181+msgstr ""
182+
183+#: Colors.qml:54
184+msgid "Green"
185+msgstr ""
186+
187+#: Colors.qml:60
188+msgid "Blue"
189+msgstr ""
190+
191+#: Colors.qml:66
192+msgid "Purple"
193+msgstr ""
194+
195+#: Dialog.qml:32 Popover.qml:45 Sheet.qml:43 Sheet.qml:76
196+msgid "Open"
197+msgstr ""
198+
199+#: Icons.qml:30
200+msgid "Scaling"
201+msgstr ""
202+
203+#: Icons.qml:55
204+msgid "Colorization"
205+msgstr ""
206+
207+#: Icons.qml:80
208+msgid "Theme"
209+msgstr ""
210+
211+#: ListItems.qml:28 ListItems.qml:36 ListItems.qml:46 ListItems.qml:60
212+#: ListItems.qml:66 ListItems.qml:76 ListItems.qml:85 ListItems.qml:94
213+#: ListItems.qml:160 ListItems.qml:173 ListItems.qml:193
214 msgid "Label"
215-msgstr "Label"
216-
217-msgid "Large button clicked"
218-msgstr "Grote knop geklikt"
219-
220-msgid "List Items"
221-msgstr "Lijstitems"
222-
223-msgid "Live"
224-msgstr "Live"
225-
226-msgid "Mixed"
227-msgstr "Gemengd"
228-
229-msgid "Multiple lines"
230-msgstr "Meerdere regels"
231-
232-msgid "Multiple values"
233-msgstr "Meerdere waardes"
234-
235-msgid "My custom page"
236-msgstr "Mijn aangepaste pagina"
237-
238-msgid "On Screen Keyboard"
239-msgstr "On-screen toetsenbord"
240-
241-msgid "Overlaid"
242-msgstr "Bedekt"
243-
244-msgid "Page one"
245-msgstr "Pagina een"
246-
247-msgid "Page Stack"
248-msgstr "Page Stack"
249-
250-msgid "Page two (external)"
251-msgstr "Pagina twee (extern)"
252-
253-msgid "Password"
254-msgstr "Wachtwoord"
255-
256-msgid "password echo on editing"
257-msgstr "wachtwoord weergeven tijdens bewerken"
258-
259-msgid "password with echo"
260-msgstr "wachtwoord met weergave"
261-
262-msgid "Popovers"
263-msgstr "Popovers"
264-
265-msgid "Progress Bar"
266-msgstr "Voortgangsbalk"
267-
268+msgstr ""
269+
270+#: ListItems.qml:33
271+msgid "Subtitled"
272+msgstr ""
273+
274+#: ListItems.qml:37
275+msgid "Secondary label"
276+msgstr ""
277+
278+#: ListItems.qml:52
279+msgid "ThinDivider"
280+msgstr ""
281+
282+#: ListItems.qml:73
283 msgid "Progression"
284-msgstr "Voortgang"
285-
286-msgid "Red rectangle"
287-msgstr "Rode rechthoek"
288-
289-msgid "Root page"
290-msgstr "Root pagina"
291-
292-msgid "Root page (again)"
293-msgstr "Root pagina (opnieuw)"
294-
295-msgid "sample text"
296-msgstr "voorbeeldtekst"
297-
298-msgid "Scalability"
299-msgstr "Schaalbaarheid"
300-
301-msgid "Scrollbar"
302-msgstr "Scrollbar"
303-
304-msgid "Secondary label"
305-msgstr "Secundaire label"
306-
307-msgid "Selected"
308-msgstr "Geselecteerd"
309-
310-msgid "Sheets & Dialogues"
311-msgstr "Sheets en dialogen"
312-
313-msgid "Show"
314-msgstr "Weergeven"
315-
316-msgid "simple text field"
317-msgstr "eenvoudig tekstveld"
318-
319-msgid "Single control"
320-msgstr "Enkele control"
321-
322+msgstr ""
323+
324+#: ListItems.qml:82
325 msgid "Single value"
326-msgstr "Enkele waarde"
327-
328-msgid "Slider"
329-msgstr "Schuif"
330-
331-msgid "Split"
332-msgstr "Splitsing"
333-
334-msgid "Standard"
335-msgstr "Standaard"
336-
337-msgid "Subtitled"
338-msgstr "Ondertiteld"
339-
340-msgid "Switch"
341-msgstr "Schakelaar"
342-
343-msgid "Tab"
344-msgstr "Tab"
345-
346-msgid "Tabs"
347-msgstr "Tabbladen"
348-
349-msgid "Tabs (Non Segmented)"
350-msgstr "Tabbladen (niet gesegmenteerd)"
351-
352-msgid "Tabs (Segmented)"
353-msgstr "Tabbladen (gesegmenteerd)"
354-
355-msgid "Text Input"
356-msgstr "Tekst invoer"
357-
358-msgid ""
359-"This is a multi-line subText.\n"
360-"Up to 5 lines are supported."
361-msgstr ""
362-"Dit is een subText van meerdere regels.\n"
363-"Maximaal 5 regels worden ondersteund."
364-
365-msgid "This is an external page."
366-msgstr "Dit is een externe pagina."
367-
368-msgid "This is the first tab."
369-msgstr "Dit is de eerste tab."
370-
371-msgid "This is the second tab."
372-msgstr "Dit is de tweede tab."
373-
374-msgid "Time Picker"
375-msgstr "Tijd kiezer"
376-
377-msgid "Toolbars"
378-msgstr "Werkbalken"
379-
380-msgid "Types of list items"
381-msgstr "Types lijst items"
382-
383-msgid "type to show clear button"
384-msgstr "typen om de wis-knop weer te geven"
385-
386+msgstr ""
387+
388+#: ListItems.qml:86
389+msgid "Value"
390+msgstr ""
391+
392+#: ListItems.qml:91
393+msgid "Multi value"
394+msgstr ""
395+
396+#: ListItems.qml:95 ListItems.qml:113 ListItems.qml:122 ListItems.qml:132
397+#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:35
398+#: OptionSelectors.qml:45 OptionSelectors.qml:56 OptionSelectors.qml:86
399+#: OptionSelectors.qml:101
400+msgid "Value 1"
401+msgstr ""
402+
403+#: ListItems.qml:96 ListItems.qml:114 ListItems.qml:123 ListItems.qml:133
404+#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:36
405+#: OptionSelectors.qml:46 OptionSelectors.qml:57 OptionSelectors.qml:87
406+#: OptionSelectors.qml:102
407+msgid "Value 2"
408+msgstr ""
409+
410+#: ListItems.qml:97 ListItems.qml:115 ListItems.qml:124 ListItems.qml:134
411+#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:37
412+#: OptionSelectors.qml:47 OptionSelectors.qml:58 OptionSelectors.qml:88
413+#: OptionSelectors.qml:103
414+msgid "Value 3"
415+msgstr ""
416+
417+#: ListItems.qml:98 ListItems.qml:116 ListItems.qml:125 ListItems.qml:135
418+#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:38
419+#: OptionSelectors.qml:48 OptionSelectors.qml:59 OptionSelectors.qml:89
420+#: OptionSelectors.qml:104
421+msgid "Value 4"
422+msgstr ""
423+
424+#: ListItems.qml:103
425+msgid "Item selector"
426+msgstr ""
427+
428+#: ListItems.qml:112 TextInputs.qml:114
429+msgid "Expanding"
430+msgstr ""
431+
432+#: ListItems.qml:129 OptionSelectors.qml:53
433+msgid "Multiple Selection"
434+msgstr ""
435+
436+#: ListItems.qml:139 OptionSelectors.qml:64
437+msgid "Custom Model"
438+msgstr ""
439+
440+#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:90
441+#: OptionSelectors.qml:105
442+msgid "Value 5"
443+msgstr ""
444+
445+#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:91
446+#: OptionSelectors.qml:106
447+msgid "Value 6"
448+msgstr ""
449+
450+#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:92
451+#: OptionSelectors.qml:107
452+msgid "Value 7"
453+msgstr ""
454+
455+#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:93
456+#: OptionSelectors.qml:108
457+msgid "Value 8"
458+msgstr ""
459+
460+#: ListItems.qml:190
461+msgid "Control"
462+msgstr ""
463+
464+#: ListItems.qml:202
465+msgid "Removable"
466+msgstr ""
467+
468+#: ListItems.qml:205
469+msgid "Slide to remove"
470+msgstr ""
471+
472+#: ListItems.qml:215
473+msgid "Reset"
474+msgstr ""
475+
476+#: ListItems.qml:226
477+msgid "Grouped list"
478+msgstr ""
479+
480+#: ListItems.qml:261
481+msgid "UbuntuListView"
482+msgstr ""
483+
484+#: ListItems.qml:321
485+msgid "ExpandablesColumn"
486+msgstr ""
487+
488+#: ListItems.qml:364
489+msgid "Expandable"
490+msgstr ""
491+
492+#: OptionSelectors.qml:24
493+msgid "Option Selector"
494+msgstr ""
495+
496+#: OptionSelectors.qml:85
497+msgid "Custom container height"
498+msgstr ""
499+
500+#: OptionSelectors.qml:98
501+msgid "No initial selection, scrollable."
502+msgstr ""
503+
504+#: Pickers.qml:29
505+msgid "Linear"
506+msgstr ""
507+
508+#: Pickers.qml:48
509+msgid "Circular"
510+msgstr ""
511+
512+#: Pickers.qml:73 ProgressBars.qml:48
513+msgid "Infinite"
514+msgstr ""
515+
516+#: Pickers.qml:110
517+msgid "Clock"
518+msgstr ""
519+
520+#: Pickers.qml:147
521+msgid "Overlay"
522+msgstr ""
523+
524+#: Popover.qml:41
525+msgid "Flickable"
526+msgstr ""
527+
528+#: Popover.qml:77
529+msgid "Action #1"
530+msgstr ""
531+
532+#: Popover.qml:81
533+msgid "Action #2"
534+msgstr ""
535+
536+#: Popover.qml:85
537+msgid "Action #3"
538+msgstr ""
539+
540+#: Popover.qml:89
541+msgid "Action #4"
542+msgstr ""
543+
544+#: Popover.qml:93
545+msgid "Action #5"
546+msgstr ""
547+
548+#: ProgressBars.qml:24
549+msgid "Progress Bar"
550+msgstr ""
551+
552+#: ProgressBars.qml:58
553+msgid "No label"
554+msgstr ""
555+
556+#: ProgressBars.qml:80
557+msgid "Activity Indicator"
558+msgstr ""
559+
560+#: Sheet.qml:28
561+msgid "The visual style of the Sheet is early work and thus clunky looking."
562+msgstr ""
563+
564+#: Sheet.qml:53 Sheet.qml:86
565+msgid "Title"
566+msgstr ""
567+
568+#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68
569+#, qt-format
570+msgid "Actual value: %1"
571+msgstr ""
572+
573+#: Sliders.qml:42
574+msgid "Live Update"
575+msgstr ""
576+
577+#: Sliders.qml:57
578+msgid "Range"
579+msgstr ""
580+
581+#: Styles.qml:27
582+msgid "Switch between old and new style header"
583+msgstr ""
584+
585+#: Styles.qml:40
586+msgid "Switch between themes"
587+msgstr ""
588+
589+#: TextInputs.qml:49
590+msgid "Type me in..."
591+msgstr ""
592+
593+#: TextInputs.qml:55
594+msgid "Password"
595+msgstr ""
596+
597+#: TextInputs.qml:66
598+msgid "Numbers"
599+msgstr ""
600+
601+#: TextInputs.qml:77
602+msgid "Read-only"
603+msgstr ""
604+
605+#: TextInputs.qml:81
606+msgid "Nobody type here"
607+msgstr ""
608+
609+#: TextInputs.qml:92
610+msgid "No interaction allowed"
611+msgstr ""
612+
613+#: TextInputs.qml:104
614+msgid "Default"
615+msgstr ""
616+
617+#: TextInputs.qml:126
618+msgid "Rich Text"
619+msgstr ""
620+
621+#: Toggles.qml:28 Toggles.qml:66
622 msgid "Unchecked"
623-msgstr "Uitgevinkt"
624-
625-msgid "Unknown"
626-msgstr "Onbekend"
627-
628-msgid "Value"
629-msgstr "Waarde"
630-
631-msgid "Value selector"
632-msgstr "Waarde keuzeschakelaar"
633-
634-msgid "Value selectors"
635-msgstr "Waarde keuzeschakelaars"
636-
637-msgid "Parsley"
638-msgstr "Peterselie"
639-
640-msgid "fruit"
641-msgstr "fruit"
642-
643-msgid "Orange"
644-msgstr "Sinaasappel"
645-
646-msgid "Apple"
647-msgstr "Appel"
648-
649-msgid "Tomato"
650-msgstr "Tomaat"
651-
652-msgid "veg"
653-msgstr "Groente"
654-
655-msgid "Carrot"
656-msgstr "Wortel"
657-
658-msgid "Potato"
659-msgstr "Aardappel"
660-
661-msgid "Hide"
662-msgstr "Verbergen"
663-
664-#, fuzzy
665-msgid "'value' is %1"
666-msgstr "waarde is %1"
667-
668-#, fuzzy
669-#~ msgid "Value slector"
670-#~ msgstr "Waarde keuzeschakelaars"
671+msgstr ""
672+
673+#: Toggles.qml:36 Toggles.qml:74
674+msgid "Checked"
675+msgstr ""
676+
677+#: Toolbar.qml:30
678+msgid "Share"
679+msgstr ""
680+
681+#: Toolbar.qml:46
682+msgid "See below"
683+msgstr ""
684+
685+#: UbuntuShape.qml:49
686+msgid "Image"
687+msgstr ""
688+
689+#: UbuntuShape.qml:64
690+msgid "Radius"
691+msgstr ""
692+
693+#: UbuntuShape.qml:97
694+msgid "Sizes"
695+msgstr ""
696
697=== added file 'examples/ubuntu-ui-toolkit-gallery/po/pt_BR.po'
698--- examples/ubuntu-ui-toolkit-gallery/po/pt_BR.po 1970-01-01 00:00:00 +0000
699+++ examples/ubuntu-ui-toolkit-gallery/po/pt_BR.po 2015-07-21 06:38:21 +0000
700@@ -0,0 +1,412 @@
701+# Brazilian Portuguese translation for ubuntu-ui-toolkit
702+# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
703+# This file is distributed under the same license as the ubuntu-ui-toolkit package.
704+# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
705+#
706+msgid ""
707+msgstr ""
708+"Project-Id-Version: ubuntu-ui-toolkit\n"
709+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
710+"POT-Creation-Date: 2014-11-11 11:21+0100\n"
711+"PO-Revision-Date: 2015-07-14 17:02+0000\n"
712+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
713+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
714+"MIME-Version: 1.0\n"
715+"Content-Type: text/plain; charset=UTF-8\n"
716+"Content-Transfer-Encoding: 8bit\n"
717+"X-Launchpad-Export-Date: 2015-07-16 05:37+0000\n"
718+"X-Generator: Launchpad (build 17628)\n"
719+
720+#: Animations.qml:24
721+msgid "NumberAnimation"
722+msgstr ""
723+
724+#: Animations.qml:28 Buttons.qml:28 Dialog.qml:29 ListItems.qml:25
725+#: ProgressBars.qml:28 ProgressBars.qml:84 Sheet.qml:40 Sheet.qml:73
726+#: Sliders.qml:28 TextInputs.qml:45
727+msgid "Standard"
728+msgstr ""
729+
730+#: Animations.qml:58
731+msgid "Standard Durations"
732+msgstr ""
733+
734+#: Animations.qml:62
735+msgid "Snap"
736+msgstr ""
737+
738+#: Animations.qml:98
739+msgid "Fast"
740+msgstr ""
741+
742+#: Animations.qml:134
743+msgid "Slow"
744+msgstr ""
745+
746+#: Animations.qml:159
747+msgid "Sleepy"
748+msgstr ""
749+
750+#: Buttons.qml:32 Buttons.qml:41 Buttons.qml:51 Buttons.qml:71 Buttons.qml:79
751+#: Buttons.qml:89
752+msgid "Call"
753+msgstr ""
754+
755+#: Buttons.qml:37
756+msgid "Stroke"
757+msgstr ""
758+
759+#: Buttons.qml:47 UbuntuShape.qml:28
760+msgid "Color"
761+msgstr ""
762+
763+#: Buttons.qml:57 Buttons.qml:114 ListItems.qml:43
764+msgid "Icon"
765+msgstr ""
766+
767+#: Buttons.qml:66 Buttons.qml:128
768+msgid "Icon+Text"
769+msgstr ""
770+
771+#: Buttons.qml:85 TextInputs.qml:88 Toggles.qml:45 Toggles.qml:83
772+msgid "Disabled"
773+msgstr ""
774+
775+#: Buttons.qml:99 OptionSelectors.qml:34
776+msgid "Collapsed"
777+msgstr ""
778+
779+#: Buttons.qml:142 ListItems.qml:120 OptionSelectors.qml:43
780+msgid "Expanded"
781+msgstr ""
782+
783+#: Colors.qml:30
784+msgid "Orange"
785+msgstr ""
786+
787+#: Colors.qml:36
788+msgid "Light grey"
789+msgstr ""
790+
791+#: Colors.qml:42
792+msgid "Dark grey"
793+msgstr ""
794+
795+#: Colors.qml:48
796+msgid "Red"
797+msgstr ""
798+
799+#: Colors.qml:54
800+msgid "Green"
801+msgstr ""
802+
803+#: Colors.qml:60
804+msgid "Blue"
805+msgstr ""
806+
807+#: Colors.qml:66
808+msgid "Purple"
809+msgstr ""
810+
811+#: Dialog.qml:32 Popover.qml:45 Sheet.qml:43 Sheet.qml:76
812+msgid "Open"
813+msgstr ""
814+
815+#: Icons.qml:30
816+msgid "Scaling"
817+msgstr ""
818+
819+#: Icons.qml:55
820+msgid "Colorization"
821+msgstr ""
822+
823+#: Icons.qml:80
824+msgid "Theme"
825+msgstr ""
826+
827+#: ListItems.qml:28 ListItems.qml:36 ListItems.qml:46 ListItems.qml:60
828+#: ListItems.qml:66 ListItems.qml:76 ListItems.qml:85 ListItems.qml:94
829+#: ListItems.qml:160 ListItems.qml:173 ListItems.qml:193
830+msgid "Label"
831+msgstr ""
832+
833+#: ListItems.qml:33
834+msgid "Subtitled"
835+msgstr ""
836+
837+#: ListItems.qml:37
838+msgid "Secondary label"
839+msgstr ""
840+
841+#: ListItems.qml:52
842+msgid "ThinDivider"
843+msgstr ""
844+
845+#: ListItems.qml:73
846+msgid "Progression"
847+msgstr ""
848+
849+#: ListItems.qml:82
850+msgid "Single value"
851+msgstr ""
852+
853+#: ListItems.qml:86
854+msgid "Value"
855+msgstr ""
856+
857+#: ListItems.qml:91
858+msgid "Multi value"
859+msgstr ""
860+
861+#: ListItems.qml:95 ListItems.qml:113 ListItems.qml:122 ListItems.qml:132
862+#: ListItems.qml:161 ListItems.qml:176 OptionSelectors.qml:35
863+#: OptionSelectors.qml:45 OptionSelectors.qml:56 OptionSelectors.qml:86
864+#: OptionSelectors.qml:101
865+msgid "Value 1"
866+msgstr ""
867+
868+#: ListItems.qml:96 ListItems.qml:114 ListItems.qml:123 ListItems.qml:133
869+#: ListItems.qml:162 ListItems.qml:177 OptionSelectors.qml:36
870+#: OptionSelectors.qml:46 OptionSelectors.qml:57 OptionSelectors.qml:87
871+#: OptionSelectors.qml:102
872+msgid "Value 2"
873+msgstr ""
874+
875+#: ListItems.qml:97 ListItems.qml:115 ListItems.qml:124 ListItems.qml:134
876+#: ListItems.qml:163 ListItems.qml:178 OptionSelectors.qml:37
877+#: OptionSelectors.qml:47 OptionSelectors.qml:58 OptionSelectors.qml:88
878+#: OptionSelectors.qml:103
879+msgid "Value 3"
880+msgstr ""
881+
882+#: ListItems.qml:98 ListItems.qml:116 ListItems.qml:125 ListItems.qml:135
883+#: ListItems.qml:164 ListItems.qml:179 OptionSelectors.qml:38
884+#: OptionSelectors.qml:48 OptionSelectors.qml:59 OptionSelectors.qml:89
885+#: OptionSelectors.qml:104
886+msgid "Value 4"
887+msgstr ""
888+
889+#: ListItems.qml:103
890+msgid "Item selector"
891+msgstr ""
892+
893+#: ListItems.qml:112 TextInputs.qml:114
894+msgid "Expanding"
895+msgstr ""
896+
897+#: ListItems.qml:129 OptionSelectors.qml:53
898+msgid "Multiple Selection"
899+msgstr ""
900+
901+#: ListItems.qml:139 OptionSelectors.qml:64
902+msgid "Custom Model"
903+msgstr ""
904+
905+#: ListItems.qml:165 ListItems.qml:180 OptionSelectors.qml:90
906+#: OptionSelectors.qml:105
907+msgid "Value 5"
908+msgstr ""
909+
910+#: ListItems.qml:166 ListItems.qml:181 OptionSelectors.qml:91
911+#: OptionSelectors.qml:106
912+msgid "Value 6"
913+msgstr ""
914+
915+#: ListItems.qml:167 ListItems.qml:182 OptionSelectors.qml:92
916+#: OptionSelectors.qml:107
917+msgid "Value 7"
918+msgstr ""
919+
920+#: ListItems.qml:168 ListItems.qml:183 OptionSelectors.qml:93
921+#: OptionSelectors.qml:108
922+msgid "Value 8"
923+msgstr ""
924+
925+#: ListItems.qml:190
926+msgid "Control"
927+msgstr ""
928+
929+#: ListItems.qml:202
930+msgid "Removable"
931+msgstr ""
932+
933+#: ListItems.qml:205
934+msgid "Slide to remove"
935+msgstr ""
936+
937+#: ListItems.qml:215
938+msgid "Reset"
939+msgstr ""
940+
941+#: ListItems.qml:226
942+msgid "Grouped list"
943+msgstr ""
944+
945+#: ListItems.qml:261
946+msgid "UbuntuListView"
947+msgstr ""
948+
949+#: ListItems.qml:321
950+msgid "ExpandablesColumn"
951+msgstr ""
952+
953+#: ListItems.qml:364
954+msgid "Expandable"
955+msgstr ""
956+
957+#: OptionSelectors.qml:24
958+msgid "Option Selector"
959+msgstr ""
960+
961+#: OptionSelectors.qml:85
962+msgid "Custom container height"
963+msgstr ""
964+
965+#: OptionSelectors.qml:98
966+msgid "No initial selection, scrollable."
967+msgstr ""
968+
969+#: Pickers.qml:29
970+msgid "Linear"
971+msgstr ""
972+
973+#: Pickers.qml:48
974+msgid "Circular"
975+msgstr ""
976+
977+#: Pickers.qml:73 ProgressBars.qml:48
978+msgid "Infinite"
979+msgstr ""
980+
981+#: Pickers.qml:110
982+msgid "Clock"
983+msgstr ""
984+
985+#: Pickers.qml:147
986+msgid "Overlay"
987+msgstr ""
988+
989+#: Popover.qml:41
990+msgid "Flickable"
991+msgstr ""
992+
993+#: Popover.qml:77
994+msgid "Action #1"
995+msgstr ""
996+
997+#: Popover.qml:81
998+msgid "Action #2"
999+msgstr ""
1000+
1001+#: Popover.qml:85
1002+msgid "Action #3"
1003+msgstr ""
1004+
1005+#: Popover.qml:89
1006+msgid "Action #4"
1007+msgstr ""
1008+
1009+#: Popover.qml:93
1010+msgid "Action #5"
1011+msgstr ""
1012+
1013+#: ProgressBars.qml:24
1014+msgid "Progress Bar"
1015+msgstr ""
1016+
1017+#: ProgressBars.qml:58
1018+msgid "No label"
1019+msgstr ""
1020+
1021+#: ProgressBars.qml:80
1022+msgid "Activity Indicator"
1023+msgstr ""
1024+
1025+#: Sheet.qml:28
1026+msgid "The visual style of the Sheet is early work and thus clunky looking."
1027+msgstr ""
1028+
1029+#: Sheet.qml:53 Sheet.qml:86
1030+msgid "Title"
1031+msgstr ""
1032+
1033+#: Sliders.qml:36 Sliders.qml:51 Sliders.qml:68
1034+#, qt-format
1035+msgid "Actual value: %1"
1036+msgstr ""
1037+
1038+#: Sliders.qml:42
1039+msgid "Live Update"
1040+msgstr ""
1041+
1042+#: Sliders.qml:57
1043+msgid "Range"
1044+msgstr ""
1045+
1046+#: Styles.qml:27
1047+msgid "Switch between old and new style header"
1048+msgstr ""
1049+
1050+#: Styles.qml:40
1051+msgid "Switch between themes"
1052+msgstr ""
1053+
1054+#: TextInputs.qml:49
1055+msgid "Type me in..."
1056+msgstr ""
1057+
1058+#: TextInputs.qml:55
1059+msgid "Password"
1060+msgstr ""
1061+
1062+#: TextInputs.qml:66
1063+msgid "Numbers"
1064+msgstr ""
1065+
1066+#: TextInputs.qml:77
1067+msgid "Read-only"
1068+msgstr ""
1069+
1070+#: TextInputs.qml:81
1071+msgid "Nobody type here"
1072+msgstr ""
1073+
1074+#: TextInputs.qml:92
1075+msgid "No interaction allowed"
1076+msgstr ""
1077+
1078+#: TextInputs.qml:104
1079+msgid "Default"
1080+msgstr ""
1081+
1082+#: TextInputs.qml:126
1083+msgid "Rich Text"
1084+msgstr ""
1085+
1086+#: Toggles.qml:28 Toggles.qml:66
1087+msgid "Unchecked"
1088+msgstr ""
1089+
1090+#: Toggles.qml:36 Toggles.qml:74
1091+msgid "Checked"
1092+msgstr ""
1093+
1094+#: Toolbar.qml:30
1095+msgid "Share"
1096+msgstr ""
1097+
1098+#: Toolbar.qml:46
1099+msgid "See below"
1100+msgstr ""
1101+
1102+#: UbuntuShape.qml:49
1103+msgid "Image"
1104+msgstr ""
1105+
1106+#: UbuntuShape.qml:64
1107+msgid "Radius"
1108+msgstr ""
1109+
1110+#: UbuntuShape.qml:97
1111+msgid "Sizes"
1112+msgstr ""
1113
1114=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py'
1115--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2015-06-19 14:48:30 +0000
1116+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2015-07-21 06:38:21 +0000
1117@@ -29,6 +29,7 @@
1118 platform
1119 )
1120 from autopilot.introspection import dbus
1121+import ubuntuuitoolkit
1122
1123 logger = logging.getLogger(__name__)
1124
1125@@ -243,6 +244,7 @@
1126 parent = self.get_parent()
1127 root = self.get_root_instance()
1128 while parent.id != root.id:
1129+ parent = ubuntuuitoolkit.QQuickFlickable.from_proxy_object(parent)
1130 if parent.is_flickable():
1131 return parent
1132 parent = parent.get_parent()
1133@@ -264,4 +266,7 @@
1134 if top_container is None:
1135 raise ToolkitException('Could not find the top-most container.')
1136 else:
1137- return top_container
1138+ from ubuntuuitoolkit._custom_proxy_objects._mainview import (
1139+ MainView
1140+ )
1141+ return MainView.from_proxy_object(top_container)
1142
1143=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
1144--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2015-06-23 13:22:10 +0000
1145+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2015-07-21 06:38:21 +0000
1146@@ -20,8 +20,10 @@
1147 from autopilot.introspection import dbus
1148
1149 from ubuntuuitoolkit._custom_proxy_objects import (
1150+ _actionbar,
1151 _common,
1152- _tabbar
1153+ _sections,
1154+ _tabbar,
1155 )
1156
1157
1158@@ -85,7 +87,7 @@
1159 try:
1160 # Ubuntu.Components >=1.3
1161 sections = self.select_single(
1162- 'Sections', objectName='headerSectionsItem')
1163+ _sections.Sections, objectName='headerSectionsItem')
1164 sections.click_section_button(index)
1165 except dbus.StateNotFoundError:
1166 # Ubuntu.Components < 1.3, has no headerSectionsItem.
1167@@ -245,7 +247,7 @@
1168 try:
1169 # for Ubuntu.Components 1.3
1170 actionbar = self.select_single(
1171- 'ActionBar', objectName='headerActionBar')
1172+ _actionbar.ActionBar, objectName='headerActionBar')
1173 actionbar.click_action_button(action_object_name)
1174 except dbus.StateNotFoundError:
1175 # for Ubuntu.Components < 1.3
1176
1177=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py'
1178--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2015-04-14 21:02:06 +0000
1179+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2015-07-21 06:38:21 +0000
1180@@ -23,6 +23,7 @@
1181 from autopilot import introspection
1182
1183 from ubuntuuitoolkit._custom_proxy_objects import (
1184+ AppHeader,
1185 _common,
1186 popups,
1187 _tabs,
1188@@ -59,7 +60,7 @@
1189 def get_header(self):
1190 """Return the AppHeader custom proxy object of the MainView."""
1191 try:
1192- return self.select_single(objectName='MainView_Header')
1193+ return self.select_single(AppHeader, objectName='MainView_Header')
1194 except dbus.StateNotFoundError:
1195 raise _common.ToolkitException('The main view has no header.')
1196
1197
1198=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py'
1199--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2014-06-04 07:54:35 +0000
1200+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_ubuntulistview.py 2015-07-21 06:38:21 +0000
1201@@ -14,18 +14,21 @@
1202 # You should have received a copy of the GNU Lesser General Public License
1203 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1204
1205-from ubuntuuitoolkit._custom_proxy_objects import _qquicklistview
1206+from ubuntuuitoolkit._custom_proxy_objects import (
1207+ _flickable,
1208+ _qquicklistview
1209+)
1210
1211
1212 class UbuntuListView11(_qquicklistview.QQuickListView):
1213 """Autopilot helper for the UbuntuListView 1.1."""
1214
1215 def pull_to_refresh_enabled(self):
1216- refresh = self.select_single('PullToRefresh')
1217+ refresh = self.select_single(_flickable.PullToRefresh)
1218 return refresh.enabled
1219
1220 def manual_refresh_wait(self):
1221- refresh = self.select_single('PullToRefresh')
1222+ refresh = self.select_single(_flickable.PullToRefresh)
1223 if refresh.enabled:
1224 self.pull_to_refresh()
1225 refresh.wait_for_refresh()
1226@@ -33,14 +36,14 @@
1227 return False
1228
1229 def manual_refresh_nowait(self):
1230- refresh = self.select_single('PullToRefresh')
1231+ refresh = self.select_single(_flickable.PullToRefresh)
1232 if refresh.enabled:
1233 self.pull_to_refresh()
1234 return True
1235 return False
1236
1237 def wait_refresh_completed(self):
1238- refresh = self.select_single('PullToRefresh')
1239+ refresh = self.select_single(_flickable.PullToRefresh)
1240 if refresh.enabled:
1241 refresh.wait_for_refresh()
1242 return True
1243
1244=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
1245--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2015-04-14 21:02:06 +0000
1246+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2015-07-21 06:38:21 +0000
1247@@ -25,6 +25,7 @@
1248
1249 import ubuntuuitoolkit
1250 from ubuntuuitoolkit import base, fixture_setup
1251+from ubuntuuitoolkit._custom_proxy_objects._mainview import MainView
1252
1253
1254 _DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]
1255@@ -108,7 +109,8 @@
1256 application_name, _ = os.path.splitext(desktop_file_name)
1257 self.app = self.launch_upstart_application(
1258 application_name,
1259- emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase)
1260+ proxy_class=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
1261+ )
1262
1263 def use_local_modules(self, local_modules_path):
1264 env_vars = [
1265@@ -125,8 +127,9 @@
1266 class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):
1267 """Base test case for self tests that define the QML on an string."""
1268
1269- def setUp(self):
1270+ def setUp(self, mainview_class=MainView):
1271 super().setUp()
1272+ self.mainview_class = mainview_class
1273 self.assertThat(
1274 self.main_view.visible, Eventually(Equals(True)))
1275
1276@@ -140,7 +143,9 @@
1277 QML code used for testing must define the objectName
1278 of the MainView to be 'mainView'.
1279 """
1280- return self.app.select_single(objectName='mainView')
1281+ return self.mainview_class.from_proxy_object(
1282+ self.app.select_single(objectName='mainView')
1283+ )
1284
1285
1286 class FlickDirection:
1287@@ -155,8 +160,10 @@
1288 test_qml_file_path = '/path/to/file.qml'
1289 desktop_file_path = None
1290
1291- def setUp(self):
1292+ def setUp(self, mainview_class=MainView):
1293 super().setUp()
1294+ # Allow a test case to use a different CPO
1295+ self.mainview_class = mainview_class
1296 self.pointing_device = Pointer(self.input_device_class.create())
1297 self.launch_application()
1298
1299@@ -173,7 +180,6 @@
1300 ]
1301 self.app = self.launch_test_application(
1302 *self.get_command_line(command_line),
1303- emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase,
1304 app_type='qt')
1305
1306 self.assertThat(
1307@@ -195,7 +201,9 @@
1308 QML code used for testing must define the objectName
1309 of the MainView to be 'mainView'.
1310 """
1311- return self.app.select_single(objectName='mainView')
1312+ return self.mainview_class.from_proxy_object(
1313+ self.app.select_single(objectName='mainView')
1314+ )
1315
1316 def getOrientationHelper(self):
1317 orientationHelper = self.main_view.select_many(
1318
1319=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py'
1320--- tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 2015-04-14 21:02:06 +0000
1321+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 2015-07-21 06:38:21 +0000
1322@@ -18,7 +18,10 @@
1323
1324 import os
1325
1326-from ubuntuuitoolkit import tests
1327+from ubuntuuitoolkit import (
1328+ QQuickFlickable,
1329+ tests
1330+)
1331
1332
1333 class DialogScrollTestCase(tests.QMLFileAppTestCase):
1334@@ -40,7 +43,7 @@
1335 button = self.main_view.select_single(objectName='button_huge')
1336 self.pointing_device.click_object(button)
1337 dialog = self.main_view.select_single(objectName='dialog_huge')
1338- flickable = dialog.select_single('QQuickFlickable')
1339+ flickable = dialog.select_single(QQuickFlickable)
1340 buttlet = dialog.select_single(objectName='buttlet49')
1341 # We can scroll
1342 self.assertFalse(flickable.atYEnd)
1343
1344=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py'
1345--- tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-06-18 18:56:55 +0000
1346+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-07-21 06:38:21 +0000
1347@@ -23,7 +23,11 @@
1348 from autopilot.input._common import get_center_point
1349 from autopilot import platform
1350
1351-from ubuntuuitoolkit import tests
1352+from ubuntuuitoolkit import (
1353+ TextArea,
1354+ TextField,
1355+ tests
1356+)
1357
1358
1359 class CaretTextInputTestCase(tests.QMLFileAppTestCase):
1360@@ -42,16 +46,20 @@
1361 scenarios = [
1362 ('textfield',
1363 dict(test_qml_file_path=textfield_qml_file_path,
1364- objectName='textfield')),
1365+ objectName='textfield',
1366+ cpo_class=TextField)),
1367 ('textarea',
1368 dict(test_qml_file_path=textarea_qml_file_path,
1369- objectName='textarea')),
1370+ objectName='textarea',
1371+ cpo_class=TextArea)),
1372 ('customfield',
1373 dict(test_qml_file_path=customfield_qml_file_path,
1374- objectName='textfield')),
1375+ objectName='textfield',
1376+ cpo_class=TextField)),
1377 ('header',
1378 dict(test_qml_file_path=header_qml_file_path,
1379- objectName='textfield')),
1380+ objectName='textfield',
1381+ cpo_class=TextField)),
1382 ]
1383
1384 def get_command_line(self, command_line):
1385@@ -60,8 +68,10 @@
1386
1387 def setUp(self):
1388 super().setUp()
1389- self.textfield = self.main_view.select_single(
1390- objectName=self.objectName)
1391+ # Create either a TextField or TextArea.
1392+ self.textfield = self.cpo_class.from_proxy_object(
1393+ self.main_view.select_single(objectName=self.objectName)
1394+ )
1395 self.assertFalse(self.textfield.focus)
1396
1397 def select_cursor(self, positionProperty):
1398@@ -122,16 +132,20 @@
1399 scenarios = [
1400 ('textfield',
1401 dict(test_qml_file_path=textfield_qml_file_path,
1402- objectName='textfield')),
1403+ objectName='textfield',
1404+ cpo_class=TextField)),
1405 ('textarea',
1406 dict(test_qml_file_path=textarea_qml_file_path,
1407- objectName='textarea')),
1408+ objectName='textarea',
1409+ cpo_class=TextField)),
1410 ('customfield',
1411 dict(test_qml_file_path=customfield_qml_file_path,
1412- objectName='textfield')),
1413+ objectName='textfield',
1414+ cpo_class=TextField)),
1415 ('header',
1416 dict(test_qml_file_path=header_qml_file_path,
1417- objectName='textfield')),
1418+ objectName='textfield',
1419+ cpo_class=TextField)),
1420 ]
1421
1422 def get_command_line(self, command_line):
1423@@ -139,9 +153,12 @@
1424 return command_line
1425
1426 def setUp(self):
1427+
1428 super().setUp()
1429- self.textfield = self.main_view.select_single(
1430- objectName=self.objectName)
1431+ # textfield will either be a textfield or textarea.
1432+ self.textfield = self.cpo_class.from_proxy_object(
1433+ self.main_view.select_single(objectName=self.objectName)
1434+ )
1435 self.assertFalse(self.textfield.focus)
1436
1437 def assert_buttons(self, texts):
1438
1439=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py'
1440--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py 2015-05-14 20:37:05 +0000
1441+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_actionbar.py 2015-07-21 06:38:21 +0000
1442@@ -29,7 +29,7 @@
1443 def setUp(self):
1444 super().setUp()
1445 self.actionbar = self.app.select_single(
1446- 'ActionBar', objectName='ActionBar')
1447+ ubuntuuitoolkit.ActionBar, objectName='ActionBar')
1448 self.label = self.app.select_single(
1449 'Label', objectName='Label')
1450 self.assertEqual(self.label.text, 'No action triggered.')
1451
1452=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py'
1453--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py 2015-04-14 21:02:06 +0000
1454+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_dialog.py 2015-07-21 06:38:21 +0000
1455@@ -16,7 +16,10 @@
1456
1457 import os
1458
1459-from ubuntuuitoolkit import tests
1460+from ubuntuuitoolkit import (
1461+ TextArea,
1462+ tests
1463+)
1464
1465
1466 class DialogTestCase(tests.QMLFileAppTestCase):
1467@@ -31,7 +34,7 @@
1468 self.pointing_device.click_object(open_button)
1469 dialog = self.main_view.wait_select_single('Dialog',
1470 title="Dialog")
1471- text_area = dialog.wait_select_single('TextArea',
1472+ text_area = dialog.wait_select_single(TextArea,
1473 objectName='textfield_standard')
1474 text_area.write('test')
1475 self.assertEqual(text_area.text, 'test')
1476
1477=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
1478--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2015-04-17 15:21:47 +0000
1479+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2015-07-21 06:38:21 +0000
1480@@ -79,16 +79,33 @@
1481 }
1482 """)
1483
1484+ class Label(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
1485+ pass
1486+
1487 scenarios = [
1488- ('main view', dict(object_name='mainView', is_flickable=False)),
1489- ('flickable', dict(object_name='flickable', is_flickable=True)),
1490- ('list view', dict(object_name='listView', is_flickable=True)),
1491- ('label', dict(object_name='label', is_flickable=False))
1492+ ('main view', dict(
1493+ cpo_class=ubuntuuitoolkit.MainView,
1494+ object_name='mainView',
1495+ is_flickable=False)),
1496+ ('flickable', dict(
1497+ cpo_class=ubuntuuitoolkit.QQuickFlickable,
1498+ object_name='flickable',
1499+ is_flickable=True)),
1500+ ('list view', dict(
1501+ cpo_class=ubuntuuitoolkit.QQuickListView,
1502+ object_name='listView',
1503+ is_flickable=True)),
1504+ ('label', dict(
1505+ cpo_class=Label,
1506+ object_name='label',
1507+ is_flickable=False))
1508 ]
1509
1510 def test_is_flickable(self):
1511 """Test that is_flickable identifies the elements correctly."""
1512- element = self.app.select_single(objectName=self.object_name)
1513+ element = self.app.select_single(
1514+ self.cpo_class,
1515+ objectName=self.object_name)
1516 self.assertEqual(element.is_flickable(), self.is_flickable)
1517
1518
1519@@ -143,6 +160,9 @@
1520 }
1521 """)
1522
1523+ class Button(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
1524+ pass
1525+
1526 def setUp(self):
1527 super().setUp()
1528 self.flickable = self.main_view.select_single(
1529@@ -154,7 +174,9 @@
1530 def test_swipe_into_view_bottom_element(self):
1531 self.main_view.close_toolbar()
1532
1533- button = self.main_view.select_single(objectName='bottomButton')
1534+ button = self.main_view.select_single(
1535+ self.Button,
1536+ objectName='bottomButton')
1537 button.swipe_into_view()
1538
1539 self.pointing_device.click_object(button)
1540@@ -162,10 +184,14 @@
1541
1542 def test_swipe_into_view_top_element(self):
1543 self.main_view.close_toolbar()
1544- bottomButton = self.main_view.select_single(objectName='bottomButton')
1545+ bottomButton = self.main_view.select_single(
1546+ self.Button,
1547+ objectName='bottomButton')
1548 bottomButton.swipe_into_view()
1549
1550- topButton = self.main_view.select_single(objectName='topButton')
1551+ topButton = self.main_view.select_single(
1552+ self.Button,
1553+ objectName='topButton')
1554 topButton.swipe_into_view()
1555
1556 self.pointing_device.click_object(topButton)
1557
1558=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py'
1559--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2015-04-14 21:02:06 +0000
1560+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2015-07-21 06:38:21 +0000
1561@@ -22,7 +22,12 @@
1562 from autopilot import introspection
1563
1564 import ubuntuuitoolkit
1565-from ubuntuuitoolkit import tests
1566+from ubuntuuitoolkit import (
1567+ CheckBox,
1568+ MainView,
1569+ UbuntuUIToolkitCustomProxyObjectBase as ProxyBase,
1570+ tests
1571+)
1572
1573
1574 class HideShowTestCase(tests.QMLFileAppTestCase):
1575@@ -72,8 +77,12 @@
1576 def setUp(self):
1577 super().setUp()
1578 self.header = self.main_view.get_header()
1579- self.label = self.app.select_single(
1580- 'Label', objectName='clicked_label')
1581+ self.label = ProxyBase.from_proxy_object(
1582+ self.app.select_single(
1583+ 'Label',
1584+ objectName='clicked_label'
1585+ )
1586+ )
1587 self.assertEqual(self.label.text, 'No button clicked.')
1588
1589 def test_header_custom_proxy_object(self):
1590@@ -105,7 +114,9 @@
1591 self.assertEqual(self.label.text, 'Cancel button clicked.')
1592
1593 def test_click_header_action_button_with_hidden_header(self):
1594- bottom_label = self.main_view.select_single(objectName='end_label')
1595+ bottom_label = ProxyBase.from_proxy_object(
1596+ self.main_view.select_single(objectName='end_label')
1597+ )
1598 bottom_label.swipe_into_view()
1599 self.assertFalse(self.header._is_visible())
1600 self.header.click_action_button('action0')
1601@@ -146,7 +157,7 @@
1602
1603 def test_select_sections_with_sections_disabled(self):
1604 sectionsEnabledSwitch = self.app.select_single(
1605- 'CheckBox', objectName='sections_enabled_switch')
1606+ CheckBox, objectName='sections_enabled_switch')
1607 sectionsEnabledSwitch.uncheck()
1608 for index in [1, 0, 2]:
1609 self.header.switch_to_section_by_index(index)
1610@@ -183,7 +194,7 @@
1611
1612 def test_select_sections_with_sections_disabled(self):
1613 sectionsEnabledSwitch = self.app.select_single(
1614- 'CheckBox', objectName='sections_enabled_switch')
1615+ CheckBox, objectName='sections_enabled_switch')
1616 sectionsEnabledSwitch.uncheck()
1617 error = self.assertRaises(
1618 ubuntuuitoolkit.ToolkitException,
1619@@ -212,7 +223,12 @@
1620
1621 @property
1622 def main_view(self):
1623- return self.app.select_single(objectName='customMainView')
1624+ # This change will allow the test to pass, but I don't feel this test
1625+ # is really relevant as it is really testing the from_proxy_method to
1626+ # create a MainView object.
1627+ return MainView.from_proxy_object(
1628+ self.app.select_single(objectName='customMainView')
1629+ )
1630
1631 def test_get_header_from_custom_main_view(self):
1632 """Test that we can get the header from a custom main view.
1633
1634=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py'
1635--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2015-04-14 21:02:06 +0000
1636+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2015-07-21 06:38:21 +0000
1637@@ -17,7 +17,9 @@
1638 import os
1639
1640 import ubuntuuitoolkit
1641-from ubuntuuitoolkit import tests
1642+from ubuntuuitoolkit import (
1643+ tests
1644+)
1645
1646
1647 class ListItemTestCase(tests.QMLFileAppTestCase):
1648@@ -27,11 +29,12 @@
1649 dir_path, 'test_listitem.ListItemTestCase.qml')
1650
1651 def setUp(self):
1652+
1653 super().setUp()
1654 self.list_view = self.main_view.select_single(
1655 ubuntuuitoolkit.QQuickListView, objectName='test_view')
1656 self.test_listitem = self.main_view.select_single(
1657- 'UCListItem', objectName='listitem0')
1658+ ubuntuuitoolkit.UCListItem, objectName='listitem0')
1659 self.test_page = self.main_view.select_single(
1660 objectName='test_page')
1661 self.assertEqual(self.test_page.title, 'No action triggered')
1662@@ -93,6 +96,6 @@
1663 self.assertTrue(self.test_listitem.selected)
1664 # select an other one
1665 listItem3 = self.main_view.select_single(
1666- 'UCListItem', objectName='listitem3')
1667+ ubuntuuitoolkit.UCListItem, objectName='listitem3')
1668 listItem3.toggle_selected()
1669 self.assertTrue(listItem3.selected)
1670
1671=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py'
1672--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-04-14 21:02:06 +0000
1673+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_main_view.py 2015-07-21 06:38:21 +0000
1674@@ -76,6 +76,8 @@
1675
1676
1677 class MainView12TestCase(tests.QMLStringAppTestCase):
1678+ # veebers: Note some of these tests might be unneeded due to how the CPOs
1679+ # work now.
1680
1681 test_qml = ("""
1682 import QtQuick 2.3
1683
1684=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py'
1685--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2015-04-14 21:02:06 +0000
1686+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_qquicklistview.py 2015-07-21 06:38:21 +0000
1687@@ -23,7 +23,9 @@
1688 from autopilot.introspection import dbus
1689
1690 import ubuntuuitoolkit
1691-from ubuntuuitoolkit import tests
1692+from ubuntuuitoolkit import (
1693+ tests
1694+)
1695
1696
1697 class QQuickListViewTestCase(tests.QMLStringAppTestCase):
1698@@ -204,6 +206,7 @@
1699
1700 def setUp(self):
1701 super().setUp()
1702+
1703 self.list_view = self.main_view.select_single(
1704 ubuntuuitoolkit.QQuickListView, objectName='testListView')
1705 self.label = self.main_view.select_single(
1706
1707=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py'
1708--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py 2015-05-28 15:38:53 +0000
1709+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_sections.py 2015-07-21 06:38:21 +0000
1710@@ -29,7 +29,7 @@
1711 def setUp(self):
1712 super().setUp()
1713 self.sections = self.app.select_single(
1714- 'Sections', objectName='sections')
1715+ ubuntuuitoolkit.Sections, objectName='sections')
1716 self.label = self.app.select_single(
1717 'Label', objectName='label')
1718 self.assertEqual(self.label.text, 'Section 0 is selected.')
1719
1720=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py'
1721--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py 2014-06-04 08:10:17 +0000
1722+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_ubuntulistview.py 2015-07-21 06:38:21 +0000
1723@@ -32,8 +32,12 @@
1724 self.checkPageHeader(element.text)
1725 self.main_view.wait_select_single(
1726 "Template", objectName="ubuntuListViewTemplate")
1727- self.listView = self.main_view.select_single(
1728- ubuntuuitoolkit.UbuntuListView11, objectName="ubuntuListView")
1729+ self.listView = ubuntuuitoolkit.UbuntuListView11.from_proxy_object(
1730+ self.main_view.select_single(
1731+ ubuntuuitoolkit.UbuntuListView11,
1732+ objectName="ubuntuListView"
1733+ )
1734+ )
1735
1736 def test_pull_to_refresh_enabled(self):
1737 self._open_page()

Subscribers

People subscribed via source and target branches