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
1=== modified file 'EventDetails.qml'
2--- EventDetails.qml 2014-08-14 21:04:56 +0000
3+++ EventDetails.qml 2014-08-18 18:55:58 +0000
4@@ -208,6 +208,7 @@
5 ToolbarButton {
6 action:Action {
7 text: i18n.tr("Edit");
8+ objectName: "edit"
9 iconName: "edit";
10 onTriggered: {
11 if( event.itemType === Type.EventOccurrence ) {
12
13=== modified file 'TimeLineBaseComponent.qml'
14--- TimeLineBaseComponent.qml 2014-07-29 21:18:36 +0000
15+++ TimeLineBaseComponent.qml 2014-08-18 18:55:58 +0000
16@@ -65,6 +65,7 @@
17
18 ActivityIndicator {
19 visible: running
20+ objectName : "activityIndicator"
21 running: mainModel.isLoading
22 anchors.centerIn: parent
23 z:2
24
25=== modified file 'tests/autopilot/calendar_app/emulators.py'
26--- tests/autopilot/calendar_app/emulators.py 2014-08-02 19:21:55 +0000
27+++ tests/autopilot/calendar_app/emulators.py 2014-08-18 18:55:58 +0000
28@@ -128,6 +128,12 @@
29 parent_object = self
30 return parent_object.select_single("EventView")
31
32+ def get_event_details(self, parent_object=None):
33+ if parent_object is None:
34+ parent_object = self
35+ return parent_object.select_single(EventDetails,
36+ objectName='eventDetails')
37+
38 def get_month_view(self, parent_object=None):
39 if parent_object is None:
40 parent_object = self
41@@ -295,6 +301,11 @@
42 return self._get_event_bubbles(selected_day)
43
44 def _get_event_bubbles(self, selected_day):
45+ try:
46+ loading_spinner = selected_day.select_single("ActivityIndicator")
47+ loading_spinner.running.wait_for(False)
48+ except:
49+ pass
50 event_bubbles = selected_day.select_many(EventBubble)
51 return event_bubbles
52
53@@ -314,13 +325,7 @@
54 :return: The Event Details page.
55
56 """
57- event_bubbles = self._get_selected_day_event_bubbles()
58- for bubble in event_bubbles:
59- if bubble.get_name() == name:
60- return bubble.open_event()
61- else:
62- raise CalendarException(
63- 'Could not find event with name {}.'.format(name))
64+ return self.get_event(name).open_event()
65
66 @autopilot.logging.log_action(logger.info)
67 def delete_event(self, name):
68@@ -334,6 +339,14 @@
69 return event_details_page.delete()
70
71 @autopilot.logging.log_action(logger.info)
72+ def edit_event(self, name):
73+ """Edit an event.
74+ :param name:The name of event to edit
75+ :return : event details page. """
76+ event_details_page = self.open_event(name)
77+ return event_details_page.edit()
78+
79+ @autopilot.logging.log_action(logger.info)
80 def get_day_header(self, day=None):
81 """Return the dayheader for a given day. If no day is given,
82 return the current day.
83@@ -547,6 +560,18 @@
84
85 return root.select_single(DayView, objectName='dayViewPage')
86
87+ @autopilot.logging.log_action(logger.debug)
88+ def edit(self):
89+ """Click the Edit button.
90+
91+ :return: The Edit page.
92+
93+ """
94+ root = self.get_root_instance()
95+ header = root.select_single(MainView).get_header()
96+ header.click_action_button('edit')
97+ return root.select_single(NewEvent, objectName='newEventPage')
98+
99 def get_event_information(self):
100 """Return the information of the event."""
101 calendar = self._get_calendar()
102
103=== modified file 'tests/autopilot/calendar_app/tests/test_new_event.py'
104--- tests/autopilot/calendar_app/tests/test_new_event.py 2014-07-31 19:39:04 +0000
105+++ tests/autopilot/calendar_app/tests/test_new_event.py 2014-08-18 18:55:58 +0000
106@@ -67,6 +67,15 @@
107
108 return day_view, test_event
109
110+ def _edit_event(self, event_name):
111+ test_event = data.Event.make_unique()
112+ day_view = self.main_view.go_to_day_view()
113+
114+ new_event_page = day_view.edit_event(event_name)
115+
116+ new_event_page.add_event(test_event)
117+ return day_view, test_event
118+
119 def _event_exists(self, event_name):
120 try:
121 day_view = self.main_view.go_to_day_view()
122@@ -90,9 +99,8 @@
123 """Test adding a new event with the default values.
124
125 The event must be created on the currently selected date,
126- with an end time, without recurrence and without reminders.
127+ with an end time, without recurrence and without reminders."""
128
129- """
130 day_view, test_event = self._add_event()
131
132 self.addCleanup(self._try_delete_event, test_event.name)
133@@ -113,5 +121,19 @@
134
135 self._workaround_bug_1350605()
136
137- self.assertThat(lambda: self._event_exists(test_event.name),
138- Eventually(Equals(False)))
139+ self.assertThat(
140+ lambda: self._event_exists(
141+ test_event.name), Eventually(
142+ Equals(False)))
143+
144+ def test_edit_event_with_default_values(self):
145+ """Test editing an event change unique values of an event."""
146+
147+ day_view, original_event = self._add_event()
148+ day_view, edited_event = self._edit_event(original_event.name)
149+ self.addCleanup(self._try_delete_event, edited_event.name)
150+
151+ event_details_page = self.main_view.get_event_details()
152+
153+ self.assertEqual(edited_event,
154+ event_details_page.get_event_information())

Subscribers

People subscribed via source and target branches

to status/vote changes: