Merge lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212 into lp:ubuntu-calendar-app

Proposed by Timo Jyrinki
Status: Rejected
Rejected by: Timo Jyrinki
Proposed branch: lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212
Merge into: lp:ubuntu-calendar-app
Diff against target: 741 lines (+266/-223)
8 files modified
DayView.qml (+3/-4)
MonthView.qml (+12/-17)
WeekView.qml (+74/-76)
YearView.qml (+63/-61)
calendar.qml (+100/-49)
tests/autopilot/calendar_app/emulators.py (+0/-3)
tests/autopilot/calendar_app/tests/__init__.py (+1/-4)
tests/autopilot/calendar_app/tests/test_calendar.py (+13/-9)
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212
Reviewer Review Type Date Requested Status
Roman Shchekin (community) Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Ubuntu Calendar Developers Pending
Review via email: mp+212422@code.launchpad.net

Commit message

Revert bzr213 that reverted bzr212, taking into account conflicts in calendar.qml and WeekView.qml.

Description of the change

The qtdeclarative upload https://launchpad.net/ubuntu/trusty/+source/qtdeclarative-opensource-src/5.2.1-3ubuntu11 fixes the crash that lead to the revert of commit 212 originally, so this should be now possible to test without getting problems.

Note that because of newer commits 217, 219 and 220 there were conflicts in WeekView.qml and calendar.qml which I tried to workaround.

The original commit that was temporarily reverted was this one:
http://bazaar.launchpad.net/~ubuntu-calendar-dev/ubuntu-calendar-app/trunk/revision/212 , in other words lp:~pkunal-parmar/ubuntu-calendar-app/LoaderPage

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

I've just manually tested on desktop going through the views, which seem to now work (I needed to adjust the curly braces in WeekView.qml a bit from my initial conflict resolve).

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
Roman Shchekin (mrqtros) wrote :

Throws a lot of errors similar to
"ReferenceError: yearView is not defined".

review: Needs Fixing
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Right. It seems to conflict with current trunk again. I think it'd be best revisited by the original author of the LoaderPage branch.

Unmerged revisions

221. By Timo Jyrinki

Revert bzr213 that reverted bzr212, taking into accound conflicts in calendar.qml and WeekView.qml.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'DayView.qml'
--- DayView.qml 2014-03-22 04:43:11 +0000
+++ DayView.qml 2014-03-24 13:57:47 +0000
@@ -4,7 +4,8 @@
4import "dateExt.js" as DateExt4import "dateExt.js" as DateExt
5import "ViewType.js" as ViewType5import "ViewType.js" as ViewType
66
7Item{7
8Page{
8 id: root9 id: root
9 objectName: "DayView"10 objectName: "DayView"
1011
@@ -13,13 +14,11 @@
1314
14 Column {15 Column {
15 id: column16 id: column
17 anchors.fill: parent
16 anchors.top: parent.top18 anchors.top: parent.top
17 anchors.topMargin: units.gu(1.5)19 anchors.topMargin: units.gu(1.5)
18 width: parent.width; height: parent.height
19 spacing: units.gu(1)20 spacing: units.gu(1)
2021
21 anchors.fill: parent
22
23 ViewHeader{22 ViewHeader{
24 id: viewHeader23 id: viewHeader
25 date: currentDay24 date: currentDay
2625
=== modified file 'MonthView.qml'
--- MonthView.qml 2014-03-19 19:46:58 +0000
+++ MonthView.qml 2014-03-24 13:57:47 +0000
@@ -3,23 +3,18 @@
3import "dateExt.js" as DateExt3import "dateExt.js" as DateExt
4import "colorUtils.js" as Color4import "colorUtils.js" as Color
55
6Page {6Page{
7 id: monthViewPage7 id: root
8 objectName: "MonthView"
98
10 property var currentMonth: DateExt.today();9 property var currentMonth: DateExt.today();
11
12 signal dateSelected(var date);10 signal dateSelected(var date);
1311
12 anchors.fill: parent
13
14 PathViewBase{14 PathViewBase{
15 id: monthViewPath15 id: monthViewPath
1616 objectName: "MonthView"
17 property var startMonth: currentMonth;17 anchors.fill: parent
18
19 anchors.top:parent.top
20
21 width:parent.width
22 height: parent.height
2318
24 onNextItemHighlighted: {19 onNextItemHighlighted: {
25 nextMonth();20 nextMonth();
@@ -30,11 +25,11 @@
30 }25 }
3126
32 function nextMonth() {27 function nextMonth() {
33 currentMonth = addMonth(currentMonth,1);28 currentMonth = addMonth(root.currentMonth,1);
34 }29 }
3530
36 function previousMonth(){31 function previousMonth(){
37 currentMonth = addMonth(currentMonth,-1);32 currentMonth = addMonth(root.currentMonth,-1);
38 }33 }
3934
40 function addMonth(date,month){35 function addMonth(date,month){
@@ -54,16 +49,16 @@
54 function getMonthDate() {49 function getMonthDate() {
55 switch( monthViewPath.indexType(index)) {50 switch( monthViewPath.indexType(index)) {
56 case 0:51 case 0:
57 return monthViewPath.startMonth;52 return monthViewPath.addMonth(root.currentMonth,0);
58 case -1:53 case -1:
59 return monthViewPath.addMonth(monthViewPath.startMonth,-1);54 return monthViewPath.addMonth(root.currentMonth,-1);
60 case 1:55 case 1:
61 return monthViewPath.addMonth(monthViewPath.startMonth,1);56 return monthViewPath.addMonth(root.currentMonth,1);
62 }57 }
63 }58 }
6459
65 onDateSelected: {60 onDateSelected: {
66 monthViewPage.dateSelected(date);61 root.dateSelected(date);
67 }62 }
68 }63 }
69 }64 }
7065
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-03-23 14:27:31 +0000
+++ WeekView.qml 2014-03-24 13:57:47 +0000
@@ -4,75 +4,87 @@
4import "dateExt.js" as DateExt4import "dateExt.js" as DateExt
5import "ViewType.js" as ViewType5import "ViewType.js" as ViewType
66
7Column {7Page{
8 id: root8 id: root
9 objectName: "WeekView"
10
11 property var dayStart: new Date();9 property var dayStart: new Date();
12 property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);10 property var firstDay: dayStart.weekStart(Qt.locale().firstDayOfWeek);
13 property bool isCurrentPage: false11 property bool isCurrentPage: false
1412
15 anchors.top: parent.top13 Column {
16 anchors.topMargin: units.gu(1.5)14 objectName: "WeekView"
17 spacing: units.gu(1)15
1816 anchors.fill: parent
19 anchors.fill: parent17 anchors.top: parent.top
2018 anchors.topMargin: units.gu(1.5)
21 ViewHeader{19 spacing: units.gu(1)
22 id: viewHeader20
23 date: dayStart21 ViewHeader{
24 }22 id: viewHeader
2523 date: dayStart
26 TimeLineHeader{24 }
27 id: weekHeader25
28 objectName: "weekHeader"26 TimeLineHeader{
29 type: ViewType.ViewTypeWeek27 id: weekHeader
30 date: weekViewPath.weekStart28 objectName: "weekHeader"
31 }29 type: typeWeek
3230 date: weekViewPath.weekStart
33 PathViewBase{31 }
34 id: weekViewPath32
3533 PathViewBase{
36 property var visibleWeek: dayStart.weekStart(Qt.locale().firstDayOfWeek);34 id: weekViewPath
37 property var weekStart: weekViewPath.visibleWeek35
3836 //This is used to scroll all view together when currentItem scrolls
39 width: parent.width37 property var childContentY;
40 height: root.height - weekViewPath.y38
4139 property var visibleWeek: root.dayStart.weekStart(Qt.locale().firstDayOfWeek);
42 //This is used to scroll all view together when currentItem scrolls40 property var weekStart: weekViewPath.visibleWeek
43 property var childContentY;
44
45 onNextItemHighlighted: {
46 nextWeek();
47 weekHeader.incrementCurrentIndex()
48 }
49
50 onPreviousItemHighlighted: {
51 previousWeek();
52 weekHeader.decrementCurrentIndex()
53 }
54
55 function nextWeek() {
56 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
57 dayStart = weekStartDay.addDays(7);
58 }
59
60 function previousWeek(){
61 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
62 dayStart = weekStartDay.addDays(-7);
63 }
64
65 delegate: TimeLineBaseComponent {
66 id: timeLineView
67
68 type: ViewType.ViewTypeWeek
6941
70 width: parent.width42 width: parent.width
71 height: parent.height43 height: root.height - weekViewPath.y
7244
73 startDay: getWeekStart();45 onNextItemHighlighted: {
7446 nextWeek();
75 Connections{47 weekHeader.incrementCurrentIndex()
48 }
49
50 onPreviousItemHighlighted: {
51 previousWeek();
52 weekHeader.decrementCurrentIndex()
53 }
54
55 function nextWeek() {
56 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
57 dayStart = weekStartDay.addDays(7);
58 }
59
60 function previousWeek(){
61 var weekStartDay = visibleWeek.weekStart(Qt.locale().firstDayOfWeek);
62 dayStart = weekStartDay.addDays(-7);
63 }
64
65 delegate: TimeLineBaseComponent {
66 id: timeLineView
67
68 type: typeWeek
69
70 width: parent.width
71 height: parent.height
72 startDay: getWeekStart();
73
74 function getWeekStart() {
75 switch( weekViewPath.indexType(index)) {
76 case 0:
77 return weekViewPath.weekStart;
78 case -1:
79 var weekStartDay= weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
80 return weekStartDay.addDays(-7);
81 case 1:
82 var weekStartDay = weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
83 return weekStartDay.addDays(7);
84 }
85 }
86 }
87 Connections{
76 target: root88 target: root
77 onIsCurrentPageChanged:{89 onIsCurrentPageChanged:{
78 if(root.isCurrentPage){90 if(root.isCurrentPage){
@@ -97,20 +109,6 @@
97 when: timeLineView.PathView.isCurrentItem109 when: timeLineView.PathView.isCurrentItem
98 }110 }
99111
100 function getWeekStart() {
101 switch( weekViewPath.indexType(index)) {
102 case 0:
103 return weekViewPath.weekStart;
104 case -1:
105 var weekStartDay= weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
106 return weekStartDay.addDays(-7);
107 case 1:
108 var weekStartDay = weekViewPath.weekStart.weekStart(Qt.locale().firstDayOfWeek);
109 return weekStartDay.addDays(7);
110 }
111 }
112 }112 }
113 }113 }
114}114}
115
116
117115
=== modified file 'YearView.qml'
--- YearView.qml 2014-03-19 19:46:58 +0000
+++ YearView.qml 2014-03-24 13:57:47 +0000
@@ -3,76 +3,78 @@
33
4import "dateExt.js" as DateExt4import "dateExt.js" as DateExt
55
6PathViewBase {6Page {
7 id: root7 id: root
8 objectName: "YearView"8 objectName: "YearView"
9
10 property var currentYear: DateExt.today();9 property var currentYear: DateExt.today();
11
12 signal monthSelected(var date);10 signal monthSelected(var date);
1311
14 anchors.fill: parent12 PathViewBase {
1513 id: pathView
16 onNextItemHighlighted: {14
17 currentYear = getDateFromYear(currentYear.getFullYear() + 1);15 anchors.fill: parent
18 }16
1917 onNextItemHighlighted: {
20 onPreviousItemHighlighted: {18 root.currentYear = pathView.getDateFromYear(root.currentYear.getFullYear() + 1);
21 currentYear = getDateFromYear(currentYear.getFullYear() - 1);19 }
22 }20
2321 onPreviousItemHighlighted: {
24 function getDateFromYear(year) {22 root.currentYear = pathView.getDateFromYear(root.currentYear.getFullYear() - 1);
25 return new Date(year,0,1,0,0,0,0);23 }
26 }24
2725 function getDateFromYear(year) {
28 delegate: GridView{26 return new Date(year,0,1,0,0,0,0);
29 id: yearView27 }
30 clip: true28
3129 delegate: GridView{
32 property bool isCurrentItem: index == root.currentIndex30 id: yearView
33 property var year: getYear();31 clip: true
3432
35 function getYear() {33 property bool isCurrentItem: index == pathView.currentIndex
36 switch( root.indexType(index)) {34 property var year: getYear();
37 case 0:35
38 return currentYear;36 function getYear() {
39 case -1:37 switch( pathView.indexType(index)) {
40 return getDateFromYear(currentYear.getFullYear() - 1);38 case 0:
41 case 1:39 return root.currentYear;
42 return getDateFromYear(currentYear.getFullYear() + 1);40 case -1:
41 return pathView.getDateFromYear(root.currentYear.getFullYear() - 1);
42 case 1:
43 return pathView.getDateFromYear(root.currentYear.getFullYear() + 1);
44 }
43 }45 }
44 }46
4547 width: parent.width
46 width: parent.width48 height: parent.height
47 height: parent.height49 anchors.top: parent.top
48 anchors.top: parent.top50
4951 readonly property int minCellWidth: units.gu(30)
50 readonly property int minCellWidth: units.gu(30)52 cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
51 cellWidth: Math.floor(Math.min.apply(Math, [3, 4].map(function(n)
52 { return ((width / n >= minCellWidth) ? width / n : width / 2) })))53 { return ((width / n >= minCellWidth) ? width / n : width / 2) })))
5354
54 cellHeight: cellWidth * 1.455 cellHeight: cellWidth * 1.4
5556
56 model: 12 /* months in a year */57 model: 12 /* months in a year */
57 delegate: Item {58 delegate: Item {
58 width: yearView.cellWidth59 width: yearView.cellWidth
59 height: yearView.cellHeight60 height: yearView.cellHeight
6061
61 MonthComponent{62 MonthComponent{
62 id: monthComponent63 id: monthComponent
63 monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0)64 monthDate: new Date(yearView.year.getFullYear(),index,1,0,0,0,0)
64 anchors.fill: parent
65 anchors.margins: units.gu(0.5)
66
67 dayLabelFontSize:"x-small"
68 dateLabelFontSize: "medium"
69 monthLabelFontSize: "medium"
70 yearLabelFontSize: "small"
71
72 MouseArea{
73 anchors.fill: parent65 anchors.fill: parent
74 onClicked: {66 anchors.margins: units.gu(0.5)
75 root.monthSelected(monthComponent.monthDate);67
68 dayLabelFontSize:"x-small"
69 dateLabelFontSize: "medium"
70 monthLabelFontSize: "medium"
71 yearLabelFontSize: "small"
72
73 MouseArea{
74 anchors.fill: parent
75 onClicked: {
76 root.monthSelected(monthComponent.monthDate);
77 }
76 }78 }
77 }79 }
78 }80 }
7981
=== modified file 'calendar.qml'
--- calendar.qml 2014-03-23 14:21:46 +0000
+++ calendar.qml 2014-03-24 13:57:47 +0000
@@ -81,14 +81,16 @@
81 yearView.currentYear = tabPage.currentDay.midnight();81 yearView.currentYear = tabPage.currentDay.midnight();
82 }82 }
8383
84 if( monthView.currentMonth !== undefined && !monthView.currentMonth.isSameDay(currentDay))84 if( monthPage.item
85 monthView.currentMonth = currentDay.midnight();85 && monthPage.item.currentMonth !== undefined
8686 && !monthPage.item.currentMonth.isSameDay(currentDay))
87 if( !dayView.currentDay.isSameDay(currentDay))87 monthPage.item.currentMonth = currentDay.midnight();
88 dayView.currentDay = currentDay88
8989 if( dayPage.item && !dayPage.item.currentDay.isSameDay(currentDay))
90 if( !weekView.dayStart.isSameDay(currentDay))90 dayPage.item.currentDay = currentDay
91 weekView.dayStart = currentDay91
92 if( weekPage.item && !weekPage.item.dayStart.isSameDay(currentDay))
93 weekPage.item.dayStart = currentDay
9294
93 setStartEndDateToModel();95 setStartEndDateToModel();
94 }96 }
@@ -138,13 +140,13 @@
138 var difference = endTime - startTime;140 var difference = endTime - startTime;
139141
140 if (difference > month)142 if (difference > month)
141 return 0; // Year view143 return yearTab.index; // Year view
142 else if (difference > 7 * day)144 else if (difference > 7 * day)
143 return 1; // Month view}145 return monthTab.index; // Month view}
144 else if (difference > day)146 else if (difference > day)
145 return 2; // Week view147 return weekTab.index; // Week view
146 else148 else
147 return 3; // Day view149 return dayTab.index; // Day view
148 }150 }
149151
150 // This function parse the argument152 // This function parse the argument
@@ -183,17 +185,17 @@
183 }185 }
184 else {186 else {
185 // If no endtime has been setted, open the starttime date in day view187 // If no endtime has been setted, open the starttime date in day view
186 tabs.selectedTabIndex = 3;188 tabs.selectedTabIndex = dayTab.index;
187 }189 }
188 } // End of else if (starttime)190 } // End of else if (starttime)
189 else {191 else {
190 // Due to bug #1231558 {if (args.defaultArgument.at(0))} is always true192 // Due to bug #1231558 {if (args.defaultArgument.at(0))} is always true
191 // After the fix we can delete this else193 // After the fix we can delete this else
192 tabs.selectedTabIndex= 1;194 tabs.selectedTabIndex = monthTab.index;
193 }195 }
194 } // End of if about args.values196 } // End of if about args.values
195 else {197 else {
196 tabs.selectedTabIndex= 1;198 tabs.selectedTabIndex = monthTab.index;
197 }199 }
198200
199 globalModel = GlobalModel.globalModel();201 globalModel = GlobalModel.globalModel();
@@ -240,56 +242,95 @@
240 id: tabs242 id: tabs
241243
242 Tab{244 Tab{
245 id: yearTab
243 objectName: "yearTab"246 objectName: "yearTab"
244 title: i18n.tr("Year")247 title: i18n.tr("Year")
245 page: Page{248 page: Loader{
249 id: yearPage
246 objectName: "yearPage"250 objectName: "yearPage"
247 anchors.fill: parent251 anchors {
248 tools: commonToolBar252 top: parent.top
249 YearView{253 left: parent.left
250 id: yearView254 right: parent.right
255 bottom: parent.bottom
256 }
257 source: (tabs.selectedTab === yearTab) ? Qt.resolvedUrl("YearView.qml") : ""
258
259 onLoaded:{
260 item.tools = commonToolBar
261 }
262
263 Connections{
264 target: yearPage.item
251 onMonthSelected: {265 onMonthSelected: {
252 tabs.selectedTabIndex = 1266 tabs.selectedTabIndex = monthTab.index
253 var now = DateExt.today();267 var now = DateExt.today();
254 if( date.getMonth() === now.getMonth()268 if( date.getMonth() === now.getMonth()
255 && date.getFullYear() === now.getFullYear()) {269 && date.getFullYear() === now.getFullYear()) {
256 monthView.currentMonth = now270 tabPage.currentDay = now;
257 } else {271 } else {
258 monthView.currentMonth = date.midnight();272 tabPage.currentDay = date.midnight();
259 }273 }
260 }274 }
261 }275 }
262 }276 }
263 }277 }
278
264 Tab {279 Tab {
265 id: monthTab280 id: monthTab
266 objectName: "monthTab"281 objectName: "monthTab"
267 title: i18n.tr("Month")282 title: i18n.tr("Month")
268 page: MonthView{283
269 anchors.fill: parent284 page: Loader{
270 tools: commonToolBar285 id: monthPage
271 id: monthView286 anchors {
272287 top: parent.top
273 onDateSelected: {288 left: parent.left
274 tabs.selectedTabIndex = 3289 right: parent.right
275 tabPage.currentDay = date;290 bottom: parent.bottom
291 }
292
293 source: (tabs.selectedTab === monthTab) ? Qt.resolvedUrl("MonthView.qml") : ""
294
295 onLoaded: {
296 item.currentMonth = tabPage.currentDay.midnight();
297 item.tools = commonToolBar
298 }
299
300 Connections{
301 target: monthPage.item
302 onDateSelected: {
303 tabs.selectedTabIndex = dayTab.index
304 tabPage.currentDay = date;
305 }
276 }306 }
277 }307 }
278 }308 }
309
279 Tab{310 Tab{
280 id: weekTab311 id: weekTab
281 objectName: "weekTab"312 objectName: "weekTab"
282 title: i18n.tr("Week")313 title: i18n.tr("Week")
283 page: Page{314
284 anchors.fill: parent315 page: Loader{
285 tools: commonToolBar316 id: weekPage
286 WeekView{317 anchors {
287 id: weekView318 top: parent.top
288 anchors.fill: parent319 left: parent.left
289 isCurrentPage: tabs.selectedTab == weekTab320 right: parent.right
290321 bottom: parent.bottom
322 }
323 source: (tabs.selectedTab === weekTab) ? Qt.resolvedUrl("WeekView.qml") : ""
324
325 onLoaded: {
326 item.dayStart = tabPage.currentDay;
327 item.tools = commonToolBar
328 }
329
330 Connections{
331 target: weekPage.item
291 onDayStartChanged: {332 onDayStartChanged: {
292 tabPage.currentDay = dayStart;333 tabPage.currentDay = weekPage.item.dayStart;
293 }334 }
294 }335 }
295 }336 }
@@ -299,16 +340,26 @@
299 id: dayTab340 id: dayTab
300 objectName: "dayTab"341 objectName: "dayTab"
301 title: i18n.tr("Day")342 title: i18n.tr("Day")
302 page: Page{343
303 anchors.fill: parent344 page: Loader{
304 tools: commonToolBar345 id: dayPage
305 DayView{346 anchors {
306 id: dayView347 top: parent.top
307 anchors.fill: parent348 left: parent.left
308 isCurrentPage: tabs.selectedTab == dayTab349 right: parent.right
309350 bottom: parent.bottom
351 }
352 source: (tabs.selectedTab === dayTab) ? Qt.resolvedUrl("DayView.qml") : ""
353
354 onLoaded: {
355 item.currentDay = tabPage.currentDay;
356 item.tools = commonToolBar
357 }
358
359 Connections{
360 target: dayPage.item
310 onCurrentDayChanged: {361 onCurrentDayChanged: {
311 tabPage.currentDay = currentDay;362 tabPage.currentDay = dayPage.item.currentDay;
312 }363 }
313 }364 }
314 }365 }
315366
=== modified file 'tests/autopilot/calendar_app/emulators.py'
--- tests/autopilot/calendar_app/emulators.py 2014-03-20 02:42:05 +0000
+++ tests/autopilot/calendar_app/emulators.py 2014-03-24 13:57:47 +0000
@@ -103,6 +103,3 @@
103 def get_month_name(self, component):103 def get_month_name(self, component):
104 return component.wait_select_single(104 return component.wait_select_single(
105 "Label", objectName="monthLabel").text105 "Label", objectName="monthLabel").text
106
107 def get_num_events(self):
108 return len(self.select_many("EventBubble"))
109106
=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
--- tests/autopilot/calendar_app/tests/__init__.py 2014-03-20 16:13:43 +0000
+++ tests/autopilot/calendar_app/tests/__init__.py 2014-03-24 13:57:47 +0000
@@ -73,7 +73,6 @@
73 self.launch_test_click()73 self.launch_test_click()
7474
75 def launch_test_local(self):75 def launch_test_local(self):
76 logger.debug("Running via local installation")
77 self.app = self.launch_test_application(76 self.app = self.launch_test_application(
78 "qmlscene",77 "qmlscene",
79 self.local_location,78 self.local_location,
@@ -81,7 +80,6 @@
81 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)80 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
8281
83 def launch_test_installed(self):82 def launch_test_installed(self):
84 logger.debug("Running via installed debian package")
85 self.app = self.launch_test_application(83 self.app = self.launch_test_application(
86 "qmlscene",84 "qmlscene",
87 self.installed_location,85 self.installed_location,
@@ -89,7 +87,6 @@
89 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)87 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
9088
91 def launch_test_click(self):89 def launch_test_click(self):
92 logger.debug("Running via click package")
93 self.app = self.launch_click_package(90 self.app = self.launch_click_package(
94 "com.ubuntu.calendar",91 "com.ubuntu.calendar",
95 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)92 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
@@ -125,4 +122,4 @@
125122
126 @property123 @property
127 def main_view(self):124 def main_view(self):
128 return self.app.wait_select_single(emulators.MainView)125 return self.app.select_single(emulators.MainView)
129126
=== modified file 'tests/autopilot/calendar_app/tests/test_calendar.py'
--- tests/autopilot/calendar_app/tests/test_calendar.py 2014-03-20 03:02:48 +0000
+++ tests/autopilot/calendar_app/tests/test_calendar.py 2014-03-24 13:57:47 +0000
@@ -11,7 +11,7 @@
1111
12from autopilot.matchers import Eventually12from autopilot.matchers import Eventually
1313
14from testtools.matchers import Equals, Not, Is, NotEquals14from testtools.matchers import Equals, Not, Is
1515
16import time16import time
1717
@@ -46,10 +46,6 @@
4646
47 def test_new_event(self):47 def test_new_event(self):
48 """test add new event """48 """test add new event """
49 #go to today
50 self.main_view.switch_to_tab("dayTab")
51 self.main_view.open_toolbar().click_button("todaybutton")
52 num_events = self.main_view.get_num_events()
5349
54 #click on new event button50 #click on new event button
55 self.main_view.open_toolbar().click_button("neweventbutton")51 self.main_view.open_toolbar().click_button("neweventbutton")
@@ -72,7 +68,7 @@
72 ok = picker.select_single("Button", objectName="TimePickerOKButton")68 ok = picker.select_single("Button", objectName="TimePickerOKButton")
73 self.pointing_device.click_object(ok)69 self.pointing_device.click_object(ok)
7470
75 ## Set the end time71 # Set the end time
76 end_time_field = self.main_view.get_event_end_time_field()72 end_time_field = self.main_view.get_event_end_time_field()
77 self.pointing_device.click_object(end_time_field)73 self.pointing_device.click_object(end_time_field)
78 picker = self.main_view.get_time_picker()74 picker = self.main_view.get_time_picker()
@@ -87,10 +83,18 @@
87 self.keyboard.type("My location")83 self.keyboard.type("My location")
88 self.assertThat(location_field.text, Eventually(Equals("My location")))84 self.assertThat(location_field.text, Eventually(Equals("My location")))
8985
86 #input people
87 people_field = self.main_view.get_event_people_field()
88 self.pointing_device.click_object(people_field)
89 self.assertThat(people_field.activeFocus, Eventually(Equals(True)))
90 self.keyboard.type("Me")
91 self.assertThat(people_field.text, Eventually(Equals("Me")))
92
90 #click save button93 #click save button
91 self.main_view.open_toolbar().click_button("eventSaveButton")94 self.main_view.open_toolbar().click_button("eventSaveButton")
9295
93 #verify that the event has been created in timeline96 #verify that the event has been created in timeline
94 self.main_view.open_toolbar().click_button("todaybutton")97 self.main_view.switch_to_tab("dayTab")
95 self.assertThat(self.main_view.get_num_events,98 self.assertThat(lambda: self.main_view.get_label_with_text(
96 Eventually(NotEquals(num_events)))99 eventTitle, root=self.main_view.get_day_view()),
100 Eventually(Not(Is(None))))

Subscribers

People subscribed via source and target branches

to status/vote changes: