Merge lp:~carla-sella/reminders-app/new-reminders-app-tests into lp:reminders-app
- new-reminders-app-tests
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 88 | ||||||||
Proposed branch: | lp:~carla-sella/reminders-app/new-reminders-app-tests | ||||||||
Merge into: | lp:reminders-app | ||||||||
Diff against target: |
448 lines (+209/-159) 9 files modified
src/app/qml/reminders.qml (+2/-0) src/app/qml/ui/AccountSelectorPage.qml (+2/-0) src/app/qml/ui/NotesPage.qml (+1/-0) tests/autopilot/reminders/main/__init__.py (+0/-1) tests/autopilot/reminders/main/test_main.py (+0/-28) tests/autopilot/reminders_app/__init__.py (+7/-130) tests/autopilot/reminders_app/emulators.py (+45/-0) tests/autopilot/reminders_app/tests/__init__.py (+110/-0) tests/autopilot/reminders_app/tests/test_reminders.py (+42/-0) |
||||||||
To merge this branch: | bzr merge lp:~carla-sella/reminders-app/new-reminders-app-tests | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Ubuntu Notes app developers | Pending | ||
Review via email: mp+201672@code.launchpad.net |
Commit message
Autopilot tests for Reminders app.
Description of the change
Initial autopilot tests for Reminders App.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 26. By Carla Sella <email address hidden>
-
Fixed conflict.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:26
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 27. By Carla Sella <email address hidden>
-
Fixed conflicts.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:27
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 28. By Carla Sella <email address hidden>
-
Fixed pyflakes pep8.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:28
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
The tests fail on jenkins because there is no account configured.
Carla Sella (carla-sella) wrote : | # |
Ok thanks! I was wondering why :P.
Nicholas Skaggs (nskaggs) wrote : | # |
Working with online accounts folks to see how to mock this up properly.
David Planella (dpm) wrote : | # |
The upcoming promoted image should contain the Evernote Sandbox
authentication plugin preinstalled, which should make testing a lot easier.
Then the only thing required for authentication is creating a developer
account at http://
On Thu, Jan 16, 2014 at 4:38 PM, Nicholas Skaggs <
<email address hidden>> wrote:
> Working with online accounts folks to see how to mock this up properly.
> --
>
> https:/
> Your team Ubuntu Reminders app developers is requested to review the
> proposed merge of lp:~carla-sella/reminders-app/new-reminders-app-tests
> into lp:reminders-app.
>
Nicholas Skaggs (nskaggs) wrote : | # |
Explored options to automate a way to create an account for this as part of the test.
Using account console, or mocking some sql entries it's possible to create a new online account. However, doing actual oauth seems to require an interactive session (per mardy and ken). Therefore we need to have this use a fake provider that we can mock authenticate to and get notes, etc (which also solves the test account problem), or add a setup process to follow the steps to add the evernote account to the client.
At this point, I think mocking might easier, and would be preferred. Do we have a way of faking the data we would normally need from the server?
Michael Zanetti (mzanetti) wrote : | # |
> At this point, I think mocking might easier, and would be preferred. Do we
> have a way of faking the data we would normally need from the server?
Sure... mocking this on a qml level is a matter of 15 mins. However, I'm not sure why we're going through the pain of autopilot if we're mocking the integrational part anyways...
Nicholas Skaggs (nskaggs) wrote : | # |
After exploring several avenues around getting oauth to work, I've brought out the sledgehammer approach. In a nutshell, we'll preauth to a session with evernote for the test account. Next, we re-create the necessary db entries, cookies and tokens, etc on the test machine to avoid re-handshaking with evernote. Once authorized, the authorization lasts for one year with evernote. If everything works as expected, you would need to re-authorize to generate a new token and update the tests appropriately before the end of the year in order to ensure they continue to work.
The proof of concept hack works, I've got to try it now on the phone. Still it's not the broad solution I was hoping to achieve.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:29
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:31
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
Carla, where are we at with this? I believe the autopilot bug you ran into has now been fixed and released; can we land this now?
Nicholas Skaggs (nskaggs) wrote : | # |
I talked with Chris about the AP bugs we ran into with this; the launch bug is merged
https:/
This bug is still being worked and should land very soon;
Are we affected by anything else? Are we affected by the second bug linked even? I think we might be good with the fix for autopilot launch.
Carla Sella (carla-sella) wrote : | # |
Nicholas, yes the autopilot bug has been fixed, but unfortunately I uninstalled reminders-app and now I have this bug: https:/
I am unable to run autopilot tests so I was waiting to be able to install remindes-app again.
Nicholas Skaggs (nskaggs) wrote : | # |
Carla, the dependency issue is now resolved :-) For the app not launching, see:
https:/
I've marked this as critical, as it's blocking the test development. Thanks!
Nicholas Skaggs (nskaggs) wrote : | # |
The launching issue has also been resolved, and should be released soon.
Nicholas Skaggs (nskaggs) wrote : | # |
App still fails to launch; https:/
Nicholas Skaggs (nskaggs) wrote : | # |
The bug has been fixed,after upgrading I can launch reminders.. See if you can give this a whirl now :-)
Nicholas Skaggs (nskaggs) wrote : | # |
There's a trick to launching reminders.qml via the command line with qmlscene -- can someone elaborate?
Michael Zanetti (mzanetti) wrote : | # |
> There's a trick to launching reminders.qml via the command line with qmlscene
> -- can someone elaborate?
We don't support qmlscene any more. You need to launch the reminders binary.
Nicholas Skaggs (nskaggs) wrote : | # |
Carla, how's this coming? I would use print_tree and run the test redirecting the output to a file. Then you could have a look at the full object tree if you needed, or use it on a specific object.
Nicholas Skaggs (nskaggs) wrote : | # |
Our lost IRC conversation;
<balloons> letozaf, merge lp:~nskaggs/reminders-app/fix-ap-launch
<balloons> letozaf, so that forces launching via the installed version. It will get you running for now
- 32. By Carla Sella
-
Latest tests to make the tests work.
- 33. By Carla Sella
-
Latest changes to make tests work.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:33
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 34. By Carla Sella
-
Pushing changes for Ballons.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:34
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
Carla, we've landed the base of this work in https:/
This branch will also depend on https:/
Nicholas Skaggs (nskaggs) wrote : | # |
I had to self-land the merge in order to land the base ap merge :-(, but it's at least all in now. Whew.
Nicholas Skaggs (nskaggs) wrote : | # |
I'm unsure how this exact MP got merged; I guess lp decided my changes for base AP merged it. Regardless, Carla, go ahead and continue work on a new branch from trunk with some actual tests :-)
Carla Sella (carla-sella) wrote : | # |
On 19/03/2014 18:40, Nicholas Skaggs wrote:
> I'm unsure how this exact MP got merged; I guess lp decided my changes for base AP merged it. Regardless, Carla, go ahead and continue work on a new branch from trunk with some actual tests :-)
:D Thank you Nicholas.
That's just what I did:
https:/
I still have to check this one on the device.
Preview Diff
1 | === modified file 'src/app/qml/reminders.qml' |
2 | --- src/app/qml/reminders.qml 2014-03-12 22:37:14 +0000 |
3 | +++ src/app/qml/reminders.qml 2014-03-13 18:13:06 +0000 |
4 | @@ -185,6 +185,7 @@ |
5 | |
6 | Tab { |
7 | title: i18n.tr("Notes") |
8 | + objectName: "NotesTab" |
9 | page: NotesPage { |
10 | id: notesPage |
11 | |
12 | @@ -210,6 +211,7 @@ |
13 | |
14 | Tab { |
15 | title: i18n.tr("Notebooks") |
16 | + objectName: "NotebookTab" |
17 | page: NotebooksPage { |
18 | id: notebooksPage |
19 | |
20 | |
21 | === modified file 'src/app/qml/ui/AccountSelectorPage.qml' |
22 | --- src/app/qml/ui/AccountSelectorPage.qml 2014-02-16 10:51:11 +0000 |
23 | +++ src/app/qml/ui/AccountSelectorPage.qml 2014-03-13 18:13:06 +0000 |
24 | @@ -24,6 +24,7 @@ |
25 | |
26 | Page { |
27 | id: root |
28 | + objectName: "Accountselectorpage" |
29 | title: "Select Evernote account" |
30 | |
31 | property alias accounts: listView.model |
32 | @@ -43,6 +44,7 @@ |
33 | currentIndex: -1 |
34 | |
35 | delegate: Standard { |
36 | + objectName: "EvernoteAccount" |
37 | text: displayName |
38 | MouseArea { |
39 | anchors.fill: parent |
40 | |
41 | === modified file 'src/app/qml/ui/NotesPage.qml' |
42 | --- src/app/qml/ui/NotesPage.qml 2014-02-18 22:47:45 +0000 |
43 | +++ src/app/qml/ui/NotesPage.qml 2014-03-13 18:13:06 +0000 |
44 | @@ -99,6 +99,7 @@ |
45 | } |
46 | |
47 | ListView { |
48 | + objectName: "notespageListview" |
49 | anchors { left: parent.left; right: parent.right } |
50 | height: parent.height - y |
51 | model: notes |
52 | |
53 | === removed directory 'tests/autopilot/reminders/main' |
54 | === removed file 'tests/autopilot/reminders/main/__init__.py' |
55 | --- tests/autopilot/reminders/main/__init__.py 2013-10-23 11:02:37 +0000 |
56 | +++ tests/autopilot/reminders/main/__init__.py 1970-01-01 00:00:00 +0000 |
57 | @@ -1,1 +0,0 @@ |
58 | -""" A Generic test suite """ |
59 | |
60 | === removed file 'tests/autopilot/reminders/main/test_main.py' |
61 | --- tests/autopilot/reminders/main/test_main.py 2014-01-27 15:27:42 +0000 |
62 | +++ tests/autopilot/reminders/main/test_main.py 1970-01-01 00:00:00 +0000 |
63 | @@ -1,28 +0,0 @@ |
64 | -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
65 | - |
66 | -"""Tests for the Hello World""" |
67 | - |
68 | -from autopilot.matchers import Eventually |
69 | -from textwrap import dedent |
70 | -from testtools.matchers import Is, Not, Equals |
71 | -from testtools import skip |
72 | -import os |
73 | -from reminders import UbuntuTouchAppTestCase |
74 | - |
75 | - |
76 | -class GenericTests(UbuntuTouchAppTestCase): |
77 | - """Generic tests for the Hello World""" |
78 | - |
79 | - if os.path.realpath(__file__).startswith("/usr/"): |
80 | - test_qml_file = "/usr/share/reminders/qml/reminders.qml" |
81 | - else: |
82 | - test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"../../../../src/app/qml/reminders") |
83 | - |
84 | - def test_0_can_select_mainView(self): |
85 | - """Must be able to select the mainview.""" |
86 | - |
87 | - mainView = self.get_mainview() |
88 | - self.assertThat(mainView.visible,Eventually(Equals(True))) |
89 | - |
90 | - |
91 | - |
92 | |
93 | === renamed directory 'tests/autopilot/reminders' => 'tests/autopilot/reminders_app' |
94 | === modified file 'tests/autopilot/reminders_app/__init__.py' |
95 | --- tests/autopilot/reminders/__init__.py 2013-11-22 18:13:40 +0000 |
96 | +++ tests/autopilot/reminders_app/__init__.py 2014-03-13 18:13:06 +0000 |
97 | @@ -1,131 +1,8 @@ |
98 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
99 | - |
100 | -"""Ubuntu Touch App autopilot tests.""" |
101 | - |
102 | -from os import remove |
103 | -import os.path |
104 | -from tempfile import mktemp |
105 | -import subprocess |
106 | - |
107 | -from autopilot.input import Mouse, Touch, Pointer |
108 | -from autopilot.matchers import Eventually |
109 | -from autopilot.platform import model |
110 | -from testtools.matchers import Is, Not, Equals |
111 | -from autopilot.testcase import AutopilotTestCase |
112 | - |
113 | -def get_module_include_path(): |
114 | - return os.path.abspath( |
115 | - os.path.join( |
116 | - os.path.dirname(__file__), |
117 | - '..', |
118 | - '..', |
119 | - '..', |
120 | - '..', |
121 | - 'src/plugin/') |
122 | - ) |
123 | - |
124 | - |
125 | -class UbuntuTouchAppTestCase(AutopilotTestCase): |
126 | - """A common test case class that provides several useful methods for the tests.""" |
127 | - |
128 | - if model() == 'Desktop': |
129 | - scenarios = [ |
130 | - ('with mouse', dict(input_device_class=Mouse)) |
131 | - ] |
132 | - else: |
133 | - scenarios = [ |
134 | - ('with touch', dict(input_device_class=Touch)) |
135 | - ] |
136 | - |
137 | - @property |
138 | - def main_window(self): |
139 | - return MainWindow(self.app) |
140 | - |
141 | - |
142 | - def setUp(self): |
143 | - self.pointing_device = Pointer(self.input_device_class.create()) |
144 | - super(UbuntuTouchAppTestCase, self).setUp() |
145 | - self.launch_test_qml() |
146 | - |
147 | - |
148 | - def launch_test_qml(self): |
149 | - # If the test class has defined a 'test_qml' class attribute then we |
150 | - # write it to disk and launch it inside the QML Scene. If not, then we |
151 | - # silently do nothing (presumably the test has something else planned). |
152 | - arch = subprocess.check_output(["dpkg-architecture", |
153 | - "-qDEB_HOST_MULTIARCH"]).strip() |
154 | - if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring): |
155 | - qml_path = mktemp(suffix='.qml') |
156 | - open(qml_path, 'w').write(self.test_qml) |
157 | - self.addCleanup(remove, qml_path) |
158 | - |
159 | - self.app = self.launch_test_application( |
160 | - "/usr/lib/" + arch + "/qt5/bin/qmlscene", |
161 | - "-I", get_module_include_path(), |
162 | - qml_path, |
163 | - app_type='qt') |
164 | - |
165 | - if hasattr(self, 'test_qml_file') and isinstance(self.test_qml_file, basestring): |
166 | - qml_path = self.test_qml_file |
167 | - self.app = self.launch_test_application( |
168 | - "/usr/lib/" + arch + "/qt5/bin/qmlscene", |
169 | - "-I", get_module_include_path(), |
170 | - qml_path, |
171 | - app_type='qt') |
172 | - |
173 | - self.assertThat(self.get_qml_view().visible, Eventually(Equals(True))) |
174 | - |
175 | - |
176 | - def get_qml_view(self): |
177 | - """Get the main QML view""" |
178 | - |
179 | - return self.app.select_single("QQuickView") |
180 | - |
181 | - def get_mainview(self): |
182 | - """Get the QML MainView""" |
183 | - |
184 | - mainView = self.app.select_single("MainView") |
185 | - self.assertThat(mainView, Not(Is(None))) |
186 | - return mainView |
187 | - |
188 | - |
189 | - def get_object(self,objectName): |
190 | - """Get a object based on the objectName""" |
191 | - |
192 | - obj = self.app.select_single(objectName=objectName) |
193 | - self.assertThat(obj, Not(Is(None))) |
194 | - return obj |
195 | - |
196 | - |
197 | - def mouse_click(self,objectName): |
198 | - """Move mouse on top of the object and click on it""" |
199 | - |
200 | - obj = self.get_object(objectName) |
201 | - self.pointing_device.move_to_object(obj) |
202 | - self.pointing_device.click() |
203 | - |
204 | - |
205 | - def mouse_press(self,objectName): |
206 | - """Move mouse on top of the object and press mouse button (without releasing it)""" |
207 | - |
208 | - obj = self.get_object(objectName) |
209 | - self.pointing_device.move_to_object(obj) |
210 | - self.pointing_device.press() |
211 | - |
212 | - |
213 | - def mouse_release(self): |
214 | - """Release mouse button""" |
215 | - |
216 | - self.pointing_device.release() |
217 | - |
218 | - |
219 | - def type_string(self, string): |
220 | - """Type a string with keyboard""" |
221 | - |
222 | - self.keyboard.type(string) |
223 | - |
224 | - |
225 | - def type_key(self, key): |
226 | - """Type a single key with keyboard""" |
227 | - |
228 | - self.keyboard.key(key) |
229 | +# Copyright 2013 Canonical |
230 | +# |
231 | +# This program is free software: you can redistribute it and/or modify it |
232 | +# under the terms of the GNU General Public License version 3, as published |
233 | +# by the Free Software Foundation. |
234 | + |
235 | +"""Reminders app tests and emulators - top level package.""" |
236 | |
237 | === added file 'tests/autopilot/reminders_app/emulators.py' |
238 | --- tests/autopilot/reminders_app/emulators.py 1970-01-01 00:00:00 +0000 |
239 | +++ tests/autopilot/reminders_app/emulators.py 2014-03-13 18:13:06 +0000 |
240 | @@ -0,0 +1,45 @@ |
241 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
242 | +# |
243 | +# Copyright (C) 2013 Canonical Ltd. |
244 | +# |
245 | +# This program is free software; you can redistribute it and/or modify |
246 | +# it under the terms of the GNU Lesser General Public License as published by |
247 | +# the Free Software Foundation; version 3. |
248 | +# |
249 | +# This program is distributed in the hope that it will be useful, |
250 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
251 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
252 | +# GNU Lesser General Public License for more details. |
253 | +# |
254 | +# You should have received a copy of the GNU Lesser General Public License |
255 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
256 | + |
257 | +import logging |
258 | + |
259 | +from autopilot import logging as autopilot_logging |
260 | +from ubuntuuitoolkit import emulators as toolkit_emulators |
261 | +from time import sleep |
262 | + |
263 | +logger = logging.getLogger(__name__) |
264 | + |
265 | +class MainView(toolkit_emulators.MainView): |
266 | + |
267 | + retry_delay = 0.2 |
268 | + |
269 | + def select_many_retry(self, object_type, **kwargs): |
270 | + """Returns the item that is searched for with app.select_many |
271 | + In case of no item was not found (not created yet) a second attempt is |
272 | + taken 1 second later""" |
273 | + items = self.select_many(object_type, **kwargs) |
274 | + tries = 10 |
275 | + while len(items) < 1 and tries > 0: |
276 | + sleep(self.retry_delay) |
277 | + items = self.select_many(object_type, **kwargs) |
278 | + tries = tries - 1 |
279 | + return items |
280 | + |
281 | + @autopilot_logging.log_action(logger.info) |
282 | + def get_notespageListview(self): |
283 | + """Get notes page list view """ |
284 | + return self.wait_select_single( |
285 | + "QQuickListView", objectName="notespageListview") |
286 | |
287 | === added directory 'tests/autopilot/reminders_app/tests' |
288 | === added file 'tests/autopilot/reminders_app/tests/__init__.py' |
289 | --- tests/autopilot/reminders_app/tests/__init__.py 1970-01-01 00:00:00 +0000 |
290 | +++ tests/autopilot/reminders_app/tests/__init__.py 2014-03-13 18:13:06 +0000 |
291 | @@ -0,0 +1,110 @@ |
292 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
293 | +# |
294 | +# Copyright (C) 2013 Canonical Ltd |
295 | +# |
296 | +# This program is free software: you can redistribute it and/or modify |
297 | +# it under the terms of the GNU General Public License version 3 as |
298 | +# published by the Free Software Foundation. |
299 | +# |
300 | +# This program is distributed in the hope that it will be useful, |
301 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
302 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
303 | +# GNU General Public License for more details. |
304 | +# |
305 | +# You should have received a copy of the GNU General Public License |
306 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
307 | + |
308 | +"""Reminders app autopilot tests.""" |
309 | + |
310 | +import os |
311 | +import os.path |
312 | +import logging |
313 | + |
314 | +from autopilot.input import Mouse, Touch, Pointer |
315 | +from autopilot.platform import model |
316 | +from autopilot.testcase import AutopilotTestCase |
317 | + |
318 | +from ubuntuuitoolkit import ( |
319 | + base, |
320 | + emulators as toolkit_emulators |
321 | +) |
322 | + |
323 | +from reminders_app import emulators |
324 | + |
325 | +logger = logging.getLogger(__name__) |
326 | + |
327 | + |
328 | +def get_module_include_path(): |
329 | + return os.path.abspath( |
330 | + os.path.join( |
331 | + os.path.dirname(__file__), |
332 | + '..', |
333 | + '..', |
334 | + '..', |
335 | + '..', |
336 | + 'builddir/src/plugin/Evernote') |
337 | + ) |
338 | + |
339 | + |
340 | +class RemindersAppTestCase(AutopilotTestCase): |
341 | + """A common test case class that provides several useful methods for |
342 | + reminders-app tests.""" |
343 | + |
344 | + if model() == 'Desktop': |
345 | + scenarios = [('with mouse', dict(input_device_class=Mouse))] |
346 | + else: |
347 | + scenarios = [('with touch', dict(input_device_class=Touch))] |
348 | + |
349 | + local_location = "../../src/app/qml/reminders.qml" |
350 | + installed_location = "/usr/share/reminders/qml/reminders.qml" |
351 | + |
352 | + def setUp(self): |
353 | + self.pointing_device = Pointer(self.input_device_class.create()) |
354 | + super(RemindersAppTestCase, self).setUp() |
355 | + |
356 | + #turn off the OSK so it doesn't block screen elements |
357 | + if model() != 'Desktop': |
358 | + os.system("stop maliit-server") |
359 | + #adding cleanup step seems to restart service immeadiately |
360 | + #disabling for now |
361 | + #self.addCleanup(os.system("start maliit-server")) |
362 | + |
363 | + #if os.path.exists(self.local_location): |
364 | + #self.launch_test_local() |
365 | + #elif os.path.exists(self.installed_location): |
366 | + #self.launch_test_installed() |
367 | + #else: |
368 | + #self.launch_test_click() |
369 | + |
370 | + if os.path.exists(self.installed_location): |
371 | + self.launch_test_installed() |
372 | + else: |
373 | + self.launch_test_click() |
374 | + |
375 | + def launch_test_local(self): |
376 | + self.app = self.launch_test_application( |
377 | + base.get_qmlscene_launch_command(), |
378 | + "-I", get_module_include_path(), |
379 | + self.local_location, |
380 | + "--desktop_file_hint=/home/phablet/reminders/" |
381 | + "reminders-app.desktop", |
382 | + app_type='qt', |
383 | + emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
384 | + |
385 | + def launch_test_installed(self): |
386 | + self.app = self.launch_test_application( |
387 | + base.get_qmlscene_launch_command(), |
388 | + self.installed_location, |
389 | + "--desktop_file_hint=/usr/share/applications/" |
390 | + "reminders.desktop", |
391 | + app_type='qt', |
392 | + emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
393 | + |
394 | + def launch_test_click(self): |
395 | + self.app = self.launch_click_package( |
396 | + "com.ubuntu.reminders-app", |
397 | + emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
398 | + |
399 | + @property |
400 | + def main_view(self): |
401 | + return self.app.select_single(emulators.MainView) |
402 | |
403 | === added file 'tests/autopilot/reminders_app/tests/test_reminders.py' |
404 | --- tests/autopilot/reminders_app/tests/test_reminders.py 1970-01-01 00:00:00 +0000 |
405 | +++ tests/autopilot/reminders_app/tests/test_reminders.py 2014-03-13 18:13:06 +0000 |
406 | @@ -0,0 +1,42 @@ |
407 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
408 | +# Copyright 2013 Canonical |
409 | +# |
410 | +# This program is free software: you can redistribute it and/or modify it |
411 | +# under the terms of the GNU General Public License version 3, as published |
412 | +# by the Free Software Foundation. |
413 | + |
414 | +"""Reminders app autopilot tests.""" |
415 | + |
416 | +from __future__ import absolute_import |
417 | + |
418 | +from autopilot.matchers import Eventually |
419 | +from testtools.matchers import Equals, GreaterThan |
420 | + |
421 | +from reminders_app.tests import RemindersAppTestCase |
422 | + |
423 | +import logging |
424 | + |
425 | +logger = logging.getLogger(__name__) |
426 | + |
427 | +from time import sleep |
428 | + |
429 | +class TestMainWindow(RemindersAppTestCase): |
430 | + |
431 | + def setUp(self): |
432 | + super(TestMainWindow, self).setUp() |
433 | + |
434 | + self.assertThat(self.main_view.visible, Eventually(Equals(True))) |
435 | + |
436 | + def test_download_list_of_notebooks(self): |
437 | + """test to check whether downloading a list from Notebooks from |
438 | + Evernote is successful or not """ |
439 | + #Evernoteaccount = self.main_view.get_evernote_account() |
440 | + #self.pointing_device.click_object(Evernoteaccount) |
441 | + |
442 | + sleep(10) |
443 | + notebookTab = self.main_view.switch_to_tab("NotebookTab") |
444 | + self.assertThat(notebookTab.visible, Eventually(Equals(True))) |
445 | + |
446 | + notebookslistview = self.main_view.get_notespageListview() |
447 | + self.assertThat(notebookslistview.count, Eventually(GreaterThan(0))) |
448 | + |
FAILED: Continuous integration, rev:25 91.189. 93.70:8080/ job/reminders- app-ci/ 62/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 698/console 91.189. 93.70:8080/ job/reminders- app-saucy- amd64-ci/ 62/console 91.189. 93.70:8080/ job/reminders- app-trusty- amd64-ci/ 62/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 62/rebuild
http://