Merge lp:~mihirsoni/ubuntu-calendar-app/1188819 into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 399
Merged at revision: 402
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/1188819
Merge into: lp:ubuntu-calendar-app
Diff against target: 154 lines (+60/-11)
4 files modified
EventDetails.qml (+1/-0)
TimeLineBaseComponent.qml (+1/-0)
tests/autopilot/calendar_app/emulators.py (+32/-7)
tests/autopilot/calendar_app/tests/test_new_event.py (+26/-4)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/1188819
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs (community) Needs Fixing
Review via email: mp+230554@code.launchpad.net

Commit message

Added test case for editing an event.

Description of the change

Added test case for editing an event.

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)
394. By Mihir Soni

Pep8 formatting

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

nice work!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
395. By Mihir Soni

Added tweaks suggested by balloons

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 :
review: Needs Fixing
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Rev 402 works for me on my box

396. By Mihir Soni

Suggestion as per balloons comments

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

fixed autopilot break by adding activity monitor wait

398. By Mihir Soni

Merge from trunk

399. By Mihir Soni

resolved merge mistake

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

Lookey there, fixed the issue in trunk with not finding the event as well. Good work.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'EventDetails.qml'
--- EventDetails.qml 2014-08-14 21:04:56 +0000
+++ EventDetails.qml 2014-08-18 18:55:58 +0000
@@ -208,6 +208,7 @@
208 ToolbarButton {208 ToolbarButton {
209 action:Action {209 action:Action {
210 text: i18n.tr("Edit");210 text: i18n.tr("Edit");
211 objectName: "edit"
211 iconName: "edit";212 iconName: "edit";
212 onTriggered: {213 onTriggered: {
213 if( event.itemType === Type.EventOccurrence ) {214 if( event.itemType === Type.EventOccurrence ) {
214215
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-07-29 21:18:36 +0000
+++ TimeLineBaseComponent.qml 2014-08-18 18:55:58 +0000
@@ -65,6 +65,7 @@
6565
66 ActivityIndicator {66 ActivityIndicator {
67 visible: running67 visible: running
68 objectName : "activityIndicator"
68 running: mainModel.isLoading69 running: mainModel.isLoading
69 anchors.centerIn: parent70 anchors.centerIn: parent
70 z:271 z:2
7172
=== modified file 'tests/autopilot/calendar_app/emulators.py'
--- tests/autopilot/calendar_app/emulators.py 2014-08-02 19:21:55 +0000
+++ tests/autopilot/calendar_app/emulators.py 2014-08-18 18:55:58 +0000
@@ -128,6 +128,12 @@
128 parent_object = self128 parent_object = self
129 return parent_object.select_single("EventView")129 return parent_object.select_single("EventView")
130130
131 def get_event_details(self, parent_object=None):
132 if parent_object is None:
133 parent_object = self
134 return parent_object.select_single(EventDetails,
135 objectName='eventDetails')
136
131 def get_month_view(self, parent_object=None):137 def get_month_view(self, parent_object=None):
132 if parent_object is None:138 if parent_object is None:
133 parent_object = self139 parent_object = self
@@ -295,6 +301,11 @@
295 return self._get_event_bubbles(selected_day)301 return self._get_event_bubbles(selected_day)
296302
297 def _get_event_bubbles(self, selected_day):303 def _get_event_bubbles(self, selected_day):
304 try:
305 loading_spinner = selected_day.select_single("ActivityIndicator")
306 loading_spinner.running.wait_for(False)
307 except:
308 pass
298 event_bubbles = selected_day.select_many(EventBubble)309 event_bubbles = selected_day.select_many(EventBubble)
299 return event_bubbles310 return event_bubbles
300311
@@ -314,13 +325,7 @@
314 :return: The Event Details page.325 :return: The Event Details page.
315326
316 """327 """
317 event_bubbles = self._get_selected_day_event_bubbles()328 return self.get_event(name).open_event()
318 for bubble in event_bubbles:
319 if bubble.get_name() == name:
320 return bubble.open_event()
321 else:
322 raise CalendarException(
323 'Could not find event with name {}.'.format(name))
324329
325 @autopilot.logging.log_action(logger.info)330 @autopilot.logging.log_action(logger.info)
326 def delete_event(self, name):331 def delete_event(self, name):
@@ -334,6 +339,14 @@
334 return event_details_page.delete()339 return event_details_page.delete()
335340
336 @autopilot.logging.log_action(logger.info)341 @autopilot.logging.log_action(logger.info)
342 def edit_event(self, name):
343 """Edit an event.
344 :param name:The name of event to edit
345 :return : event details page. """
346 event_details_page = self.open_event(name)
347 return event_details_page.edit()
348
349 @autopilot.logging.log_action(logger.info)
337 def get_day_header(self, day=None):350 def get_day_header(self, day=None):
338 """Return the dayheader for a given day. If no day is given,351 """Return the dayheader for a given day. If no day is given,
339 return the current day.352 return the current day.
@@ -547,6 +560,18 @@
547560
548 return root.select_single(DayView, objectName='dayViewPage')561 return root.select_single(DayView, objectName='dayViewPage')
549562
563 @autopilot.logging.log_action(logger.debug)
564 def edit(self):
565 """Click the Edit button.
566
567 :return: The Edit page.
568
569 """
570 root = self.get_root_instance()
571 header = root.select_single(MainView).get_header()
572 header.click_action_button('edit')
573 return root.select_single(NewEvent, objectName='newEventPage')
574
550 def get_event_information(self):575 def get_event_information(self):
551 """Return the information of the event."""576 """Return the information of the event."""
552 calendar = self._get_calendar()577 calendar = self._get_calendar()
553578
=== modified file 'tests/autopilot/calendar_app/tests/test_new_event.py'
--- tests/autopilot/calendar_app/tests/test_new_event.py 2014-07-31 19:39:04 +0000
+++ tests/autopilot/calendar_app/tests/test_new_event.py 2014-08-18 18:55:58 +0000
@@ -67,6 +67,15 @@
6767
68 return day_view, test_event68 return day_view, test_event
6969
70 def _edit_event(self, event_name):
71 test_event = data.Event.make_unique()
72 day_view = self.main_view.go_to_day_view()
73
74 new_event_page = day_view.edit_event(event_name)
75
76 new_event_page.add_event(test_event)
77 return day_view, test_event
78
70 def _event_exists(self, event_name):79 def _event_exists(self, event_name):
71 try:80 try:
72 day_view = self.main_view.go_to_day_view()81 day_view = self.main_view.go_to_day_view()
@@ -90,9 +99,8 @@
90 """Test adding a new event with the default values.99 """Test adding a new event with the default values.
91100
92 The event must be created on the currently selected date,101 The event must be created on the currently selected date,
93 with an end time, without recurrence and without reminders.102 with an end time, without recurrence and without reminders."""
94103
95 """
96 day_view, test_event = self._add_event()104 day_view, test_event = self._add_event()
97105
98 self.addCleanup(self._try_delete_event, test_event.name)106 self.addCleanup(self._try_delete_event, test_event.name)
@@ -113,5 +121,19 @@
113121
114 self._workaround_bug_1350605()122 self._workaround_bug_1350605()
115123
116 self.assertThat(lambda: self._event_exists(test_event.name),124 self.assertThat(
117 Eventually(Equals(False)))125 lambda: self._event_exists(
126 test_event.name), Eventually(
127 Equals(False)))
128
129 def test_edit_event_with_default_values(self):
130 """Test editing an event change unique values of an event."""
131
132 day_view, original_event = self._add_event()
133 day_view, edited_event = self._edit_event(original_event.name)
134 self.addCleanup(self._try_delete_event, edited_event.name)
135
136 event_details_page = self.main_view.get_event_details()
137
138 self.assertEqual(edited_event,
139 event_details_page.get_event_information())

Subscribers

People subscribed via source and target branches

to status/vote changes: