Merge lp:~elopio/reminders-app/autopilot-add_notebook into lp:reminders-app
- autopilot-add_notebook
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 144 |
Merged at revision: | 151 |
Proposed branch: | lp:~elopio/reminders-app/autopilot-add_notebook |
Merge into: | lp:reminders-app |
Diff against target: |
353 lines (+152/-26) 6 files modified
src/app/qml/components/NotebooksDelegate.qml (+4/-0) src/app/qml/ui/NotebooksPage.qml (+5/-0) tests/autopilot/reminders/__init__.py (+100/-0) tests/autopilot/reminders/credentials.py (+1/-1) tests/autopilot/reminders/tests/__init__.py (+17/-14) tests/autopilot/reminders/tests/test_reminders.py (+25/-11) |
To merge this branch: | bzr merge lp:~elopio/reminders-app/autopilot-add_notebook |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Carla Sella (community) | Approve | ||
David Planella | Pending | ||
Julia Palandri | Pending | ||
VĂctor R. Ruiz | Pending | ||
Allan LeSage | Pending | ||
Richard Huddie | Pending | ||
Nicholas Skaggs | Pending | ||
Ubuntu Notes app developers | Pending | ||
Review via email: mp+219237@code.launchpad.net |
Commit message
Added an autopiolot test to add a notebook.
Description of the change
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Carla Sella (carla-sella) : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:138
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: 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:139
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: 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:140
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:141
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:142
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: 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:142
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:143
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:144
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/qml/components/NotebooksDelegate.qml' | |||
2 | --- src/app/qml/components/NotebooksDelegate.qml 2014-05-07 19:11:05 +0000 | |||
3 | +++ src/app/qml/components/NotebooksDelegate.qml 2014-05-23 07:11:33 +0000 | |||
4 | @@ -58,16 +58,19 @@ | |||
5 | 58 | Layout.fillWidth: true | 58 | Layout.fillWidth: true |
6 | 59 | 59 | ||
7 | 60 | Label { | 60 | Label { |
8 | 61 | objectName: 'notebookTitleLabel' | ||
9 | 61 | text: model.name | 62 | text: model.name |
10 | 62 | color: root.notebookColor | 63 | color: root.notebookColor |
11 | 63 | fontSize: "large" | 64 | fontSize: "large" |
12 | 64 | } | 65 | } |
13 | 65 | Label { | 66 | Label { |
14 | 67 | objectName: 'notebookLastUpdatedLabel' | ||
15 | 66 | text: i18n.tr("Last edited %1").arg(model.lastUpdatedString) | 68 | text: i18n.tr("Last edited %1").arg(model.lastUpdatedString) |
16 | 67 | fontSize: "small" | 69 | fontSize: "small" |
17 | 68 | color: "black" | 70 | color: "black" |
18 | 69 | } | 71 | } |
19 | 70 | Label { | 72 | Label { |
20 | 73 | objectName: 'notebookPublishedLabel' | ||
21 | 71 | Layout.fillHeight: true | 74 | Layout.fillHeight: true |
22 | 72 | text: model.published ? i18n.tr("Shared") : i18n.tr("Private") | 75 | text: model.published ? i18n.tr("Shared") : i18n.tr("Private") |
23 | 73 | color: model.published ? "black" : "#b3b3b3" | 76 | color: model.published ? "black" : "#b3b3b3" |
24 | @@ -78,6 +81,7 @@ | |||
25 | 78 | } | 81 | } |
26 | 79 | 82 | ||
27 | 80 | Label { | 83 | Label { |
28 | 84 | objectName: 'notebookNoteCountLabel' | ||
29 | 81 | Layout.fillHeight: true | 85 | Layout.fillHeight: true |
30 | 82 | verticalAlignment: Text.AlignVCenter | 86 | verticalAlignment: Text.AlignVCenter |
31 | 83 | text: "(" + model.noteCount + ")" | 87 | text: "(" + model.noteCount + ")" |
32 | 84 | 88 | ||
33 | === modified file 'src/app/qml/ui/NotebooksPage.qml' | |||
34 | --- src/app/qml/ui/NotebooksPage.qml 2014-05-14 10:31:49 +0000 | |||
35 | +++ src/app/qml/ui/NotebooksPage.qml 2014-05-23 07:11:33 +0000 | |||
36 | @@ -24,6 +24,7 @@ | |||
37 | 24 | 24 | ||
38 | 25 | Page { | 25 | Page { |
39 | 26 | id: root | 26 | id: root |
40 | 27 | objectName: 'notebooksPage' | ||
41 | 27 | 28 | ||
42 | 28 | signal openNotebook(string title, string notebookGuid) | 29 | signal openNotebook(string title, string notebookGuid) |
43 | 29 | 30 | ||
44 | @@ -62,6 +63,7 @@ | |||
45 | 62 | } | 63 | } |
46 | 63 | 64 | ||
47 | 64 | ToolbarButton { | 65 | ToolbarButton { |
48 | 66 | objectName: "addNotebookButton" | ||
49 | 65 | text: i18n.tr("Add notebook") | 67 | text: i18n.tr("Add notebook") |
50 | 66 | iconName: "add" | 68 | iconName: "add" |
51 | 67 | onTriggered: { | 69 | onTriggered: { |
52 | @@ -108,12 +110,14 @@ | |||
53 | 108 | 110 | ||
54 | 109 | TextField { | 111 | TextField { |
55 | 110 | id: newNoteTitleTextField | 112 | id: newNoteTitleTextField |
56 | 113 | objectName: "newNoteTitleTextField" | ||
57 | 111 | anchors { left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter } | 114 | anchors { left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter } |
58 | 112 | } | 115 | } |
59 | 113 | } | 116 | } |
60 | 114 | 117 | ||
61 | 115 | PulldownListView { | 118 | PulldownListView { |
62 | 116 | id: notebooksListView | 119 | id: notebooksListView |
63 | 120 | objectName: "notebooksListView" | ||
64 | 117 | model: notebooks | 121 | model: notebooks |
65 | 118 | anchors { left: parent.left; right: parent.right } | 122 | anchors { left: parent.left; right: parent.right } |
66 | 119 | height: parent.height - y - buttonRow.height - keyboardRect.height | 123 | height: parent.height - y - buttonRow.height - keyboardRect.height |
67 | @@ -168,6 +172,7 @@ | |||
68 | 168 | } | 172 | } |
69 | 169 | } | 173 | } |
70 | 170 | Button { | 174 | Button { |
71 | 175 | objectName: "saveButton" | ||
72 | 171 | anchors { right: parent.right; verticalCenter: parent.verticalCenter } | 176 | anchors { right: parent.right; verticalCenter: parent.verticalCenter } |
73 | 172 | text: i18n.tr("Save") | 177 | text: i18n.tr("Save") |
74 | 173 | enabled: newNoteTitleTextField.text.length > 0 | 178 | enabled: newNoteTitleTextField.text.length > 0 |
75 | 174 | 179 | ||
76 | === modified file 'tests/autopilot/reminders/__init__.py' | |||
77 | --- tests/autopilot/reminders/__init__.py 2014-05-16 06:52:10 +0000 | |||
78 | +++ tests/autopilot/reminders/__init__.py 2014-05-23 07:11:33 +0000 | |||
79 | @@ -21,6 +21,8 @@ | |||
80 | 21 | import logging | 21 | import logging |
81 | 22 | from distutils import version | 22 | from distutils import version |
82 | 23 | 23 | ||
83 | 24 | import ubuntuuitoolkit | ||
84 | 25 | |||
85 | 24 | import autopilot | 26 | import autopilot |
86 | 25 | from autopilot import logging as autopilot_logging | 27 | from autopilot import logging as autopilot_logging |
87 | 26 | from autopilot.introspection import dbus | 28 | from autopilot.introspection import dbus |
88 | @@ -41,6 +43,16 @@ | |||
89 | 41 | self.app = app_proxy | 43 | self.app = app_proxy |
90 | 42 | self.main_view = self.app.select_single(MainView) | 44 | self.main_view = self.app.select_single(MainView) |
91 | 43 | 45 | ||
92 | 46 | def open_notebooks(self): | ||
93 | 47 | """Open the Notebooks page. | ||
94 | 48 | |||
95 | 49 | :return: The autopilot custom proxy object for the NotebooksPage. | ||
96 | 50 | |||
97 | 51 | """ | ||
98 | 52 | self.main_view.switch_to_tab('NotebookTab') | ||
99 | 53 | return self.main_view.select_single( | ||
100 | 54 | NotebooksPage, objectName='notebooksPage') | ||
101 | 55 | |||
102 | 44 | 56 | ||
103 | 45 | class MainView(toolkit_emulators.MainView): | 57 | class MainView(toolkit_emulators.MainView): |
104 | 46 | """Autopilot custom proxy object for the MainView.""" | 58 | """Autopilot custom proxy object for the MainView.""" |
105 | @@ -64,6 +76,7 @@ | |||
106 | 64 | 76 | ||
107 | 65 | 77 | ||
108 | 66 | class NoAccountDialog(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | 78 | class NoAccountDialog(toolkit_emulators.UbuntuUIToolkitEmulatorBase): |
109 | 79 | """Autopilot custom proxy object for the no account dialog.""" | ||
110 | 67 | 80 | ||
111 | 68 | @classmethod | 81 | @classmethod |
112 | 69 | def validate_dbus_object(cls, path, state): | 82 | def validate_dbus_object(cls, path, state): |
113 | @@ -85,3 +98,90 @@ | |||
114 | 85 | def open_account_settings(self): | 98 | def open_account_settings(self): |
115 | 86 | button = self.select_single('Button', objectName='openAccountButton') | 99 | button = self.select_single('Button', objectName='openAccountButton') |
116 | 87 | self.pointing_device.click_object(button) | 100 | self.pointing_device.click_object(button) |
117 | 101 | |||
118 | 102 | |||
119 | 103 | class _Page(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
120 | 104 | |||
121 | 105 | def __init__(self, *args): | ||
122 | 106 | super(_Page, self).__init__(*args) | ||
123 | 107 | # XXX we need a better way to keep reference to the main view. | ||
124 | 108 | # --elopio - 2014-02-26 | ||
125 | 109 | self.main_view = self.get_root_instance().select_single(MainView) | ||
126 | 110 | |||
127 | 111 | |||
128 | 112 | class PulldownListView(ubuntuuitoolkit.QQuickListView): | ||
129 | 113 | """Autopilot custom proxy object for the PulldownListView.""" | ||
130 | 114 | |||
131 | 115 | |||
132 | 116 | class NotebooksPage(_Page): | ||
133 | 117 | """Autopilot custom proxy object for the Notebooks page.""" | ||
134 | 118 | |||
135 | 119 | def add_notebook(self, title): | ||
136 | 120 | """Add a notebook. | ||
137 | 121 | |||
138 | 122 | :param title: The title of the Notebook that will be added. | ||
139 | 123 | |||
140 | 124 | """ | ||
141 | 125 | original_number_of_books = self._get_notebooks_listview().count | ||
142 | 126 | self.main_view.open_toolbar().click_button('addNotebookButton') | ||
143 | 127 | title_textfield = self.select_single( | ||
144 | 128 | ubuntuuitoolkit.TextField, objectName='newNoteTitleTextField') | ||
145 | 129 | title_textfield.write(title) | ||
146 | 130 | self._click_save() | ||
147 | 131 | self._get_notebooks_listview().count.wait_for( | ||
148 | 132 | original_number_of_books + 1) | ||
149 | 133 | |||
150 | 134 | def _get_notebooks_listview(self): | ||
151 | 135 | return self.select_single( | ||
152 | 136 | PulldownListView, objectName='notebooksListView') | ||
153 | 137 | |||
154 | 138 | def _click_save(self): | ||
155 | 139 | save_button = self.select_single('Button', objectName='saveButton') | ||
156 | 140 | self.pointing_device.click_object(save_button) | ||
157 | 141 | |||
158 | 142 | def get_notebooks(self): | ||
159 | 143 | """Return the list of Notebooks. | ||
160 | 144 | |||
161 | 145 | :return: A list with the the Notebooks. Every item of the list is a | ||
162 | 146 | tuple with title, last updated value, published status and number | ||
163 | 147 | of notes. The list is sorted in the same order as it is displayed | ||
164 | 148 | on the application. | ||
165 | 149 | |||
166 | 150 | """ | ||
167 | 151 | listview = self._get_notebooks_listview() | ||
168 | 152 | notebook_delegates = listview.select_many(NotebooksDelegate) | ||
169 | 153 | # Sort by the position on the list. | ||
170 | 154 | sorted_notebook_delegates = sorted( | ||
171 | 155 | notebook_delegates, | ||
172 | 156 | key=lambda delegate: delegate.globalRect.y) | ||
173 | 157 | notebooks = [ | ||
174 | 158 | (notebook.get_title(), notebook.get_last_updated(), | ||
175 | 159 | notebook.get_published_status(), notebook.get_notes_count()) | ||
176 | 160 | for notebook in sorted_notebook_delegates | ||
177 | 161 | ] | ||
178 | 162 | return notebooks | ||
179 | 163 | |||
180 | 164 | |||
181 | 165 | class NotebooksDelegate(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
182 | 166 | """Autopilot custom proxy object for the NotebooksDelegate.""" | ||
183 | 167 | |||
184 | 168 | def get_title(self): | ||
185 | 169 | """Return the title of the Notebook.""" | ||
186 | 170 | return self._get_label_text('notebookTitleLabel') | ||
187 | 171 | |||
188 | 172 | def _get_label_text(self, object_name): | ||
189 | 173 | label = self.select_single('Label', objectName=object_name) | ||
190 | 174 | return label.text | ||
191 | 175 | |||
192 | 176 | def get_last_updated(self): | ||
193 | 177 | """Return the last updated value of the Notebook.""" | ||
194 | 178 | return self._get_label_text('notebookLastUpdatedLabel') | ||
195 | 179 | |||
196 | 180 | def get_published_status(self): | ||
197 | 181 | """Return the published status of the Notebook.""" | ||
198 | 182 | return self._get_label_text('notebookPublishedLabel') | ||
199 | 183 | |||
200 | 184 | def get_notes_count(self): | ||
201 | 185 | """Return the number of notes in the Notebook.""" | ||
202 | 186 | # The count is returned in paretheses, so we strip them. | ||
203 | 187 | return int(self._get_label_text('notebookNoteCountLabel').strip('()')) | ||
204 | 88 | 188 | ||
205 | === modified file 'tests/autopilot/reminders/credentials.py' | |||
206 | --- tests/autopilot/reminders/credentials.py 2014-05-08 18:10:01 +0000 | |||
207 | +++ tests/autopilot/reminders/credentials.py 2014-05-23 07:11:33 +0000 | |||
208 | @@ -28,7 +28,7 @@ | |||
209 | 28 | """Manager for online accounts.""" | 28 | """Manager for online accounts.""" |
210 | 29 | 29 | ||
211 | 30 | def __init__(self): | 30 | def __init__(self): |
213 | 31 | self._manager = Accounts.Manager() | 31 | self._manager = Accounts.Manager.new() |
214 | 32 | 32 | ||
215 | 33 | def _start_main_loop(self): | 33 | def _start_main_loop(self): |
216 | 34 | self.error = None | 34 | self.error = None |
217 | 35 | 35 | ||
218 | === modified file 'tests/autopilot/reminders/tests/__init__.py' | |||
219 | --- tests/autopilot/reminders/tests/__init__.py 2014-05-22 09:55:36 +0000 | |||
220 | +++ tests/autopilot/reminders/tests/__init__.py 2014-05-23 07:11:33 +0000 | |||
221 | @@ -45,14 +45,13 @@ | |||
222 | 45 | scenarios = [('with touch', dict(input_device_class=Touch))] | 45 | scenarios = [('with touch', dict(input_device_class=Touch))] |
223 | 46 | 46 | ||
224 | 47 | local_location = os.path.dirname(os.path.dirname(os.getcwd())) | 47 | local_location = os.path.dirname(os.path.dirname(os.getcwd())) |
227 | 48 | local_location_qml = os.path.join(local_location, | 48 | |
228 | 49 | 'src/app/qml/reminders.qml') | 49 | local_location_qml = os.path.join( |
229 | 50 | local_location, 'src/app/qml/reminders.qml') | ||
230 | 50 | local_location_binary = os.path.join(local_location, 'src/app/reminders') | 51 | local_location_binary = os.path.join(local_location, 'src/app/reminders') |
231 | 51 | installed_location_binary = '/usr/bin/reminders' | 52 | installed_location_binary = '/usr/bin/reminders' |
232 | 52 | installed_location_qml = '/usr/share/reminders/qml/reminders.qml' | 53 | installed_location_qml = '/usr/share/reminders/qml/reminders.qml' |
233 | 53 | 54 | ||
234 | 54 | home_dir = None | ||
235 | 55 | |||
236 | 56 | def get_launcher_and_type(self): | 55 | def get_launcher_and_type(self): |
237 | 57 | if os.path.exists(self.local_location_binary): | 56 | if os.path.exists(self.local_location_binary): |
238 | 58 | launcher = self.launch_test_local | 57 | launcher = self.launch_test_local |
239 | @@ -67,8 +66,7 @@ | |||
240 | 67 | 66 | ||
241 | 68 | def setUp(self): | 67 | def setUp(self): |
242 | 69 | launcher, test_type = self.get_launcher_and_type() | 68 | launcher, test_type = self.get_launcher_and_type() |
245 | 70 | if self.home_dir is None: | 69 | self.home_dir = self._patch_home(test_type) |
244 | 71 | self.home_dir = self._patch_home(test_type) | ||
246 | 72 | self.pointing_device = Pointer(self.input_device_class.create()) | 70 | self.pointing_device = Pointer(self.input_device_class.create()) |
247 | 73 | super(RemindersAppTestCase, self).setUp() | 71 | super(RemindersAppTestCase, self).setUp() |
248 | 74 | 72 | ||
249 | @@ -90,6 +88,7 @@ | |||
250 | 90 | temp_dir_fixture = fixtures.TempDir() | 88 | temp_dir_fixture = fixtures.TempDir() |
251 | 91 | self.useFixture(temp_dir_fixture) | 89 | self.useFixture(temp_dir_fixture) |
252 | 92 | temp_dir = temp_dir_fixture.path | 90 | temp_dir = temp_dir_fixture.path |
253 | 91 | temp_xdg_config_home = os.path.join(temp_dir, '.config') | ||
254 | 93 | 92 | ||
255 | 94 | #If running under xvfb, as jenkins does, | 93 | #If running under xvfb, as jenkins does, |
256 | 95 | #xsession will fail to start without xauthority file | 94 | #xsession will fail to start without xauthority file |
257 | @@ -100,21 +99,25 @@ | |||
258 | 100 | #click requires using initctl env (upstart), but the desktop can set | 99 | #click requires using initctl env (upstart), but the desktop can set |
259 | 101 | #an environment variable instead | 100 | #an environment variable instead |
260 | 102 | if test_type == 'click': | 101 | if test_type == 'click': |
263 | 103 | self.useFixture(toolkit_fixtures.InitctlEnvironmentVariable( | 102 | self.useFixture( |
264 | 104 | HOME=temp_dir)) | 103 | toolkit_fixtures.InitctlEnvironmentVariable( |
265 | 104 | HOME=temp_dir, XDG_CONFIG_HOME=temp_xdg_config_home)) | ||
266 | 105 | else: | 105 | else: |
269 | 106 | self.useFixture(fixtures.EnvironmentVariable('HOME', | 106 | self.useFixture( |
270 | 107 | newvalue=temp_dir)) | 107 | fixtures.EnvironmentVariable('HOME', newvalue=temp_dir)) |
271 | 108 | self.useFixture( | ||
272 | 109 | fixtures.EnvironmentVariable( | ||
273 | 110 | 'XDG_CONFIG_HOME', newvalue=temp_xdg_config_home)) | ||
274 | 108 | 111 | ||
276 | 109 | logger.debug("Patched home to fake home directory " + temp_dir) | 112 | logger.debug('Patched home to fake home directory ' + temp_dir) |
277 | 110 | 113 | ||
278 | 111 | return temp_dir | 114 | return temp_dir |
279 | 112 | 115 | ||
280 | 113 | @autopilot_logging.log_action(logger.info) | 116 | @autopilot_logging.log_action(logger.info) |
281 | 114 | def launch_test_local(self): | 117 | def launch_test_local(self): |
285 | 115 | self.useFixture(fixtures.EnvironmentVariable('QML2_IMPORT_PATH', | 118 | self.useFixture(fixtures.EnvironmentVariable( |
286 | 116 | newvalue=os.path.join(self.local_location, | 119 | 'QML2_IMPORT_PATH', |
287 | 117 | 'src/plugin'))) | 120 | newvalue=os.path.join(self.local_location, 'src/plugin'))) |
288 | 118 | return self.launch_test_application( | 121 | return self.launch_test_application( |
289 | 119 | self.local_location_binary, | 122 | self.local_location_binary, |
290 | 120 | '-q', self.local_location_qml, | 123 | '-q', self.local_location_qml, |
291 | 121 | 124 | ||
292 | === modified file 'tests/autopilot/reminders/tests/test_reminders.py' | |||
293 | --- tests/autopilot/reminders/tests/test_reminders.py 2014-05-08 23:52:39 +0000 | |||
294 | +++ tests/autopilot/reminders/tests/test_reminders.py 2014-05-23 07:11:33 +0000 | |||
295 | @@ -19,11 +19,11 @@ | |||
296 | 19 | from __future__ import absolute_import | 19 | from __future__ import absolute_import |
297 | 20 | 20 | ||
298 | 21 | import logging | 21 | import logging |
299 | 22 | import uuid | ||
300 | 22 | 23 | ||
301 | 23 | from autopilot import platform | 24 | from autopilot import platform |
302 | 24 | from autopilot.matchers import Eventually | 25 | from autopilot.matchers import Eventually |
303 | 25 | from testtools.matchers import Equals | 26 | from testtools.matchers import Equals |
304 | 26 | from testtools import ExpectedException | ||
305 | 27 | 27 | ||
306 | 28 | import reminders | 28 | import reminders |
307 | 29 | from reminders import credentials, fixture_setup, tests | 29 | from reminders import credentials, fixture_setup, tests |
308 | @@ -62,12 +62,10 @@ | |||
309 | 62 | class RemindersTestCaseWithAccount(tests.RemindersAppTestCase): | 62 | class RemindersTestCaseWithAccount(tests.RemindersAppTestCase): |
310 | 63 | 63 | ||
311 | 64 | def setUp(self): | 64 | def setUp(self): |
316 | 65 | # We need to change the home dir before adding the account, otherwise | 65 | super(RemindersTestCaseWithAccount, self).setUp() |
317 | 66 | # the account will not be found when the app is opened. | 66 | no_account_dialog = self.app.main_view.no_account_dialog |
314 | 67 | _, test_type = self.get_launcher_and_type() | ||
315 | 68 | self.home_dir = self._patch_home(test_type) | ||
318 | 69 | self.add_evernote_account() | 67 | self.add_evernote_account() |
320 | 70 | super(RemindersTestCaseWithAccount, self).setUp() | 68 | no_account_dialog.wait_until_destroyed() |
321 | 71 | 69 | ||
322 | 72 | def add_evernote_account(self): | 70 | def add_evernote_account(self): |
323 | 73 | account_manager = credentials.AccountManager() | 71 | account_manager = credentials.AccountManager() |
324 | @@ -77,8 +75,24 @@ | |||
325 | 77 | account = account_manager.add_evernote_account( | 75 | account = account_manager.add_evernote_account( |
326 | 78 | 'dummy', 'dummy', oauth_token) | 76 | 'dummy', 'dummy', oauth_token) |
327 | 79 | self.addCleanup(account_manager.delete_account, account) | 77 | self.addCleanup(account_manager.delete_account, account) |
333 | 80 | 78 | del account_manager._manager | |
334 | 81 | def test_open_application_with_account(self): | 79 | del account_manager |
335 | 82 | """Test that the No account dialog is not visible.""" | 80 | |
336 | 83 | with ExpectedException(reminders.RemindersAppException): | 81 | def test_add_notebook_must_append_it_to_list(self): |
337 | 84 | self.app.main_view.no_account_dialog | 82 | test_notebook_title = 'Test notebook {}'.format(uuid.uuid1()) |
338 | 83 | |||
339 | 84 | notebooks_page = self.app.open_notebooks() | ||
340 | 85 | # FIXME delete the added notebook. Otherwise, the test account will | ||
341 | 86 | # fill up. See http://pad.lv/1318749 --elopio - 2014-05-12 | ||
342 | 87 | notebooks_page.add_notebook(test_notebook_title) | ||
343 | 88 | |||
344 | 89 | last_notebook = notebooks_page.get_notebooks()[-1] | ||
345 | 90 | # TODO there's a bug with the last updated value: http://pad.lv/1318751 | ||
346 | 91 | # so we can't check the full tuple. Uncomment this as soon as the bug | ||
347 | 92 | # is fixed. --elopio - 2014-05-12 | ||
348 | 93 | #self.assertEqual( | ||
349 | 94 | # last_notebook, | ||
350 | 95 | # (test_notebook_title, 'Last edited today', 'Private', 0)) | ||
351 | 96 | self.assertEqual(last_notebook[0], test_notebook_title) | ||
352 | 97 | self.assertEqual(last_notebook[2], 'Private') | ||
353 | 98 | self.assertEqual(last_notebook[3], 0) |
FAILED: Continuous integration, rev:137 91.189. 93.70:8080/ job/reminders- app-ci/ 344/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2612 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2612/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 151 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 151/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/reminders- app-trusty- amd64-ci/ 345 91.189. 93.70:8080/ job/reminders- app-utopic- amd64-ci/ 39
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 344/rebuild
http://