Merge lp:~elopio/ubuntu-calendar-app/fix1332173-swipe_to_create_new_event into lp:ubuntu-calendar-app
- fix1332173-swipe_to_create_new_event
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 347 |
Merged at revision: | 337 |
Proposed branch: | lp:~elopio/ubuntu-calendar-app/fix1332173-swipe_to_create_new_event |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
872 lines (+524/-183) 9 files modified
DeleteConfirmationDialog.qml (+2/-0) EventBubble.qml (+7/-5) EventDetails.qml (+6/-0) NewEvent.qml (+1/-0) tests/autopilot/calendar_app/data.py (+57/-0) tests/autopilot/calendar_app/emulators.py (+322/-122) tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py (+30/-0) tests/autopilot/calendar_app/tests/test_data.py (+30/-0) tests/autopilot/calendar_app/tests/test_new_event.py (+69/-56) |
To merge this branch: | bzr merge lp:~elopio/ubuntu-calendar-app/fix1332173-swipe_to_create_new_event |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicholas Skaggs (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+224735@code.launchpad.net |
Commit message
Refactored the autopilot test to add a new event. Added helpers and self tests for them.
Description of the change
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:342
http://
Executed test runs:
UNSTABLE: http://
deb: 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:342
http://
Executed test runs:
UNSTABLE: http://
deb: 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:343
http://
Executed test runs:
SUCCESS: http://
deb: 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:343
http://
Executed test runs:
SUCCESS: http://
deb: 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:343
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
Three greens in a row, and I've also ran it many times on my machine and on my phone. I'd say this is good to go.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:344
http://
Executed test runs:
SUCCESS: http://
deb: 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:346
http://
Executed test runs:
SUCCESS: http://
deb: 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:347
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'DeleteConfirmationDialog.qml' | |||
2 | --- DeleteConfirmationDialog.qml 2014-04-13 02:03:43 +0000 | |||
3 | +++ DeleteConfirmationDialog.qml 2014-06-27 16:55:37 +0000 | |||
4 | @@ -4,6 +4,7 @@ | |||
5 | 4 | 4 | ||
6 | 5 | Dialog { | 5 | Dialog { |
7 | 6 | id: dialogue | 6 | id: dialogue |
8 | 7 | objectName: "deleteConfirmationDialog" | ||
9 | 7 | 8 | ||
10 | 8 | property var event; | 9 | property var event; |
11 | 9 | 10 | ||
12 | @@ -28,6 +29,7 @@ | |||
13 | 28 | } | 29 | } |
14 | 29 | 30 | ||
15 | 30 | Button { | 31 | Button { |
16 | 32 | objectName: "deleteEventButton" | ||
17 | 31 | text: event.parentId ? i18n.tr("Delete this") : i18n.tr("Delete") | 33 | text: event.parentId ? i18n.tr("Delete this") : i18n.tr("Delete") |
18 | 32 | color: UbuntuColors.orange | 34 | color: UbuntuColors.orange |
19 | 33 | onClicked: { | 35 | onClicked: { |
20 | 34 | 36 | ||
21 | === modified file 'EventBubble.qml' | |||
22 | --- EventBubble.qml 2014-06-21 03:37:43 +0000 | |||
23 | +++ EventBubble.qml 2014-06-27 16:55:37 +0000 | |||
24 | @@ -133,8 +133,9 @@ | |||
25 | 133 | 133 | ||
26 | 134 | Label{ | 134 | Label{ |
27 | 135 | id: timeLabel | 135 | id: timeLabel |
30 | 136 | fontSize:"small"; | 136 | objectName: "timeLabel" |
31 | 137 | color:"gray" | 137 | fontSize: "small" |
32 | 138 | color: "gray" | ||
33 | 138 | width: parent.width - rect.width | 139 | width: parent.width - rect.width |
34 | 139 | } | 140 | } |
35 | 140 | Rectangle{ | 141 | Rectangle{ |
36 | @@ -147,15 +148,16 @@ | |||
37 | 147 | } | 148 | } |
38 | 148 | Label{ | 149 | Label{ |
39 | 149 | id: titleLabel | 150 | id: titleLabel |
42 | 150 | fontSize:"small"; | 151 | objectName: "titleLabel" |
43 | 151 | color:"black" | 152 | fontSize: "small" |
44 | 153 | color: "black" | ||
45 | 152 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere | 154 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
46 | 153 | width: parent.width | 155 | width: parent.width |
47 | 154 | } | 156 | } |
48 | 155 | 157 | ||
49 | 156 | Label{ | 158 | Label{ |
50 | 157 | id: descriptionLabel | 159 | id: descriptionLabel |
52 | 158 | fontSize:"small"; | 160 | fontSize: "small" |
53 | 159 | color:"gray" | 161 | color:"gray" |
54 | 160 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere | 162 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
55 | 161 | width: parent.width | 163 | width: parent.width |
56 | 162 | 164 | ||
57 | === modified file 'EventDetails.qml' | |||
58 | --- EventDetails.qml 2014-05-27 11:28:27 +0000 | |||
59 | +++ EventDetails.qml 2014-06-27 16:55:37 +0000 | |||
60 | @@ -9,6 +9,7 @@ | |||
61 | 9 | 9 | ||
62 | 10 | Page { | 10 | Page { |
63 | 11 | id: root | 11 | id: root |
64 | 12 | objectName: "eventDetails" | ||
65 | 12 | 13 | ||
66 | 13 | property var event; | 14 | property var event; |
67 | 14 | property string headerColor :"black" | 15 | property string headerColor :"black" |
68 | @@ -165,6 +166,7 @@ | |||
69 | 165 | ToolbarButton { | 166 | ToolbarButton { |
70 | 166 | action:Action { | 167 | action:Action { |
71 | 167 | text: i18n.tr("Delete"); | 168 | text: i18n.tr("Delete"); |
72 | 169 | objectName: "delete" | ||
73 | 168 | iconSource: "image://theme/delete,edit-delete-symbolic" | 170 | iconSource: "image://theme/delete,edit-delete-symbolic" |
74 | 169 | onTriggered: { | 171 | onTriggered: { |
75 | 170 | var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event}); | 172 | var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event}); |
76 | @@ -274,6 +276,7 @@ | |||
77 | 274 | ThinDivider{} | 276 | ThinDivider{} |
78 | 275 | Label{ | 277 | Label{ |
79 | 276 | id: titleLabel | 278 | id: titleLabel |
80 | 279 | objectName: "titleLabel" | ||
81 | 277 | fontSize: "large" | 280 | fontSize: "large" |
82 | 278 | width: parent.width | 281 | width: parent.width |
83 | 279 | wrapMode: Text.WordWrap | 282 | wrapMode: Text.WordWrap |
84 | @@ -281,6 +284,7 @@ | |||
85 | 281 | } | 284 | } |
86 | 282 | Label{ | 285 | Label{ |
87 | 283 | id: descLabel | 286 | id: descLabel |
88 | 287 | objectName: "descriptionLabel" | ||
89 | 284 | wrapMode: Text.WordWrap | 288 | wrapMode: Text.WordWrap |
90 | 285 | fontSize: "small" | 289 | fontSize: "small" |
91 | 286 | width: parent.width | 290 | width: parent.width |
92 | @@ -293,6 +297,7 @@ | |||
93 | 293 | } | 297 | } |
94 | 294 | Label{ | 298 | Label{ |
95 | 295 | id: locationLabel | 299 | id: locationLabel |
96 | 300 | objectName: "locationLabel" | ||
97 | 296 | fontSize: "medium" | 301 | fontSize: "medium" |
98 | 297 | width: parent.width | 302 | width: parent.width |
99 | 298 | wrapMode: Text.WordWrap | 303 | wrapMode: Text.WordWrap |
100 | @@ -322,6 +327,7 @@ | |||
101 | 322 | //Guest Entery Model starts | 327 | //Guest Entery Model starts |
102 | 323 | Column{ | 328 | Column{ |
103 | 324 | id: contactList | 329 | id: contactList |
104 | 330 | objectName: 'contactList' | ||
105 | 325 | spacing: units.gu(1) | 331 | spacing: units.gu(1) |
106 | 326 | width: parent.width | 332 | width: parent.width |
107 | 327 | clip: true | 333 | clip: true |
108 | 328 | 334 | ||
109 | === modified file 'NewEvent.qml' | |||
110 | --- NewEvent.qml 2014-06-19 13:21:24 +0000 | |||
111 | +++ NewEvent.qml 2014-06-27 16:55:37 +0000 | |||
112 | @@ -11,6 +11,7 @@ | |||
113 | 11 | 11 | ||
114 | 12 | Page { | 12 | Page { |
115 | 13 | id: root | 13 | id: root |
116 | 14 | objectName: 'newEventPage' | ||
117 | 14 | property var date; | 15 | property var date; |
118 | 15 | 16 | ||
119 | 16 | property var event:null; | 17 | property var event:null; |
120 | 17 | 18 | ||
121 | === added file 'tests/autopilot/calendar_app/data.py' | |||
122 | --- tests/autopilot/calendar_app/data.py 1970-01-01 00:00:00 +0000 | |||
123 | +++ tests/autopilot/calendar_app/data.py 2014-06-27 16:55:37 +0000 | |||
124 | @@ -0,0 +1,57 @@ | |||
125 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
126 | 2 | # | ||
127 | 3 | # Copyright (C) 2014 Canonical Ltd | ||
128 | 4 | # | ||
129 | 5 | # This program is free software: you can redistribute it and/or modify | ||
130 | 6 | # it under the terms of the GNU General Public License version 3 as | ||
131 | 7 | # published by the Free Software Foundation. | ||
132 | 8 | # | ||
133 | 9 | # This program is distributed in the hope that it will be useful, | ||
134 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
135 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
136 | 12 | # GNU General Public License for more details. | ||
137 | 13 | # | ||
138 | 14 | # You should have received a copy of the GNU General Public License | ||
139 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
140 | 16 | |||
141 | 17 | import uuid | ||
142 | 18 | |||
143 | 19 | |||
144 | 20 | class DataMixin(object): | ||
145 | 21 | |||
146 | 22 | """Mixin with common methods for data objects.""" | ||
147 | 23 | |||
148 | 24 | def __repr__(self): | ||
149 | 25 | return '%s(%r)' % (self.__class__, self.__dict__) | ||
150 | 26 | |||
151 | 27 | def __eq__(self, other): | ||
152 | 28 | return (isinstance(other, self.__class__) and | ||
153 | 29 | self.__dict__ == other.__dict__) | ||
154 | 30 | |||
155 | 31 | def __ne__(self, other): | ||
156 | 32 | return not self.__eq__(other) | ||
157 | 33 | |||
158 | 34 | |||
159 | 35 | class Event(DataMixin): | ||
160 | 36 | |||
161 | 37 | """Event data object for user acceptance tests.""" | ||
162 | 38 | |||
163 | 39 | def __init__(self, name, description, location, guests): | ||
164 | 40 | # TODO add start date and end date, is all day event, recurrence and | ||
165 | 41 | # reminders. --elopio - 2014-06-26 | ||
166 | 42 | super(Event, self).__init__() | ||
167 | 43 | self.name = name | ||
168 | 44 | self.description = description | ||
169 | 45 | self.location = location | ||
170 | 46 | self.guests = guests | ||
171 | 47 | |||
172 | 48 | @classmethod | ||
173 | 49 | def make_unique(cls, unique_id=None): | ||
174 | 50 | """Return a unique event.""" | ||
175 | 51 | if unique_id is None: | ||
176 | 52 | unique_id = str(uuid.uuid1()) | ||
177 | 53 | name = 'Test event {}'.format(unique_id) | ||
178 | 54 | description = 'Test description {}.'.format(unique_id) | ||
179 | 55 | location = 'Test location {}'.format(unique_id) | ||
180 | 56 | guests = ['Test guest {} 1'.format(unique_id)] | ||
181 | 57 | return cls(name, description, location, guests) | ||
182 | 0 | 58 | ||
183 | === modified file 'tests/autopilot/calendar_app/emulators.py' | |||
184 | --- tests/autopilot/calendar_app/emulators.py 2014-06-26 18:10:28 +0000 | |||
185 | +++ tests/autopilot/calendar_app/emulators.py 2014-06-27 16:55:37 +0000 | |||
186 | @@ -15,20 +15,28 @@ | |||
187 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
188 | 16 | 16 | ||
189 | 17 | """Calendar app autopilot emulators.""" | 17 | """Calendar app autopilot emulators.""" |
190 | 18 | |||
191 | 19 | import logging | ||
192 | 18 | from time import sleep | 20 | from time import sleep |
193 | 19 | 21 | ||
197 | 20 | from autopilot.introspection import dbus | 22 | import autopilot.logging |
198 | 21 | 23 | from dateutil import tz | |
199 | 22 | 24 | ||
200 | 25 | import ubuntuuitoolkit | ||
201 | 23 | from ubuntuuitoolkit import ( | 26 | from ubuntuuitoolkit import ( |
202 | 24 | emulators as toolkit_emulators, | 27 | emulators as toolkit_emulators, |
203 | 25 | pickers | 28 | pickers |
204 | 26 | ) | 29 | ) |
210 | 27 | from dateutil import tz | 30 | |
211 | 28 | 31 | from calendar_app import data | |
212 | 29 | 32 | ||
213 | 30 | class NewEventEntryField(toolkit_emulators.TextField): | 33 | |
214 | 31 | """Autopilot helper for the NewEventEntryField component.""" | 34 | logger = logging.getLogger(__name__) |
215 | 35 | |||
216 | 36 | |||
217 | 37 | class CalendarException(ubuntuuitoolkit.ToolkitException): | ||
218 | 38 | |||
219 | 39 | """Exception raised when there are problems with the Calendar.""" | ||
220 | 32 | 40 | ||
221 | 33 | 41 | ||
222 | 34 | # for now we are borrowing the textfield helper for the textarea | 42 | # for now we are borrowing the textfield helper for the textarea |
223 | @@ -40,9 +48,32 @@ | |||
224 | 40 | 48 | ||
225 | 41 | class MainView(toolkit_emulators.MainView): | 49 | class MainView(toolkit_emulators.MainView): |
226 | 42 | 50 | ||
230 | 43 | """ | 51 | """An emulator that makes it easy to interact with the calendar-app.""" |
231 | 44 | An emulator class that makes it easy to interact with the calendar-app. | 52 | |
232 | 45 | """ | 53 | @autopilot.logging.log_action(logger.info) |
233 | 54 | def go_to_day_view(self): | ||
234 | 55 | """Open the day view. | ||
235 | 56 | |||
236 | 57 | :return: The Day View page. | ||
237 | 58 | |||
238 | 59 | """ | ||
239 | 60 | day_tab = self.select_single('Tab', objectName='dayTab') | ||
240 | 61 | if not day_tab.visible: | ||
241 | 62 | self.switch_to_tab('dayTab') | ||
242 | 63 | else: | ||
243 | 64 | logger.debug('The Day View page is already opened.') | ||
244 | 65 | return day_tab.select_single(DayView, objectName='DayView') | ||
245 | 66 | |||
246 | 67 | @autopilot.logging.log_action(logger.info) | ||
247 | 68 | def go_to_new_event(self): | ||
248 | 69 | """Open the page to add a new event. | ||
249 | 70 | |||
250 | 71 | :return: The New Event page. | ||
251 | 72 | |||
252 | 73 | """ | ||
253 | 74 | header = self.get_header() | ||
254 | 75 | header.click_action_button('neweventbutton') | ||
255 | 76 | return self.select_single(NewEvent, objectName='newEventPage') | ||
256 | 46 | 77 | ||
257 | 47 | def set_picker(self, field, mode, value): | 78 | def set_picker(self, field, mode, value): |
258 | 48 | # open picker | 79 | # open picker |
259 | @@ -85,52 +116,6 @@ | |||
260 | 85 | else: | 116 | else: |
261 | 86 | return None | 117 | return None |
262 | 87 | 118 | ||
263 | 88 | def get_new_event(self): | ||
264 | 89 | try: | ||
265 | 90 | return self.wait_select_single("NewEvent") | ||
266 | 91 | except dbus.StateNotFoundError: | ||
267 | 92 | return None | ||
268 | 93 | |||
269 | 94 | def get_new_event_name_input_box(self): | ||
270 | 95 | new_event = self.get_new_event() | ||
271 | 96 | return new_event.wait_select_single(NewEventEntryField, | ||
272 | 97 | objectName="newEventName") | ||
273 | 98 | |||
274 | 99 | def get_event_start_time_field(self): | ||
275 | 100 | new_event = self.get_new_event() | ||
276 | 101 | return new_event.wait_select_single(NewEventEntryField, | ||
277 | 102 | objectName="startTimeInput") | ||
278 | 103 | |||
279 | 104 | def get_event_start_date_field(self): | ||
280 | 105 | new_event = self.get_new_event() | ||
281 | 106 | return new_event.wait_select_single(NewEventEntryField, | ||
282 | 107 | objectName="startDateInput") | ||
283 | 108 | |||
284 | 109 | def get_event_end_date_field(self): | ||
285 | 110 | new_event = self.get_new_event() | ||
286 | 111 | return new_event.wait_select_single(NewEventEntryField, | ||
287 | 112 | objectName="endDateInput") | ||
288 | 113 | |||
289 | 114 | def get_event_end_time_field(self): | ||
290 | 115 | new_event = self.get_new_event() | ||
291 | 116 | return new_event.wait_select_single(NewEventEntryField, | ||
292 | 117 | objectName="endTimeInput") | ||
293 | 118 | |||
294 | 119 | def get_event_location_field(self): | ||
295 | 120 | new_event = self.get_new_event() | ||
296 | 121 | return new_event.wait_select_single(NewEventEntryField, | ||
297 | 122 | objectName="eventLocationInput") | ||
298 | 123 | |||
299 | 124 | def get_event_people_field(self): | ||
300 | 125 | new_event = self.get_new_event() | ||
301 | 126 | return new_event.wait_select_single(NewEventEntryField, | ||
302 | 127 | objectName="eventPeopleInput") | ||
303 | 128 | |||
304 | 129 | def get_event_description_field(self): | ||
305 | 130 | new_event = self.get_new_event() | ||
306 | 131 | return new_event.wait_select_single(TextArea, | ||
307 | 132 | objectName="eventDescriptionInput") | ||
308 | 133 | |||
309 | 134 | def safe_swipe_view(self, direction, view, date): | 119 | def safe_swipe_view(self, direction, view, date): |
310 | 135 | """ | 120 | """ |
311 | 136 | direction: direction to swip | 121 | direction: direction to swip |
312 | @@ -176,74 +161,289 @@ | |||
313 | 176 | return component.wait_select_single( | 161 | return component.wait_select_single( |
314 | 177 | "Label", objectName="monthLabel").text | 162 | "Label", objectName="monthLabel").text |
315 | 178 | 163 | ||
316 | 179 | def get_num_events(self): | ||
317 | 180 | return len(self.select_many("EventBubble")) | ||
318 | 181 | |||
319 | 182 | def get_event(self, title): | ||
320 | 183 | """ Return an event by title | ||
321 | 184 | """ | ||
322 | 185 | events = self.select_many("EventBubble") | ||
323 | 186 | for event in events: | ||
324 | 187 | try: | ||
325 | 188 | event_found = event.select_single("Label", text=title) | ||
326 | 189 | except: | ||
327 | 190 | continue | ||
328 | 191 | if event_found: | ||
329 | 192 | return event | ||
330 | 193 | |||
331 | 194 | return 0 | ||
332 | 195 | |||
333 | 196 | def get_new_event_save_button(self): | ||
334 | 197 | new_event = self.get_new_event() | ||
335 | 198 | return new_event.wait_select_single("Button", | ||
336 | 199 | objectName="accept") | ||
337 | 200 | |||
338 | 201 | def get_new_event_cancel_button(self): | ||
339 | 202 | new_event = self.get_new_event() | ||
340 | 203 | return new_event.wait_select_single("Button", | ||
341 | 204 | objectName="cancel") | ||
342 | 205 | |||
343 | 206 | def to_local_date(self, date): | 164 | def to_local_date(self, date): |
344 | 207 | utc = date.replace(tzinfo=tz.tzutc()) | 165 | utc = date.replace(tzinfo=tz.tzutc()) |
345 | 208 | local = utc.astimezone(tz.tzlocal()) | 166 | local = utc.astimezone(tz.tzlocal()) |
346 | 209 | return local | 167 | return local |
347 | 210 | 168 | ||
348 | 211 | 169 | ||
387 | 212 | class Page(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | 170 | class DayView(toolkit_emulators.UbuntuUIToolkitEmulatorBase): |
388 | 213 | """Autopilot helper for Pages.""" | 171 | |
389 | 214 | 172 | """Autopilot helper for the Day View page.""" | |
390 | 215 | def __init__(self, *args): | 173 | |
391 | 216 | super(Page, self).__init__(*args) | 174 | def get_events(self, filter_duplicates=False): |
392 | 217 | # XXX we need a better way to keep reference to the main view. | 175 | """Return the events for this day. |
393 | 218 | # --elopio - 2014-01-31 | 176 | |
394 | 219 | self.main_view = self.get_root_instance().select_single(MainView) | 177 | :return: A list with the events. Each event is a tuple with name, start |
395 | 220 | 178 | time and end time. | |
396 | 221 | def drag_page_up(self): | 179 | |
397 | 222 | """Drag the given page up.""" | 180 | """ |
398 | 223 | self._drag_page(direction='up') | 181 | event_bubbles = self._get_selected_day_event_bubbles(filter_duplicates) |
399 | 224 | 182 | ||
400 | 225 | def drag_page_down(self): | 183 | # sort by y, x |
401 | 226 | """Drag the given page down.""" | 184 | event_bubbles = sorted( |
402 | 227 | self._drag_page(direction='down') | 185 | event_bubbles, |
403 | 228 | 186 | key=lambda bubble: (bubble.globalRect.y, bubble.globalRect.x)) | |
404 | 229 | def _drag_page(self, direction): | 187 | |
405 | 230 | """Function to drag the page up/down.""" | 188 | events = [] |
406 | 231 | self._wait_to_stop_moving() | 189 | for event in event_bubbles: |
407 | 232 | 190 | events.append(event.get_information()) | |
408 | 233 | x, y, w, h = self.globalRect | 191 | |
409 | 234 | start_x = stop_x = x + (w / 2) | 192 | return events |
410 | 235 | start_y = y + (h / 2) | 193 | |
411 | 236 | 194 | def _get_current_day_component(self): | |
412 | 237 | if direction == "down": | 195 | components = self.select_many('TimeLineBaseComponent') |
413 | 238 | stop_y = start_y + h / 3 | 196 | for component in components: |
414 | 239 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | 197 | if (self.currentDay.datetime.date() == |
415 | 240 | else: | 198 | component.startDay.datetime.date()): |
416 | 241 | stop_y = start_y - h / 3 | 199 | return component |
417 | 242 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | 200 | else: |
418 | 243 | 201 | raise CalendarException( | |
419 | 244 | self._wait_to_stop_moving() | 202 | 'Could not find the current day component.') |
420 | 245 | 203 | ||
421 | 246 | def _wait_to_stop_moving(self): | 204 | def _get_selected_day_event_bubbles(self, filter_duplicates): |
422 | 247 | self.select_single( | 205 | selected_day = self._get_current_day_component() |
423 | 248 | 'QQuickFlickable', | 206 | return self._get_event_bubbles(selected_day, filter_duplicates) |
424 | 249 | objectName='animationContainer').moving.wait_for(False) | 207 | |
425 | 208 | def _get_event_bubbles(self, selected_day, filter_duplicates): | ||
426 | 209 | event_bubbles = selected_day.select_many(EventBubble) | ||
427 | 210 | if filter_duplicates: | ||
428 | 211 | # XXX remove this once bug http://pad.lv/1334833 is fixed. | ||
429 | 212 | # --elopio - 2014-06-26 | ||
430 | 213 | separator_id = selected_day.select_single( | ||
431 | 214 | 'QQuickRectangle', objectName='separator').id | ||
432 | 215 | event_bubbles = self._remove_duplicate_events( | ||
433 | 216 | separator_id, event_bubbles) | ||
434 | 217 | return event_bubbles | ||
435 | 218 | |||
436 | 219 | def _remove_duplicate_events(self, separator_id, event_bubbles): | ||
437 | 220 | events = [] | ||
438 | 221 | for bubble in event_bubbles: | ||
439 | 222 | if bubble.id > separator_id: | ||
440 | 223 | events.append(bubble) | ||
441 | 224 | |||
442 | 225 | return events | ||
443 | 226 | |||
444 | 227 | @autopilot.logging.log_action(logger.info) | ||
445 | 228 | def open_event(self, name, filter_duplicates=False): | ||
446 | 229 | """Open an event. | ||
447 | 230 | |||
448 | 231 | :param name: The name of the event to open. | ||
449 | 232 | :return: The Event Details page. | ||
450 | 233 | |||
451 | 234 | """ | ||
452 | 235 | event_bubbles = self._get_selected_day_event_bubbles(filter_duplicates) | ||
453 | 236 | for bubble in event_bubbles: | ||
454 | 237 | if bubble.get_name() == name: | ||
455 | 238 | return bubble.open_event() | ||
456 | 239 | else: | ||
457 | 240 | raise CalendarException( | ||
458 | 241 | 'Could not find event with name {}.'.format(name)) | ||
459 | 242 | |||
460 | 243 | @autopilot.logging.log_action(logger.info) | ||
461 | 244 | def delete_event(self, name, filter_duplicates=False): | ||
462 | 245 | """Delete an event. | ||
463 | 246 | |||
464 | 247 | :param name: The name of the event to delete. | ||
465 | 248 | :return: The Day View page. | ||
466 | 249 | |||
467 | 250 | """ | ||
468 | 251 | event_details_page = self.open_event(name, filter_duplicates) | ||
469 | 252 | return event_details_page.delete() | ||
470 | 253 | |||
471 | 254 | |||
472 | 255 | class EventBubble(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
473 | 256 | |||
474 | 257 | """Autopiot helper for the Event Bubble items.""" | ||
475 | 258 | |||
476 | 259 | def get_information(self): | ||
477 | 260 | """Return a tuple with the name, start time and end time.""" | ||
478 | 261 | name = self.get_name() | ||
479 | 262 | start_time, end_time = self._get_start_and_end_time() | ||
480 | 263 | return name, start_time, end_time | ||
481 | 264 | |||
482 | 265 | def _get_start_and_end_time(self): | ||
483 | 266 | """Return a tuple with the start time and end time.""" | ||
484 | 267 | time_label = self.select_single('Label', objectName='timeLabel') | ||
485 | 268 | start_time, end_time = time_label.text.split(' - ') | ||
486 | 269 | return start_time, end_time | ||
487 | 270 | |||
488 | 271 | def get_name(self): | ||
489 | 272 | """Return the event name.""" | ||
490 | 273 | title_label = self.select_single('Label', objectName='titleLabel') | ||
491 | 274 | return title_label.text | ||
492 | 275 | |||
493 | 276 | @autopilot.logging.log_action(logger.info) | ||
494 | 277 | def open_event(self): | ||
495 | 278 | """Open the event. | ||
496 | 279 | |||
497 | 280 | :return: The Event Details page. | ||
498 | 281 | |||
499 | 282 | """ | ||
500 | 283 | # If there are too many events, the center of the bubble | ||
501 | 284 | # might be hidden by another event. Click the left side of the | ||
502 | 285 | # bubble. | ||
503 | 286 | left = self.globalRect.x + 5 | ||
504 | 287 | center_y = self.globalRect.y + self.globalRect.height // 2 | ||
505 | 288 | self.pointing_device.move(left, center_y) | ||
506 | 289 | self.pointing_device.click() | ||
507 | 290 | return self.get_root_instance().select_single( | ||
508 | 291 | EventDetails, objectName='eventDetails') | ||
509 | 292 | |||
510 | 293 | |||
511 | 294 | class NewEvent(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
512 | 295 | |||
513 | 296 | """Autopilot helper for the New Event page.""" | ||
514 | 297 | |||
515 | 298 | @autopilot.logging.log_action(logger.info) | ||
516 | 299 | def add_event(self, event_information): | ||
517 | 300 | """Add a new event. | ||
518 | 301 | |||
519 | 302 | :param event_information: Values of the event to fill the form. | ||
520 | 303 | :type event_information: data object with the attributes name, | ||
521 | 304 | description, location and guests. | ||
522 | 305 | :return: The Day View page. | ||
523 | 306 | |||
524 | 307 | """ | ||
525 | 308 | self._fill_form(event_information) | ||
526 | 309 | self._save() | ||
527 | 310 | return self.get_root_instance().select_single( | ||
528 | 311 | DayView, objectName='DayView') | ||
529 | 312 | |||
530 | 313 | @autopilot.logging.log_action(logger.debug) | ||
531 | 314 | def _fill_form(self, event_information): | ||
532 | 315 | """Fill the add event form. | ||
533 | 316 | |||
534 | 317 | :param event_information: Values of the event to fill the form. | ||
535 | 318 | :type event_information: data object with the attributes name, | ||
536 | 319 | description, location and guests. | ||
537 | 320 | |||
538 | 321 | """ | ||
539 | 322 | # TODO fill start date and end date, is all day event, recurrence and | ||
540 | 323 | # reminders. --elopio - 2014-06-26 | ||
541 | 324 | if event_information.name is not None: | ||
542 | 325 | self._fill_name(event_information.name) | ||
543 | 326 | if event_information.description is not None: | ||
544 | 327 | self._fill_description(event_information.description) | ||
545 | 328 | if event_information.location is not None: | ||
546 | 329 | self._fill_location(event_information.location) | ||
547 | 330 | if event_information.guests is not None: | ||
548 | 331 | self._fill_guests(event_information.guests) | ||
549 | 332 | |||
550 | 333 | def _fill_name(self, value): | ||
551 | 334 | self._ensure_entry_field_visible_and_write('newEventName', value) | ||
552 | 335 | |||
553 | 336 | def _ensure_entry_field_visible_and_write(self, object_name, value): | ||
554 | 337 | name_text_field = self._get_new_event_entry_field(object_name) | ||
555 | 338 | self._ensure_visible_and_write(name_text_field, value) | ||
556 | 339 | |||
557 | 340 | def _get_new_event_entry_field(self, object_name): | ||
558 | 341 | return self.select_single(NewEventEntryField, objectName=object_name) | ||
559 | 342 | |||
560 | 343 | def _ensure_visible_and_write(self, text_field, value): | ||
561 | 344 | text_field.swipe_into_view() | ||
562 | 345 | text_field.write(value) | ||
563 | 346 | |||
564 | 347 | def _fill_description(self, value): | ||
565 | 348 | description_text_area = self._get_description_text_area() | ||
566 | 349 | self._ensure_visible_and_write(description_text_area, value) | ||
567 | 350 | |||
568 | 351 | def _get_description_text_area(self): | ||
569 | 352 | return self.select_single(TextArea, objectName='eventDescriptionInput') | ||
570 | 353 | |||
571 | 354 | def _fill_location(self, value): | ||
572 | 355 | self._ensure_entry_field_visible_and_write('eventLocationInput', value) | ||
573 | 356 | |||
574 | 357 | def _fill_guests(self, value): | ||
575 | 358 | if len(value) > 1: | ||
576 | 359 | # See bug http://pad.lv/1295941 | ||
577 | 360 | raise CalendarException( | ||
578 | 361 | 'It is not yet possible to add more than one guest.') | ||
579 | 362 | self._ensure_entry_field_visible_and_write( | ||
580 | 363 | 'eventPeopleInput', value[0]) | ||
581 | 364 | |||
582 | 365 | def _get_form_values(self): | ||
583 | 366 | # TODO get start date and end date, is all day event, recurrence and | ||
584 | 367 | # reminders. --elopio - 2014-06-26 | ||
585 | 368 | name = self._get_new_event_entry_field('newEventName').text | ||
586 | 369 | description = self._get_description_text_area().text | ||
587 | 370 | location = self._get_new_event_entry_field('eventLocationInput').text | ||
588 | 371 | # TODO once bug http://pad.lv/1295941 is fixed, we will have to build | ||
589 | 372 | # the list of guests. --elopio - 2014-06-26 | ||
590 | 373 | guests = [self._get_new_event_entry_field('eventPeopleInput').text] | ||
591 | 374 | return data.Event(name, description, location, guests) | ||
592 | 375 | |||
593 | 376 | @autopilot.logging.log_action(logger.info) | ||
594 | 377 | def _save(self): | ||
595 | 378 | """Save the new event.""" | ||
596 | 379 | save_button = self.select_single('Button', objectName='accept') | ||
597 | 380 | self.pointing_device.click_object(save_button) | ||
598 | 381 | |||
599 | 382 | |||
600 | 383 | class NewEventEntryField(toolkit_emulators.TextField): | ||
601 | 384 | |||
602 | 385 | """Autopilot helper for the NewEventEntryField component.""" | ||
603 | 386 | |||
604 | 387 | |||
605 | 388 | class EventDetails(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
606 | 389 | |||
607 | 390 | """Autopilot helper for the Event Details page.""" | ||
608 | 391 | |||
609 | 392 | @autopilot.logging.log_action(logger.debug) | ||
610 | 393 | def delete(self): | ||
611 | 394 | """Click the delete button. | ||
612 | 395 | |||
613 | 396 | :return: The Day View page. | ||
614 | 397 | |||
615 | 398 | """ | ||
616 | 399 | root = self.get_root_instance() | ||
617 | 400 | header = root.select_single(MainView).get_header() | ||
618 | 401 | header.click_action_button('delete') | ||
619 | 402 | |||
620 | 403 | delete_confirmation_dialog = root.select_single( | ||
621 | 404 | DeleteConfirmationDialog, objectName='deleteConfirmationDialog') | ||
622 | 405 | delete_confirmation_dialog.confirm_deletion() | ||
623 | 406 | |||
624 | 407 | return root.select_single(DayView, objectName='DayView') | ||
625 | 408 | |||
626 | 409 | def get_event_information(self): | ||
627 | 410 | """Return the information of the event.""" | ||
628 | 411 | name = self._get_name() | ||
629 | 412 | description = self._get_description() | ||
630 | 413 | location = self._get_location() | ||
631 | 414 | guests = self._get_guests() | ||
632 | 415 | return data.Event(name, description, location, guests) | ||
633 | 416 | |||
634 | 417 | def _get_name(self): | ||
635 | 418 | return self._get_label_text('titleLabel') | ||
636 | 419 | |||
637 | 420 | def _get_label_text(self, object_name): | ||
638 | 421 | return self.select_single('Label', objectName=object_name).text | ||
639 | 422 | |||
640 | 423 | def _get_description(self): | ||
641 | 424 | return self._get_label_text('descriptionLabel') | ||
642 | 425 | |||
643 | 426 | def _get_location(self): | ||
644 | 427 | return self._get_label_text('locationLabel') | ||
645 | 428 | |||
646 | 429 | def _get_guests(self): | ||
647 | 430 | guests = [] | ||
648 | 431 | contacts_list = self.select_single( | ||
649 | 432 | 'QQuickColumn', objectName='contactList') | ||
650 | 433 | guest_labels = contacts_list.select_many('Label') | ||
651 | 434 | for label in guest_labels: | ||
652 | 435 | guests.append(label.text) | ||
653 | 436 | |||
654 | 437 | return guests | ||
655 | 438 | |||
656 | 439 | |||
657 | 440 | class DeleteConfirmationDialog(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
658 | 441 | |||
659 | 442 | """Autopilot helper for the Delete Confirmation dialog.""" | ||
660 | 443 | |||
661 | 444 | @autopilot.logging.log_action(logger.debug) | ||
662 | 445 | def confirm_deletion(self): | ||
663 | 446 | """Confirm the deletion of the event.""" | ||
664 | 447 | delete_button = self.select_single( | ||
665 | 448 | 'Button', objectName='deleteEventButton') | ||
666 | 449 | self.pointing_device.click_object(delete_button) | ||
667 | 250 | 450 | ||
668 | === added file 'tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py' | |||
669 | --- tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py 1970-01-01 00:00:00 +0000 | |||
670 | +++ tests/autopilot/calendar_app/tests/test_custom_proxy_objects.py 2014-06-27 16:55:37 +0000 | |||
671 | @@ -0,0 +1,30 @@ | |||
672 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
673 | 2 | # | ||
674 | 3 | # Copyright (C) 2014 Canonical Ltd | ||
675 | 4 | # | ||
676 | 5 | # This program is free software: you can redistribute it and/or modify | ||
677 | 6 | # it under the terms of the GNU General Public License version 3 as | ||
678 | 7 | # published by the Free Software Foundation. | ||
679 | 8 | # | ||
680 | 9 | # This program is distributed in the hope that it will be useful, | ||
681 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
682 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
683 | 12 | # GNU General Public License for more details. | ||
684 | 13 | # | ||
685 | 14 | # You should have received a copy of the GNU General Public License | ||
686 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
687 | 16 | |||
688 | 17 | from calendar_app import data, tests | ||
689 | 18 | |||
690 | 19 | |||
691 | 20 | class NewEventFormTestCase(tests.CalendarTestCase): | ||
692 | 21 | |||
693 | 22 | def test_fill_form(self): | ||
694 | 23 | """Test that the form can be filled with event information.""" | ||
695 | 24 | test_event = data.Event.make_unique(unique_id='test uuid') | ||
696 | 25 | |||
697 | 26 | new_event_page = new_event_page = self.main_view.go_to_new_event() | ||
698 | 27 | new_event_page._fill_form(test_event) | ||
699 | 28 | |||
700 | 29 | form_values = new_event_page._get_form_values() | ||
701 | 30 | self.assertEqual(test_event, form_values) | ||
702 | 0 | 31 | ||
703 | === added file 'tests/autopilot/calendar_app/tests/test_data.py' | |||
704 | --- tests/autopilot/calendar_app/tests/test_data.py 1970-01-01 00:00:00 +0000 | |||
705 | +++ tests/autopilot/calendar_app/tests/test_data.py 2014-06-27 16:55:37 +0000 | |||
706 | @@ -0,0 +1,30 @@ | |||
707 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
708 | 2 | # | ||
709 | 3 | # Copyright (C) 2014 Canonical Ltd | ||
710 | 4 | # | ||
711 | 5 | # This program is free software: you can redistribute it and/or modify | ||
712 | 6 | # it under the terms of the GNU General Public License version 3 as | ||
713 | 7 | # published by the Free Software Foundation. | ||
714 | 8 | # | ||
715 | 9 | # This program is distributed in the hope that it will be useful, | ||
716 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
717 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
718 | 12 | # GNU General Public License for more details. | ||
719 | 13 | # | ||
720 | 14 | # You should have received a copy of the GNU General Public License | ||
721 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
722 | 16 | |||
723 | 17 | import testtools | ||
724 | 18 | |||
725 | 19 | from calendar_app import data | ||
726 | 20 | |||
727 | 21 | |||
728 | 22 | class EventTestCase(testtools.TestCase): | ||
729 | 23 | |||
730 | 24 | def test_make_unique_event_must_return_event_with_unique_id(self): | ||
731 | 25 | event = data.Event.make_unique(unique_id='test uuid') | ||
732 | 26 | |||
733 | 27 | self.assertEqual(event.name, 'Test event test uuid') | ||
734 | 28 | self.assertEqual(event.description, 'Test description test uuid.') | ||
735 | 29 | self.assertEqual(event.location, 'Test location test uuid') | ||
736 | 30 | self.assertEqual(event.guests, ['Test guest test uuid 1']) | ||
737 | 0 | 31 | ||
738 | === renamed file 'tests/autopilot/calendar_app/tests/test_calendar.py' => 'tests/autopilot/calendar_app/tests/test_new_event.py' | |||
739 | --- tests/autopilot/calendar_app/tests/test_calendar.py 2014-06-26 18:10:28 +0000 | |||
740 | +++ tests/autopilot/calendar_app/tests/test_new_event.py 2014-06-27 16:55:37 +0000 | |||
741 | @@ -17,62 +17,75 @@ | |||
742 | 17 | """Calendar app autopilot tests.""" | 17 | """Calendar app autopilot tests.""" |
743 | 18 | 18 | ||
744 | 19 | from __future__ import absolute_import | 19 | from __future__ import absolute_import |
745 | 20 | |||
746 | 21 | import logging | ||
747 | 22 | |||
748 | 20 | from autopilot.matchers import Eventually | 23 | from autopilot.matchers import Eventually |
750 | 21 | from testtools.matchers import Not, Is, NotEquals | 24 | from testtools.matchers import HasLength |
751 | 25 | |||
752 | 26 | from calendar_app import data | ||
753 | 22 | from calendar_app.tests import CalendarTestCase | 27 | from calendar_app.tests import CalendarTestCase |
754 | 23 | 28 | ||
810 | 24 | import time | 29 | |
811 | 25 | 30 | logger = logging.getLogger(__name__) | |
812 | 26 | 31 | ||
813 | 27 | class TestMainView(CalendarTestCase): | 32 | |
814 | 28 | 33 | class NewEventTestCase(CalendarTestCase): | |
815 | 29 | def test_new_event(self): | 34 | |
816 | 30 | """test add new event """ | 35 | # TODO add tests for events in the future and in the past, all day event, |
817 | 31 | # go to today | 36 | # event with recurrence and event with reminders. |
818 | 32 | self.main_view.switch_to_tab("dayTab") | 37 | # We currently can't change the date of the new event because of bug |
819 | 33 | header = self.main_view.get_header() | 38 | # http://pad.lv/1328600 on Autopilot. |
820 | 34 | header.click_action_button('todaybutton') | 39 | # --elopio - 2014-06-26 |
821 | 35 | num_events = self.main_view.get_num_events() | 40 | |
822 | 36 | 41 | def try_delete_event(self, event_name, filter_duplicates): | |
823 | 37 | # click on new event button | 42 | try: |
824 | 38 | header = self.main_view.get_header() | 43 | day_view = self.main_view.go_to_day_view() |
825 | 39 | header.click_action_button('neweventbutton') | 44 | day_view.delete_event(event_name, filter_duplicates) |
826 | 40 | self.assertThat(self.main_view.get_new_event, | 45 | except Exception as exception: |
827 | 41 | Eventually(Not(Is(None)))) | 46 | logger.warn(str(exception)) |
828 | 42 | 47 | ||
829 | 43 | # due to https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1326963 | 48 | def test_add_new_event_with_default_values(self): |
830 | 44 | # the first event triggered is ignored, so we trigger an event | 49 | """Test adding a new event with the default values. |
831 | 45 | # and a small sleep to clear before continuing input | 50 | |
832 | 46 | event_name_field = self.main_view.get_new_event_name_input_box() | 51 | The event must be created on the currently selected date, |
833 | 47 | self.pointing_device.click_object(event_name_field) | 52 | with an end time, without recurrence and without reminders. |
834 | 48 | time.sleep(1) | 53 | |
835 | 49 | 54 | """ | |
836 | 50 | # input a new event name | 55 | test_event = data.Event.make_unique() |
837 | 51 | eventTitle = "Test event " + str(int(time.time())) | 56 | |
838 | 52 | self.main_view.get_new_event_name_input_box().write(eventTitle) | 57 | day_view = self.main_view.go_to_day_view() |
839 | 53 | 58 | original_events = day_view.get_events() | |
840 | 54 | # input description | 59 | |
841 | 55 | self.main_view.get_event_description_field(). \ | 60 | new_event_page = self.main_view.go_to_new_event() |
842 | 56 | write("My favorite test event") | 61 | # XXX remove this once bug http://pad.lv/1334833 is fixed. |
843 | 57 | 62 | # --elopio - 2014-06-26 | |
844 | 58 | # input location | 63 | filter_duplicates = len(original_events) > 0 |
845 | 59 | self.main_view.get_event_location_field().write("England") | 64 | self.addCleanup( |
846 | 60 | 65 | self.try_delete_event, test_event.name, filter_duplicates) | |
847 | 61 | # input guests | 66 | day_view = new_event_page.add_event(test_event) |
848 | 62 | self.main_view.get_event_people_field().write("me, myself, and I") | 67 | |
849 | 63 | 68 | def get_new_events(): | |
850 | 64 | # todo: iterate over all combinations | 69 | return day_view.get_events(filter_duplicates) |
851 | 65 | # and include recurrence and reminders | 70 | |
852 | 66 | 71 | self.assertThat( | |
853 | 67 | # click save button | 72 | get_new_events, Eventually(HasLength(len(original_events) + 1))) |
854 | 68 | save_button = self.main_view.get_new_event_save_button() | 73 | event_details_page = day_view.open_event(test_event.name) |
855 | 69 | self.pointing_device.click_object(save_button) | 74 | self.assertEqual( |
856 | 70 | 75 | test_event, event_details_page.get_event_information()) | |
857 | 71 | # verify that the event has been created in timeline | 76 | |
858 | 72 | self.main_view.switch_to_tab("dayTab") | 77 | def test_delete_event_must_remove_it_from_day_view(self): |
859 | 73 | header = self.main_view.get_header() | 78 | """Test deleting an event must no longer show it on the day view.""" |
860 | 74 | header.click_action_button('todaybutton') | 79 | # TODO remove the skip once the bug is fixed. --elopio - 2014-06-26 |
861 | 75 | self.assertThat(self.main_view.get_num_events, | 80 | self.skipTest('This test fails because of bug http://pad.lv/1334883') |
862 | 76 | Eventually(NotEquals(num_events))) | 81 | event = data.Event.make_unique() |
863 | 77 | 82 | ||
864 | 78 | # todo: verify entered event data | 83 | day_view = self.main_view.go_to_day_view() |
865 | 84 | original_events = day_view.get_events() | ||
866 | 85 | |||
867 | 86 | new_event_page = self.main_view.go_to_new_event() | ||
868 | 87 | day_view = new_event_page.add_event(event) | ||
869 | 88 | day_view = day_view.delete_event(event.name, len(original_events) > 0) | ||
870 | 89 | |||
871 | 90 | events_after_delete = day_view.get_events() | ||
872 | 91 | self.assertEqual(original_events, events_after_delete) |
FAILED: Continuous integration, rev:341 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 567/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 679/console 91.189. 93.70:8080/ job/ubuntu- calendar- app-utopic- amd64-ci/ 125/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 567/rebuild
http://