Merge lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed into lp:ubuntu-calendar-app
- weekview-testing-stubs-completed
- Merge into trunk
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 | ||||||||
Related bugs: |
|
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.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
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.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:616
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:/
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: 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: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:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:619
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:/
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: 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:621
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:/
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: 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:622
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:623
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: 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:624
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: 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:625
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: 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:626
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Mihir Soni (mihirsoni) wrote : | # |
looks good to me
Thanks :)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Nicholas Skaggs (nskaggs) wrote : | # |
Text conflict in tests/autopilot
Text conflict in tests/autopilot
2 conflicts encountered.
bzr: ERROR: Conflicts from merge
Should be a simple fix.
- 627. By Carla Sella
-
Fixed two text conflicts.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:627
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 628. By Carla Sella
-
Fixed wrong function name.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:628
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Looks great, thanks Carla!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'tests/autopilot/calendar_app/__init__.py' | |||
2 | --- tests/autopilot/calendar_app/__init__.py 2015-04-04 15:59:15 +0000 | |||
3 | +++ tests/autopilot/calendar_app/__init__.py 2015-04-10 19:34:31 +0000 | |||
4 | @@ -219,7 +219,7 @@ | |||
5 | 219 | 219 | ||
6 | 220 | def safe_swipe_view(self, direction, view, date): | 220 | def safe_swipe_view(self, direction, view, date): |
7 | 221 | """ | 221 | """ |
9 | 222 | direction: direction to swip | 222 | direction: direction to swipe |
10 | 223 | view: the view you are swiping against | 223 | view: the view you are swiping against |
11 | 224 | date: a function object of the view | 224 | date: a function object of the view |
12 | 225 | """ | 225 | """ |
13 | @@ -276,6 +276,11 @@ | |||
14 | 276 | local = utc.astimezone(tz.tzlocal()) | 276 | local = utc.astimezone(tz.tzlocal()) |
15 | 277 | return local | 277 | return local |
16 | 278 | 278 | ||
17 | 279 | @autopilot.logging.log_action(logger.info) | ||
18 | 280 | def get_header(self): | ||
19 | 281 | return self.wait_select_single( | ||
20 | 282 | "AppHeader", objectName="MainView_Header") | ||
21 | 283 | |||
22 | 279 | def press_header_todaybutton(self): | 284 | def press_header_todaybutton(self): |
23 | 280 | header = self.get_header() | 285 | header = self.get_header() |
24 | 281 | header.click_action_button('todaybutton') | 286 | header.click_action_button('todaybutton') |
25 | @@ -432,6 +437,17 @@ | |||
26 | 432 | sorteddays.insert(0, day) | 437 | sorteddays.insert(0, day) |
27 | 433 | return sorteddays | 438 | return sorteddays |
28 | 434 | 439 | ||
29 | 440 | @autopilot.logging.log_action(logger.info) | ||
30 | 441 | def get_current_headerdatecomponent(self, now): | ||
31 | 442 | today = datetime.date(now.year, now.month, now.day) | ||
32 | 443 | header_date_components = self.select_many('HeaderDateComponent') | ||
33 | 444 | for header in header_date_components: | ||
34 | 445 | header_date = datetime.date(header.date.datetime.year, | ||
35 | 446 | header.date.datetime.month, | ||
36 | 447 | header.date.datetime.day) | ||
37 | 448 | if header_date == today: | ||
38 | 449 | return header | ||
39 | 450 | |||
40 | 435 | 451 | ||
41 | 436 | class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 452 | class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
42 | 437 | 453 | ||
43 | @@ -651,12 +667,18 @@ | |||
44 | 651 | 'TimeLineBaseComponent', objectName='DayComponent-0').scrollHour | 667 | 'TimeLineBaseComponent', objectName='DayComponent-0').scrollHour |
45 | 652 | 668 | ||
46 | 653 | @autopilot.logging.log_action(logger.info) | 669 | @autopilot.logging.log_action(logger.info) |
47 | 670 | def get_weeknumber(self): | ||
48 | 671 | return self._get_timeline_base().weekNumber | ||
49 | 672 | |||
50 | 654 | def check_loading_spinnger(self): | 673 | def check_loading_spinnger(self): |
51 | 655 | timelinebasecomponent = self.get_active_timelinebasecomponent() | 674 | timelinebasecomponent = self.get_active_timelinebasecomponent() |
52 | 656 | loading_spinner = timelinebasecomponent.wait_select_single( | 675 | loading_spinner = timelinebasecomponent.wait_select_single( |
53 | 657 | "ActivityIndicator") | 676 | "ActivityIndicator") |
54 | 658 | loading_spinner.running.wait_for(False) | 677 | loading_spinner.running.wait_for(False) |
55 | 659 | 678 | ||
56 | 679 | def _get_timeline_base(self): | ||
57 | 680 | return self.select_single("TimeLineBaseComponent", isActive=True) | ||
58 | 681 | |||
59 | 660 | @autopilot.logging.log_action(logger.info) | 682 | @autopilot.logging.log_action(logger.info) |
60 | 661 | def get_active_timelinebasecomponent(self): | 683 | def get_active_timelinebasecomponent(self): |
61 | 662 | timelinebase_components = self.select_many(("TimeLineBaseComponent")) | 684 | timelinebase_components = self.select_many(("TimeLineBaseComponent")) |
62 | 663 | 685 | ||
63 | === modified file 'tests/autopilot/calendar_app/tests/test_monthview.py' | |||
64 | --- tests/autopilot/calendar_app/tests/test_monthview.py 2015-03-06 21:33:24 +0000 | |||
65 | +++ tests/autopilot/calendar_app/tests/test_monthview.py 2015-04-10 19:34:31 +0000 | |||
66 | @@ -136,3 +136,12 @@ | |||
67 | 136 | self.assertEquals(calendar.day_abbr[calendar.FRIDAY], day_4_label) | 136 | self.assertEquals(calendar.day_abbr[calendar.FRIDAY], day_4_label) |
68 | 137 | self.assertEquals(calendar.day_abbr[calendar.SATURDAY], day_5_label) | 137 | self.assertEquals(calendar.day_abbr[calendar.SATURDAY], day_5_label) |
69 | 138 | self.assertEquals(calendar.day_abbr[calendar.SUNDAY], day_6_label) | 138 | self.assertEquals(calendar.day_abbr[calendar.SUNDAY], day_6_label) |
70 | 139 | |||
71 | 140 | def test_today_button(self): | ||
72 | 141 | """ Verify that today button takes to today in month view """ | ||
73 | 142 | self._go_to_today(1) | ||
74 | 143 | |||
75 | 144 | header = self.app.main_view.get_header() | ||
76 | 145 | header.click_action_button('todaybutton') | ||
77 | 146 | |||
78 | 147 | self._assert_today() | ||
79 | 139 | 148 | ||
80 | === modified file 'tests/autopilot/calendar_app/tests/test_weekview.py' | |||
81 | --- tests/autopilot/calendar_app/tests/test_weekview.py 2015-04-02 15:24:49 +0000 | |||
82 | +++ tests/autopilot/calendar_app/tests/test_weekview.py 2015-04-10 19:34:31 +0000 | |||
83 | @@ -25,8 +25,9 @@ | |||
84 | 25 | range = xrange | 25 | range = xrange |
85 | 26 | 26 | ||
86 | 27 | import datetime | 27 | import datetime |
87 | 28 | from datetime import timedelta | ||
88 | 28 | from autopilot.matchers import Eventually | 29 | from autopilot.matchers import Eventually |
90 | 29 | from testtools.matchers import Equals | 30 | from testtools.matchers import Equals, NotEquals |
91 | 30 | from random import randint, randrange | 31 | from random import randint, randrange |
92 | 31 | 32 | ||
93 | 32 | from calendar_app.tests import CalendarAppTestCase | 33 | from calendar_app.tests import CalendarAppTestCase |
94 | @@ -61,30 +62,87 @@ | |||
95 | 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), |
96 | 62 | Equals(expected_month_name_year)) | 63 | Equals(expected_month_name_year)) |
97 | 63 | 64 | ||
122 | 64 | # TODO: check current day is highlighted | 65 | # check current day is highlighted |
123 | 65 | 66 | header_date = self.week_view.get_current_headerdatecomponent(now) | |
124 | 66 | # These testing stubs need completed | 67 | self.assertEquals(header_date.dayColor[0], 221) |
125 | 67 | # def test_scroll_week_must_scroll_within_week(self): | 68 | self.assertEquals(header_date.dayColor[1], 72) |
126 | 68 | # """Scrolling inside the timeline should scroll the weekdays""" | 69 | self.assertEquals(header_date.dayColor[2], 20) |
127 | 69 | # pass | 70 | self.assertEquals(header_date.dayColor[3], 255) |
128 | 70 | 71 | ||
129 | 71 | # def test_change_week_across_month(self): | 72 | def test_scroll_week_must_scroll_weekdays(self): |
130 | 72 | # """Changing week across months should update the month""" | 73 | """Scrolling inside the timeline should scroll the weekdays""" |
131 | 73 | # pass | 74 | before_days = self.week_view.get_days_of_week() |
132 | 74 | 75 | ||
133 | 75 | # def test_change_week_across_year(self): | 76 | direction = 1 |
134 | 76 | # """Changing week across years should update the year""" | 77 | no_of_swipes = 3 |
135 | 77 | # pass | 78 | for x in range(no_of_swipes): |
136 | 78 | 79 | self.app.main_view.swipe_view(direction, self.week_view) | |
137 | 79 | # def test_month_to_week(self): | 80 | |
138 | 80 | # """Changing from a month to weekview should | 81 | after_days = self.week_view.get_days_of_week() |
139 | 81 | # start weekview on the first week of the month""" | 82 | |
140 | 82 | # pass | 83 | self.assertThat(before_days[0], NotEquals(after_days[0])) |
141 | 83 | 84 | self.assertThat(before_days[1], NotEquals(after_days[1])) | |
142 | 84 | # def test_day_to_week(self): | 85 | self.assertThat(before_days[2], NotEquals(after_days[2])) |
143 | 85 | # """Changing from a day to weekview should | 86 | self.assertThat(before_days[3], NotEquals(after_days[3])) |
144 | 86 | # start weekview on the same week as the day""" | 87 | self.assertThat(before_days[4], NotEquals(after_days[4])) |
145 | 87 | # pass | 88 | self.assertThat(before_days[5], NotEquals(after_days[5])) |
146 | 89 | self.assertThat(before_days[6], NotEquals(after_days[6])) | ||
147 | 90 | |||
148 | 91 | def test_change_week_across_months(self): | ||
149 | 92 | """Changing week across months should update the month""" | ||
150 | 93 | header = self.app.main_view.get_header() | ||
151 | 94 | before_month = self.app.main_view.get_month_year(header) | ||
152 | 95 | self.week_view.change_week(4) | ||
153 | 96 | |||
154 | 97 | after_month = self.app.main_view.get_month_year(header) | ||
155 | 98 | |||
156 | 99 | self.assertThat(before_month, NotEquals(after_month)) | ||
157 | 100 | |||
158 | 101 | def test_change_week_across_year(self): | ||
159 | 102 | """Changing week across years should update the year""" | ||
160 | 103 | header = self.app.main_view.get_header() | ||
161 | 104 | month_year_label = self.app.main_view.get_month_year(header) | ||
162 | 105 | before_year = month_year_label[-4:] | ||
163 | 106 | |||
164 | 107 | current_week = self.week_view.get_current_weeknumber() | ||
165 | 108 | direction = 1 | ||
166 | 109 | no_of_swipes = ((55 - current_week) * 3) # 3 swipes to change week | ||
167 | 110 | for x in range(1, no_of_swipes): | ||
168 | 111 | self.app.main_view.swipe_view(direction, self.week_view) | ||
169 | 112 | |||
170 | 113 | month_year_label = self.app.main_view.get_month_year(header) | ||
171 | 114 | after_year = month_year_label[-4:] | ||
172 | 115 | |||
173 | 116 | self.assertThat(before_year, NotEquals(after_year)) | ||
174 | 117 | |||
175 | 118 | def test_month_to_week(self): | ||
176 | 119 | """Changing from a month to weekview should | ||
177 | 120 | start weekview on the first day of the week""" | ||
178 | 121 | self.app.main_view.go_to_month_view() | ||
179 | 122 | self.app.main_view.go_to_week_view() | ||
180 | 123 | |||
181 | 124 | cal_week_firstday_ts = self.app.main_view.get_week_view().firstDay | ||
182 | 125 | cal_week_firstday = datetime.date(cal_week_firstday_ts.datetime.year, | ||
183 | 126 | cal_week_firstday_ts.datetime.month, | ||
184 | 127 | cal_week_firstday_ts.datetime.day) | ||
185 | 128 | |||
186 | 129 | now = datetime.datetime.now() | ||
187 | 130 | delta = datetime.datetime.weekday(now) | ||
188 | 131 | first_dow = now - timedelta(delta) | ||
189 | 132 | expected_first_dow = datetime.date(first_dow.year, first_dow.month, | ||
190 | 133 | first_dow.day) | ||
191 | 134 | |||
192 | 135 | self.assertEquals(cal_week_firstday, expected_first_dow) | ||
193 | 136 | |||
194 | 137 | def test_day_to_week(self): | ||
195 | 138 | """Changing from a day to weekview should | ||
196 | 139 | start weekview on the same week as the day""" | ||
197 | 140 | day_view = self.app.main_view.go_to_day_view() | ||
198 | 141 | day_week_no = day_view.get_weeknumber() | ||
199 | 142 | week_view = self.app.main_view.go_to_week_view() | ||
200 | 143 | week_week_no = week_view.get_current_weeknumber() | ||
201 | 144 | |||
202 | 145 | self.assertEquals(day_week_no, week_week_no) | ||
203 | 88 | 146 | ||
204 | 89 | def test_change_week(self): | 147 | def test_change_week(self): |
205 | 90 | """It must be possible to change weeks by swiping the timeline""" | 148 | """It must be possible to change weeks by swiping the timeline""" |
206 | 91 | 149 | ||
207 | === modified file 'tests/autopilot/calendar_app/tests/test_yearview.py' | |||
208 | --- tests/autopilot/calendar_app/tests/test_yearview.py 2014-10-02 12:38:28 +0000 | |||
209 | +++ tests/autopilot/calendar_app/tests/test_yearview.py 2015-04-10 19:34:31 +0000 | |||
210 | @@ -94,3 +94,13 @@ | |||
211 | 94 | def test_show_previous_years(self): | 94 | def test_show_previous_years(self): |
212 | 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.""" |
213 | 96 | self._change_year(-1) | 96 | self._change_year(-1) |
214 | 97 | |||
215 | 98 | def test_today_button(self): | ||
216 | 99 | """ Verify that today button takes to today in month view """ | ||
217 | 100 | date = datetime.datetime.now() | ||
218 | 101 | self._change_year(1) | ||
219 | 102 | |||
220 | 103 | header = self.app.main_view.get_header() | ||
221 | 104 | header.click_action_button('todaybutton') | ||
222 | 105 | |||
223 | 106 | self.assertEqual(self.year_view.get_selected_day().date, date.day) |
PASSED: Continuous integration, rev:616 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 1117/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2446 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2446/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- calendar- app-utopic- amd64-ci/ 588 91.189. 93.70:8080/ job/ubuntu- calendar- app-vivid- amd64-ci/ 114
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 1117/rebuild
http://