Merge lp:~carla-sella/reminders-app/notebook-list-test-new into lp:reminders-app

Proposed by Carla Sella
Status: Work in progress
Proposed branch: lp:~carla-sella/reminders-app/notebook-list-test-new
Merge into: lp:reminders-app
Diff against target: 93 lines (+53/-0) (has conflicts)
3 files modified
src/app/qml/ui/NotebooksPage.qml (+1/-0)
tests/autopilot/reminders/__init__.py (+34/-0)
tests/autopilot/reminders/tests/test_reminders.py (+18/-0)
Text conflict in tests/autopilot/reminders/tests/test_reminders.py
To merge this branch: bzr merge lp:~carla-sella/reminders-app/notebook-list-test-new
Reviewer Review Type Date Requested Status
Ubuntu Notes app developers Pending
Review via email: mp+218140@code.launchpad.net

Commit message

Test for reminders.

To post a comment you must log in.

Unmerged revisions

111. By Carla Sella

Refined test_download_list_of_notebooks.

110. By Carla Sella

Added fixed test_download_list_of_notebooks test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/NotebooksPage.qml'
2--- src/app/qml/ui/NotebooksPage.qml 2014-03-19 16:26:36 +0000
3+++ src/app/qml/ui/NotebooksPage.qml 2014-05-02 19:08:22 +0000
4@@ -105,6 +105,7 @@
5 }
6
7 ListView {
8+ objectName: "NotebookspageListview"
9 model: notebooks
10 anchors { left: parent.left; right: parent.right }
11 height: parent.height - y - buttonRow.height - keyboardRect.height
12
13=== modified file 'tests/autopilot/reminders/__init__.py'
14--- tests/autopilot/reminders/__init__.py 2014-04-04 17:49:32 +0000
15+++ tests/autopilot/reminders/__init__.py 2014-05-02 19:08:22 +0000
16@@ -60,6 +60,12 @@
17 else:
18 return self._no_account_dialog
19
20+ def get_notebookpage(self):
21+ return self.wait_select_single("NotebooksPage")
22+
23+ def get_notespage(self):
24+ return self.wait_select_single("NotesPage")
25+
26
27 class NoAccountDialog(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
28
29@@ -75,3 +81,31 @@
30 def open_account_settings(self):
31 button = self.select_single('Button', objectName='openAccountButton')
32 self.pointing_device.click_object(button)
33+
34+
35+class Page(toolkit_emulators.MainView):
36+ """Autopilot helper for the Page objects."""
37+
38+ def __init__(self, *args):
39+ super(Page, self).__init__(*args)
40+ # XXX we need a better way to keep reference to the main view.
41+ # --elopio - 2014-02-26
42+ self.main_view = self.get_root_instance().select_single(MainView)
43+
44+
45+class NotebooksPage(Page):
46+ """Autopilot helper for the Notebook page."""
47+
48+ def get_notebookspageListview(self):
49+ """Get notebooks page list view """
50+ return self.wait_select_single(
51+ "QQuickListView", objectName="NotebookspageListview")
52+
53+
54+class NotesPage(Page):
55+ """Autopilot helper for the Notes page."""
56+
57+ def get_notespageListview(self):
58+ """Get note page list view """
59+ return self.wait_select_single(
60+ "QQuickListView", objectName="notespageListview")
61
62=== modified file 'tests/autopilot/reminders/tests/test_reminders.py'
63--- tests/autopilot/reminders/tests/test_reminders.py 2014-04-24 19:33:26 +0000
64+++ tests/autopilot/reminders/tests/test_reminders.py 2014-05-02 19:08:22 +0000
65@@ -35,6 +35,7 @@
66
67 def test_open_application_without_account(self):
68 """Test that the No account dialog is visible."""
69+<<<<<<< TREE
70 self.assertTrue(self.app.main_view.no_account_dialog.visible)
71
72 def test_go_to_account_settings(self):
73@@ -56,3 +57,20 @@
74 self.assertThat(
75 get_last_dispatch_url_call_parameter,
76 Eventually(Equals('settings:///system/online-accounts')))
77+=======
78+ self.assertTrue(self.app.main_the .visible)
79+
80+
81+class TestMainWindow(tests.RemindersAppTestCase):
82+
83+ def setUp(self):
84+ super(TestMainWindow, self).setUp()
85+ self.assertTrue(self.app.main_view.visible)
86+
87+ def test_download_list_of_notebooks(self):
88+ """test to check whether downloading a list of Notebooks from
89+ Evernote is successful or not """
90+ self.app.main_view.switch_to_tab("NotebookTab")
91+ notebookpage = self.app.main_view.get_notebookpage()
92+ self.assertGreater(notebookpage.get_notebookspageListview().count, 0)
93+>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches