Merge lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed into lp:ubuntu-calendar-app

Proposed by Carla Sella
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 628
Merged at revision: 627
Proposed branch: lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~carla-sella/ubuntu-calendar-app/dayview-test-default-view
Diff against target: 223 lines (+125/-26)
4 files modified
tests/autopilot/calendar_app/__init__.py (+23/-1)
tests/autopilot/calendar_app/tests/test_monthview.py (+9/-0)
tests/autopilot/calendar_app/tests/test_weekview.py (+83/-25)
tests/autopilot/calendar_app/tests/test_yearview.py (+10/-0)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Nicholas Skaggs (community) Needs Fixing
Mihir Soni Approve
Review via email: mp+254495@code.launchpad.net

This proposal supersedes a proposal from 2015-03-29.

Commit message

Autopilot tests for Calendar App.

Description of the change

Completing test_default_view in test_weekview.py.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Carla Sella (carla-sella) wrote : Posted in a previous version of this proposal

This can be merged if ok as checking if current day is highlighted has been completed.

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:618
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed/+merge/254495/+edit-commit-message

http://91.189.93.70:8080/job/ubuntu-calendar-app-ci/1119/
Executed test runs:
    FAILURE: http://91.189.93.70:8080/job/generic-mediumtests-utopic/2448/console
    FAILURE: http://91.189.93.70:8080/job/ubuntu-calendar-app-utopic-amd64-ci/590/console
    FAILURE: http://91.189.93.70:8080/job/ubuntu-calendar-app-vivid-amd64-ci/116/console

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/ubuntu-calendar-app-ci/1119/rebuild

review: Needs Fixing (continuous-integration)
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
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
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
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
Mihir Soni (mihirsoni) wrote :

looks good to me
Thanks :)

review: Approve
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 :

Text conflict in tests/autopilot/calendar_app/__init__.py
Text conflict in tests/autopilot/calendar_app/tests/test_dayview.py
2 conflicts encountered.
bzr: ERROR: Conflicts from merge

Should be a simple fix.

review: Needs Fixing
627. By Carla Sella

Fixed two text conflicts.

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

Fixed wrong function name.

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
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Looks great, thanks Carla!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/calendar_app/__init__.py'
--- tests/autopilot/calendar_app/__init__.py 2015-04-04 15:59:15 +0000
+++ tests/autopilot/calendar_app/__init__.py 2015-04-10 19:34:31 +0000
@@ -219,7 +219,7 @@
219219
220 def safe_swipe_view(self, direction, view, date):220 def safe_swipe_view(self, direction, view, date):
221 """221 """
222 direction: direction to swip222 direction: direction to swipe
223 view: the view you are swiping against223 view: the view you are swiping against
224 date: a function object of the view224 date: a function object of the view
225 """225 """
@@ -276,6 +276,11 @@
276 local = utc.astimezone(tz.tzlocal())276 local = utc.astimezone(tz.tzlocal())
277 return local277 return local
278278
279 @autopilot.logging.log_action(logger.info)
280 def get_header(self):
281 return self.wait_select_single(
282 "AppHeader", objectName="MainView_Header")
283
279 def press_header_todaybutton(self):284 def press_header_todaybutton(self):
280 header = self.get_header()285 header = self.get_header()
281 header.click_action_button('todaybutton')286 header.click_action_button('todaybutton')
@@ -432,6 +437,17 @@
432 sorteddays.insert(0, day)437 sorteddays.insert(0, day)
433 return sorteddays438 return sorteddays
434439
440 @autopilot.logging.log_action(logger.info)
441 def get_current_headerdatecomponent(self, now):
442 today = datetime.date(now.year, now.month, now.day)
443 header_date_components = self.select_many('HeaderDateComponent')
444 for header in header_date_components:
445 header_date = datetime.date(header.date.datetime.year,
446 header.date.datetime.month,
447 header.date.datetime.day)
448 if header_date == today:
449 return header
450
435451
436class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):452class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
437453
@@ -651,12 +667,18 @@
651 'TimeLineBaseComponent', objectName='DayComponent-0').scrollHour667 'TimeLineBaseComponent', objectName='DayComponent-0').scrollHour
652668
653 @autopilot.logging.log_action(logger.info)669 @autopilot.logging.log_action(logger.info)
670 def get_weeknumber(self):
671 return self._get_timeline_base().weekNumber
672
654 def check_loading_spinnger(self):673 def check_loading_spinnger(self):
655 timelinebasecomponent = self.get_active_timelinebasecomponent()674 timelinebasecomponent = self.get_active_timelinebasecomponent()
656 loading_spinner = timelinebasecomponent.wait_select_single(675 loading_spinner = timelinebasecomponent.wait_select_single(
657 "ActivityIndicator")676 "ActivityIndicator")
658 loading_spinner.running.wait_for(False)677 loading_spinner.running.wait_for(False)
659678
679 def _get_timeline_base(self):
680 return self.select_single("TimeLineBaseComponent", isActive=True)
681
660 @autopilot.logging.log_action(logger.info)682 @autopilot.logging.log_action(logger.info)
661 def get_active_timelinebasecomponent(self):683 def get_active_timelinebasecomponent(self):
662 timelinebase_components = self.select_many(("TimeLineBaseComponent"))684 timelinebase_components = self.select_many(("TimeLineBaseComponent"))
663685
=== modified file 'tests/autopilot/calendar_app/tests/test_monthview.py'
--- tests/autopilot/calendar_app/tests/test_monthview.py 2015-03-06 21:33:24 +0000
+++ tests/autopilot/calendar_app/tests/test_monthview.py 2015-04-10 19:34:31 +0000
@@ -136,3 +136,12 @@
136 self.assertEquals(calendar.day_abbr[calendar.FRIDAY], day_4_label)136 self.assertEquals(calendar.day_abbr[calendar.FRIDAY], day_4_label)
137 self.assertEquals(calendar.day_abbr[calendar.SATURDAY], day_5_label)137 self.assertEquals(calendar.day_abbr[calendar.SATURDAY], day_5_label)
138 self.assertEquals(calendar.day_abbr[calendar.SUNDAY], day_6_label)138 self.assertEquals(calendar.day_abbr[calendar.SUNDAY], day_6_label)
139
140 def test_today_button(self):
141 """ Verify that today button takes to today in month view """
142 self._go_to_today(1)
143
144 header = self.app.main_view.get_header()
145 header.click_action_button('todaybutton')
146
147 self._assert_today()
139148
=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
--- tests/autopilot/calendar_app/tests/test_weekview.py 2015-04-02 15:24:49 +0000
+++ tests/autopilot/calendar_app/tests/test_weekview.py 2015-04-10 19:34:31 +0000
@@ -25,8 +25,9 @@
25 range = xrange25 range = xrange
2626
27import datetime27import datetime
28from datetime import timedelta
28from autopilot.matchers import Eventually29from autopilot.matchers import Eventually
29from testtools.matchers import Equals30from testtools.matchers import Equals, NotEquals
30from random import randint, randrange31from random import randint, randrange
3132
32from calendar_app.tests import CalendarAppTestCase33from calendar_app.tests import CalendarAppTestCase
@@ -61,30 +62,87 @@
61 self.assertThat(self.app.main_view.get_month_year(self.week_view),62 self.assertThat(self.app.main_view.get_month_year(self.week_view),
62 Equals(expected_month_name_year))63 Equals(expected_month_name_year))
6364
64 # TODO: check current day is highlighted65 # check current day is highlighted
6566 header_date = self.week_view.get_current_headerdatecomponent(now)
66 # These testing stubs need completed67 self.assertEquals(header_date.dayColor[0], 221)
67 # def test_scroll_week_must_scroll_within_week(self):68 self.assertEquals(header_date.dayColor[1], 72)
68 # """Scrolling inside the timeline should scroll the weekdays"""69 self.assertEquals(header_date.dayColor[2], 20)
69 # pass70 self.assertEquals(header_date.dayColor[3], 255)
7071
71 # def test_change_week_across_month(self):72 def test_scroll_week_must_scroll_weekdays(self):
72 # """Changing week across months should update the month"""73 """Scrolling inside the timeline should scroll the weekdays"""
73 # pass74 before_days = self.week_view.get_days_of_week()
7475
75 # def test_change_week_across_year(self):76 direction = 1
76 # """Changing week across years should update the year"""77 no_of_swipes = 3
77 # pass78 for x in range(no_of_swipes):
7879 self.app.main_view.swipe_view(direction, self.week_view)
79 # def test_month_to_week(self):80
80 # """Changing from a month to weekview should81 after_days = self.week_view.get_days_of_week()
81 # start weekview on the first week of the month"""82
82 # pass83 self.assertThat(before_days[0], NotEquals(after_days[0]))
8384 self.assertThat(before_days[1], NotEquals(after_days[1]))
84 # def test_day_to_week(self):85 self.assertThat(before_days[2], NotEquals(after_days[2]))
85 # """Changing from a day to weekview should86 self.assertThat(before_days[3], NotEquals(after_days[3]))
86 # start weekview on the same week as the day"""87 self.assertThat(before_days[4], NotEquals(after_days[4]))
87 # pass88 self.assertThat(before_days[5], NotEquals(after_days[5]))
89 self.assertThat(before_days[6], NotEquals(after_days[6]))
90
91 def test_change_week_across_months(self):
92 """Changing week across months should update the month"""
93 header = self.app.main_view.get_header()
94 before_month = self.app.main_view.get_month_year(header)
95 self.week_view.change_week(4)
96
97 after_month = self.app.main_view.get_month_year(header)
98
99 self.assertThat(before_month, NotEquals(after_month))
100
101 def test_change_week_across_year(self):
102 """Changing week across years should update the year"""
103 header = self.app.main_view.get_header()
104 month_year_label = self.app.main_view.get_month_year(header)
105 before_year = month_year_label[-4:]
106
107 current_week = self.week_view.get_current_weeknumber()
108 direction = 1
109 no_of_swipes = ((55 - current_week) * 3) # 3 swipes to change week
110 for x in range(1, no_of_swipes):
111 self.app.main_view.swipe_view(direction, self.week_view)
112
113 month_year_label = self.app.main_view.get_month_year(header)
114 after_year = month_year_label[-4:]
115
116 self.assertThat(before_year, NotEquals(after_year))
117
118 def test_month_to_week(self):
119 """Changing from a month to weekview should
120 start weekview on the first day of the week"""
121 self.app.main_view.go_to_month_view()
122 self.app.main_view.go_to_week_view()
123
124 cal_week_firstday_ts = self.app.main_view.get_week_view().firstDay
125 cal_week_firstday = datetime.date(cal_week_firstday_ts.datetime.year,
126 cal_week_firstday_ts.datetime.month,
127 cal_week_firstday_ts.datetime.day)
128
129 now = datetime.datetime.now()
130 delta = datetime.datetime.weekday(now)
131 first_dow = now - timedelta(delta)
132 expected_first_dow = datetime.date(first_dow.year, first_dow.month,
133 first_dow.day)
134
135 self.assertEquals(cal_week_firstday, expected_first_dow)
136
137 def test_day_to_week(self):
138 """Changing from a day to weekview should
139 start weekview on the same week as the day"""
140 day_view = self.app.main_view.go_to_day_view()
141 day_week_no = day_view.get_weeknumber()
142 week_view = self.app.main_view.go_to_week_view()
143 week_week_no = week_view.get_current_weeknumber()
144
145 self.assertEquals(day_week_no, week_week_no)
88146
89 def test_change_week(self):147 def test_change_week(self):
90 """It must be possible to change weeks by swiping the timeline"""148 """It must be possible to change weeks by swiping the timeline"""
91149
=== modified file 'tests/autopilot/calendar_app/tests/test_yearview.py'
--- tests/autopilot/calendar_app/tests/test_yearview.py 2014-10-02 12:38:28 +0000
+++ tests/autopilot/calendar_app/tests/test_yearview.py 2015-04-10 19:34:31 +0000
@@ -94,3 +94,13 @@
94 def test_show_previous_years(self):94 def test_show_previous_years(self):
95 """It must be possible to show previous years by swiping the view."""95 """It must be possible to show previous years by swiping the view."""
96 self._change_year(-1)96 self._change_year(-1)
97
98 def test_today_button(self):
99 """ Verify that today button takes to today in month view """
100 date = datetime.datetime.now()
101 self._change_year(1)
102
103 header = self.app.main_view.get_header()
104 header.click_action_button('todaybutton')
105
106 self.assertEqual(self.year_view.get_selected_day().date, date.day)

Subscribers

People subscribed via source and target branches

to status/vote changes: