Merge lp:~carla-sella/reminders-app/new-reminders-app-tests into lp:reminders-app

Proposed by Carla Sella
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
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.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
26. By Carla Sella <email address hidden>

Fixed conflict.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
27. By Carla Sella <email address hidden>

Fixed conflicts.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
28. By Carla Sella <email address hidden>

Fixed pyflakes pep8.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

The tests fail on jenkins because there is no account configured.

Revision history for this message
Carla Sella (carla-sella) wrote :

Ok thanks! I was wondering why :P.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Working with online accounts folks to see how to mock this up properly.

Revision history for this message
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://sandbox.evernote.com and using that for login.

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://code.launchpad.net/~carla-sella/reminders-app/new-reminders-app-tests/+merge/201672
> 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.
>

Revision history for this message
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?

Revision history for this message
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...

Revision history for this message
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.

29. By Carla Sella <email address hidden>

Adding common cmake.

30. By Carla Sella <email address hidden>

Renamed Reminders test directory

31. By Carla Sella <email address hidden>

Fixed wrong directory name

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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?

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

I talked with Chris about the AP bugs we ran into with this; the launch bug is merged

https://bugs.launchpad.net/autopilot/+bug/1275913

This bug is still being worked and should land very soon;

https://code.launchpad.net/~veebers/autopilot-qt/reintroduce-exporting-qobject-children-of-qml-items/+merge/207581

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.

Revision history for this message
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://bugs.launchpad.net/reminders-app/+bug/1280459 that will not let me install it again.
I am unable to run autopilot tests so I was waiting to be able to install remindes-app again.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Carla, the dependency issue is now resolved :-) For the app not launching, see:

https://bugs.launchpad.net/reminders-app/+bug/1276647

I've marked this as critical, as it's blocking the test development. Thanks!

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

The launching issue has also been resolved, and should be released soon.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

The bug has been fixed,after upgrading I can launch reminders.. See if you can give this a whirl now :-)

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

There's a trick to launching reminders.qml via the command line with qmlscene -- can someone elaborate?

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
34. By Carla Sella

Pushing changes for Ballons.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Carla, we've landed the base of this work in https://code.launchpad.net/~nskaggs/reminders-app/base-ap/+merge/211409. You can rebase and continue on this MP, but the diff should be more readable now with just the new tests :-)

This branch will also depend on https://code.launchpad.net/~nskaggs/reminders-app/add-testability-driver/+merge/211428 in order to work. If this hasn't yet landed I'd encourage you to merge the branch so autopilot introspection will work properly.

Revision history for this message
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.

Revision history for this message
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 :-)

Revision history for this message
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://code.launchpad.net/~carla-sella/reminders-app/notebook-list-test

I still have to check this one on the device.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/qml/reminders.qml'
--- src/app/qml/reminders.qml 2014-03-12 22:37:14 +0000
+++ src/app/qml/reminders.qml 2014-03-13 18:13:06 +0000
@@ -185,6 +185,7 @@
185185
186 Tab {186 Tab {
187 title: i18n.tr("Notes")187 title: i18n.tr("Notes")
188 objectName: "NotesTab"
188 page: NotesPage {189 page: NotesPage {
189 id: notesPage190 id: notesPage
190191
@@ -210,6 +211,7 @@
210211
211 Tab {212 Tab {
212 title: i18n.tr("Notebooks")213 title: i18n.tr("Notebooks")
214 objectName: "NotebookTab"
213 page: NotebooksPage {215 page: NotebooksPage {
214 id: notebooksPage216 id: notebooksPage
215217
216218
=== modified file 'src/app/qml/ui/AccountSelectorPage.qml'
--- src/app/qml/ui/AccountSelectorPage.qml 2014-02-16 10:51:11 +0000
+++ src/app/qml/ui/AccountSelectorPage.qml 2014-03-13 18:13:06 +0000
@@ -24,6 +24,7 @@
2424
25Page {25Page {
26 id: root26 id: root
27 objectName: "Accountselectorpage"
27 title: "Select Evernote account"28 title: "Select Evernote account"
2829
29 property alias accounts: listView.model30 property alias accounts: listView.model
@@ -43,6 +44,7 @@
43 currentIndex: -144 currentIndex: -1
4445
45 delegate: Standard {46 delegate: Standard {
47 objectName: "EvernoteAccount"
46 text: displayName48 text: displayName
47 MouseArea {49 MouseArea {
48 anchors.fill: parent50 anchors.fill: parent
4951
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2014-02-18 22:47:45 +0000
+++ src/app/qml/ui/NotesPage.qml 2014-03-13 18:13:06 +0000
@@ -99,6 +99,7 @@
99 }99 }
100100
101 ListView {101 ListView {
102 objectName: "notespageListview"
102 anchors { left: parent.left; right: parent.right }103 anchors { left: parent.left; right: parent.right }
103 height: parent.height - y104 height: parent.height - y
104 model: notes105 model: notes
105106
=== removed directory 'tests/autopilot/reminders/main'
=== removed file 'tests/autopilot/reminders/main/__init__.py'
--- tests/autopilot/reminders/main/__init__.py 2013-10-23 11:02:37 +0000
+++ tests/autopilot/reminders/main/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1""" A Generic test suite """
20
=== removed file 'tests/autopilot/reminders/main/test_main.py'
--- tests/autopilot/reminders/main/test_main.py 2014-01-27 15:27:42 +0000
+++ tests/autopilot/reminders/main/test_main.py 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
3"""Tests for the Hello World"""
4
5from autopilot.matchers import Eventually
6from textwrap import dedent
7from testtools.matchers import Is, Not, Equals
8from testtools import skip
9import os
10from reminders import UbuntuTouchAppTestCase
11
12
13class GenericTests(UbuntuTouchAppTestCase):
14 """Generic tests for the Hello World"""
15
16 if os.path.realpath(__file__).startswith("/usr/"):
17 test_qml_file = "/usr/share/reminders/qml/reminders.qml"
18 else:
19 test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"../../../../src/app/qml/reminders")
20
21 def test_0_can_select_mainView(self):
22 """Must be able to select the mainview."""
23
24 mainView = self.get_mainview()
25 self.assertThat(mainView.visible,Eventually(Equals(True)))
26
27
28
290
=== renamed directory 'tests/autopilot/reminders' => 'tests/autopilot/reminders_app'
=== modified file 'tests/autopilot/reminders_app/__init__.py'
--- tests/autopilot/reminders/__init__.py 2013-11-22 18:13:40 +0000
+++ tests/autopilot/reminders_app/__init__.py 2014-03-13 18:13:06 +0000
@@ -1,131 +1,8 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22# Copyright 2013 Canonical
3"""Ubuntu Touch App autopilot tests."""3#
44# This program is free software: you can redistribute it and/or modify it
5from os import remove5# under the terms of the GNU General Public License version 3, as published
6import os.path6# by the Free Software Foundation.
7from tempfile import mktemp7
8import subprocess8"""Reminders app tests and emulators - top level package."""
9
10from autopilot.input import Mouse, Touch, Pointer
11from autopilot.matchers import Eventually
12from autopilot.platform import model
13from testtools.matchers import Is, Not, Equals
14from autopilot.testcase import AutopilotTestCase
15
16def get_module_include_path():
17 return os.path.abspath(
18 os.path.join(
19 os.path.dirname(__file__),
20 '..',
21 '..',
22 '..',
23 '..',
24 'src/plugin/')
25 )
26
27
28class UbuntuTouchAppTestCase(AutopilotTestCase):
29 """A common test case class that provides several useful methods for the tests."""
30
31 if model() == 'Desktop':
32 scenarios = [
33 ('with mouse', dict(input_device_class=Mouse))
34 ]
35 else:
36 scenarios = [
37 ('with touch', dict(input_device_class=Touch))
38 ]
39
40 @property
41 def main_window(self):
42 return MainWindow(self.app)
43
44
45 def setUp(self):
46 self.pointing_device = Pointer(self.input_device_class.create())
47 super(UbuntuTouchAppTestCase, self).setUp()
48 self.launch_test_qml()
49
50
51 def launch_test_qml(self):
52 # If the test class has defined a 'test_qml' class attribute then we
53 # write it to disk and launch it inside the QML Scene. If not, then we
54 # silently do nothing (presumably the test has something else planned).
55 arch = subprocess.check_output(["dpkg-architecture",
56 "-qDEB_HOST_MULTIARCH"]).strip()
57 if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring):
58 qml_path = mktemp(suffix='.qml')
59 open(qml_path, 'w').write(self.test_qml)
60 self.addCleanup(remove, qml_path)
61
62 self.app = self.launch_test_application(
63 "/usr/lib/" + arch + "/qt5/bin/qmlscene",
64 "-I", get_module_include_path(),
65 qml_path,
66 app_type='qt')
67
68 if hasattr(self, 'test_qml_file') and isinstance(self.test_qml_file, basestring):
69 qml_path = self.test_qml_file
70 self.app = self.launch_test_application(
71 "/usr/lib/" + arch + "/qt5/bin/qmlscene",
72 "-I", get_module_include_path(),
73 qml_path,
74 app_type='qt')
75
76 self.assertThat(self.get_qml_view().visible, Eventually(Equals(True)))
77
78
79 def get_qml_view(self):
80 """Get the main QML view"""
81
82 return self.app.select_single("QQuickView")
83
84 def get_mainview(self):
85 """Get the QML MainView"""
86
87 mainView = self.app.select_single("MainView")
88 self.assertThat(mainView, Not(Is(None)))
89 return mainView
90
91
92 def get_object(self,objectName):
93 """Get a object based on the objectName"""
94
95 obj = self.app.select_single(objectName=objectName)
96 self.assertThat(obj, Not(Is(None)))
97 return obj
98
99
100 def mouse_click(self,objectName):
101 """Move mouse on top of the object and click on it"""
102
103 obj = self.get_object(objectName)
104 self.pointing_device.move_to_object(obj)
105 self.pointing_device.click()
106
107
108 def mouse_press(self,objectName):
109 """Move mouse on top of the object and press mouse button (without releasing it)"""
110
111 obj = self.get_object(objectName)
112 self.pointing_device.move_to_object(obj)
113 self.pointing_device.press()
114
115
116 def mouse_release(self):
117 """Release mouse button"""
118
119 self.pointing_device.release()
120
121
122 def type_string(self, string):
123 """Type a string with keyboard"""
124
125 self.keyboard.type(string)
126
127
128 def type_key(self, key):
129 """Type a single key with keyboard"""
130
131 self.keyboard.key(key)
1329
=== added file 'tests/autopilot/reminders_app/emulators.py'
--- tests/autopilot/reminders_app/emulators.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/reminders_app/emulators.py 2014-03-13 18:13:06 +0000
@@ -0,0 +1,45 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2013 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17import logging
18
19from autopilot import logging as autopilot_logging
20from ubuntuuitoolkit import emulators as toolkit_emulators
21from time import sleep
22
23logger = logging.getLogger(__name__)
24
25class MainView(toolkit_emulators.MainView):
26
27 retry_delay = 0.2
28
29 def select_many_retry(self, object_type, **kwargs):
30 """Returns the item that is searched for with app.select_many
31 In case of no item was not found (not created yet) a second attempt is
32 taken 1 second later"""
33 items = self.select_many(object_type, **kwargs)
34 tries = 10
35 while len(items) < 1 and tries > 0:
36 sleep(self.retry_delay)
37 items = self.select_many(object_type, **kwargs)
38 tries = tries - 1
39 return items
40
41 @autopilot_logging.log_action(logger.info)
42 def get_notespageListview(self):
43 """Get notes page list view """
44 return self.wait_select_single(
45 "QQuickListView", objectName="notespageListview")
046
=== added directory 'tests/autopilot/reminders_app/tests'
=== added file 'tests/autopilot/reminders_app/tests/__init__.py'
--- tests/autopilot/reminders_app/tests/__init__.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/reminders_app/tests/__init__.py 2014-03-13 18:13:06 +0000
@@ -0,0 +1,110 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2013 Canonical Ltd
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 3 as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Reminders app autopilot tests."""
18
19import os
20import os.path
21import logging
22
23from autopilot.input import Mouse, Touch, Pointer
24from autopilot.platform import model
25from autopilot.testcase import AutopilotTestCase
26
27from ubuntuuitoolkit import (
28 base,
29 emulators as toolkit_emulators
30)
31
32from reminders_app import emulators
33
34logger = logging.getLogger(__name__)
35
36
37def get_module_include_path():
38 return os.path.abspath(
39 os.path.join(
40 os.path.dirname(__file__),
41 '..',
42 '..',
43 '..',
44 '..',
45 'builddir/src/plugin/Evernote')
46 )
47
48
49class RemindersAppTestCase(AutopilotTestCase):
50 """A common test case class that provides several useful methods for
51 reminders-app tests."""
52
53 if model() == 'Desktop':
54 scenarios = [('with mouse', dict(input_device_class=Mouse))]
55 else:
56 scenarios = [('with touch', dict(input_device_class=Touch))]
57
58 local_location = "../../src/app/qml/reminders.qml"
59 installed_location = "/usr/share/reminders/qml/reminders.qml"
60
61 def setUp(self):
62 self.pointing_device = Pointer(self.input_device_class.create())
63 super(RemindersAppTestCase, self).setUp()
64
65 #turn off the OSK so it doesn't block screen elements
66 if model() != 'Desktop':
67 os.system("stop maliit-server")
68 #adding cleanup step seems to restart service immeadiately
69 #disabling for now
70 #self.addCleanup(os.system("start maliit-server"))
71
72 #if os.path.exists(self.local_location):
73 #self.launch_test_local()
74 #elif os.path.exists(self.installed_location):
75 #self.launch_test_installed()
76 #else:
77 #self.launch_test_click()
78
79 if os.path.exists(self.installed_location):
80 self.launch_test_installed()
81 else:
82 self.launch_test_click()
83
84 def launch_test_local(self):
85 self.app = self.launch_test_application(
86 base.get_qmlscene_launch_command(),
87 "-I", get_module_include_path(),
88 self.local_location,
89 "--desktop_file_hint=/home/phablet/reminders/"
90 "reminders-app.desktop",
91 app_type='qt',
92 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
93
94 def launch_test_installed(self):
95 self.app = self.launch_test_application(
96 base.get_qmlscene_launch_command(),
97 self.installed_location,
98 "--desktop_file_hint=/usr/share/applications/"
99 "reminders.desktop",
100 app_type='qt',
101 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
102
103 def launch_test_click(self):
104 self.app = self.launch_click_package(
105 "com.ubuntu.reminders-app",
106 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
107
108 @property
109 def main_view(self):
110 return self.app.select_single(emulators.MainView)
0111
=== added file 'tests/autopilot/reminders_app/tests/test_reminders.py'
--- tests/autopilot/reminders_app/tests/test_reminders.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/reminders_app/tests/test_reminders.py 2014-03-13 18:13:06 +0000
@@ -0,0 +1,42 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2013 Canonical
3#
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.
7
8"""Reminders app autopilot tests."""
9
10from __future__ import absolute_import
11
12from autopilot.matchers import Eventually
13from testtools.matchers import Equals, GreaterThan
14
15from reminders_app.tests import RemindersAppTestCase
16
17import logging
18
19logger = logging.getLogger(__name__)
20
21from time import sleep
22
23class TestMainWindow(RemindersAppTestCase):
24
25 def setUp(self):
26 super(TestMainWindow, self).setUp()
27
28 self.assertThat(self.main_view.visible, Eventually(Equals(True)))
29
30 def test_download_list_of_notebooks(self):
31 """test to check whether downloading a list from Notebooks from
32 Evernote is successful or not """
33 #Evernoteaccount = self.main_view.get_evernote_account()
34 #self.pointing_device.click_object(Evernoteaccount)
35
36 sleep(10)
37 notebookTab = self.main_view.switch_to_tab("NotebookTab")
38 self.assertThat(notebookTab.visible, Eventually(Equals(True)))
39
40 notebookslistview = self.main_view.get_notespageListview()
41 self.assertThat(notebookslistview.count, Eventually(GreaterThan(0)))
42

Subscribers

People subscribed via source and target branches