Merge lp:~nskaggs/ubuntu-calendar-app/refactor-tests into lp:ubuntu-calendar-app
- refactor-tests
- Merge into trunk
Proposed by
Nicholas Skaggs
Status: | Rejected |
---|---|
Rejected by: | Leo Arias |
Proposed branch: | lp:~nskaggs/ubuntu-calendar-app/refactor-tests |
Merge into: | lp:ubuntu-calendar-app |
Diff against target: |
397 lines (+157/-109) 4 files modified
tests/autopilot/calendar_app/emulators.py (+104/-13) tests/autopilot/calendar_app/tests/__init__.py (+32/-37) tests/autopilot/calendar_app/tests/test_calendar.py (+9/-13) tests/autopilot/calendar_app/tests/test_monthview.py (+12/-46) |
To merge this branch: | bzr merge lp:~nskaggs/ubuntu-calendar-app/refactor-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leo Arias (community) | Disapprove | ||
Review via email: mp+211812@code.launchpad.net |
Commit message
Refactor tests to use page object model
Description of the change
Refactor tests to use page object model
To post a comment you must log in.
- 214. By Nicholas Skaggs
-
wip monthview
- 215. By Nicholas Skaggs
-
incorporate fixes from stable
Unmerged revisions
- 215. By Nicholas Skaggs
-
incorporate fixes from stable
- 214. By Nicholas Skaggs
-
wip monthview
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/autopilot/calendar_app/emulators.py' | |||
2 | --- tests/autopilot/calendar_app/emulators.py 2013-12-16 21:32:43 +0000 | |||
3 | +++ tests/autopilot/calendar_app/emulators.py 2014-03-20 03:45:39 +0000 | |||
4 | @@ -7,22 +7,44 @@ | |||
5 | 7 | 7 | ||
6 | 8 | """Calendar app autopilot emulators.""" | 8 | """Calendar app autopilot emulators.""" |
7 | 9 | 9 | ||
8 | 10 | import logging | ||
9 | 10 | from autopilot.introspection import dbus | 11 | from autopilot.introspection import dbus |
10 | 12 | from autopilot import logging as autopilot_logging | ||
11 | 13 | |||
12 | 11 | from ubuntuuitoolkit import emulators as toolkit_emulators | 14 | from ubuntuuitoolkit import emulators as toolkit_emulators |
13 | 12 | 15 | ||
14 | 16 | logger = logging.getLogger(__name__) | ||
15 | 17 | |||
16 | 18 | |||
17 | 19 | class CalendarEmulatorException(toolkit_emulators.ToolkitEmulatorException): | ||
18 | 20 | """Exception raised when there is an error with the emulator.""" | ||
19 | 13 | 21 | ||
20 | 14 | class MainView(toolkit_emulators.MainView): | 22 | class MainView(toolkit_emulators.MainView): |
21 | 15 | 23 | ||
25 | 16 | """ | 24 | @autopilot_logging.log_action(logger.info) |
26 | 17 | An emulator class that makes it easy to interact with the calendar-app. | 25 | def open_dayview(self): |
27 | 18 | """ | 26 | """Open the Dayview tab. |
28 | 27 | |||
29 | 28 | :return: the Dayview page. | ||
30 | 29 | |||
31 | 30 | """ | ||
32 | 31 | self.switch_to_tab('dayTab') | ||
33 | 32 | return self.wait_select_single(DayviewPage) | ||
34 | 33 | |||
35 | 34 | @autopilot_logging.log_action(logger.info) | ||
36 | 35 | def open_monthview(self): | ||
37 | 36 | """Open the Monthview Tab. | ||
38 | 37 | |||
39 | 38 | :return: the Monthview page. | ||
40 | 39 | |||
41 | 40 | """ | ||
42 | 41 | self.switch_to_tab('monthTab') | ||
43 | 42 | return self.wait_select_single(MonthviewPage) | ||
44 | 43 | |||
45 | 19 | 44 | ||
46 | 20 | def get_event_view(self): | 45 | def get_event_view(self): |
47 | 21 | return self.wait_select_single("EventView") | 46 | return self.wait_select_single("EventView") |
48 | 22 | 47 | ||
49 | 23 | def get_month_view(self): | ||
50 | 24 | return self.wait_select_single("MonthView") | ||
51 | 25 | |||
52 | 26 | def get_year_view(self): | 48 | def get_year_view(self): |
53 | 27 | return self.wait_select_single("YearView") | 49 | return self.wait_select_single("YearView") |
54 | 28 | 50 | ||
55 | @@ -78,6 +100,30 @@ | |||
56 | 78 | except dbus.StateNotFoundError: | 100 | except dbus.StateNotFoundError: |
57 | 79 | return None | 101 | return None |
58 | 80 | 102 | ||
59 | 103 | def get_year(self, component): | ||
60 | 104 | return int(component.wait_select_single( | ||
61 | 105 | "Label", objectName="yearLabel").text) | ||
62 | 106 | |||
63 | 107 | def get_num_events(self): | ||
64 | 108 | return len(self.select_many("EventBubble")) | ||
65 | 109 | |||
66 | 110 | class Page(toolkit_emulators.UbuntuUIToolkitEmulatorBase): | ||
67 | 111 | """Autopilot helper for Pages.""" | ||
68 | 112 | |||
69 | 113 | def __init__(self, *args): | ||
70 | 114 | super(Page, self).__init__(*args) | ||
71 | 115 | # XXX we need a better way to keep reference to the main view. | ||
72 | 116 | # --elopio - 2014-01-31 | ||
73 | 117 | self.main_view = self.get_root_instance().select_single(MainView) | ||
74 | 118 | |||
75 | 119 | def drag_page_up(self): | ||
76 | 120 | """Drag the given page up.""" | ||
77 | 121 | self._drag_page(direction='up') | ||
78 | 122 | |||
79 | 123 | def drag_page_down(self): | ||
80 | 124 | """Drag the given page down.""" | ||
81 | 125 | self._drag_page(direction='down') | ||
82 | 126 | |||
83 | 81 | def swipe_view(self, direction, view, x_pad=0.15): | 127 | def swipe_view(self, direction, view, x_pad=0.15): |
84 | 82 | """Swipe the given view to left or right. | 128 | """Swipe the given view to left or right. |
85 | 83 | 129 | ||
86 | @@ -96,10 +142,55 @@ | |||
87 | 96 | 142 | ||
88 | 97 | self.pointing_device.drag(x_start, y_line, x_stop, y_line) | 143 | self.pointing_device.drag(x_start, y_line, x_stop, y_line) |
89 | 98 | 144 | ||
97 | 99 | def get_year(self, component): | 145 | def _drag_page(self, direction): |
98 | 100 | return int(component.wait_select_single( | 146 | """Function to drag the page up/down.""" |
99 | 101 | "Label", objectName="yearLabel").text) | 147 | self._wait_to_stop_moving() |
100 | 102 | 148 | ||
101 | 103 | def get_month_name(self, component): | 149 | x, y, w, h = self.globalRect |
102 | 104 | return component.wait_select_single( | 150 | start_x = stop_x = x + (w / 2) |
103 | 105 | "Label", objectName="monthLabel").text | 151 | start_y = y + (h / 2) |
104 | 152 | |||
105 | 153 | if direction == "down": | ||
106 | 154 | stop_y = start_y + h / 3 | ||
107 | 155 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | ||
108 | 156 | else: | ||
109 | 157 | stop_y = start_y - h / 3 | ||
110 | 158 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | ||
111 | 159 | |||
112 | 160 | self._wait_to_stop_moving() | ||
113 | 161 | |||
114 | 162 | def _wait_to_stop_moving(self): | ||
115 | 163 | self.select_single( | ||
116 | 164 | 'QQuickFlickable', | ||
117 | 165 | objectName='animationContainer').moving.wait_for(False) | ||
118 | 166 | |||
119 | 167 | class DayviewPage(Page): | ||
120 | 168 | """Autopilot helper for the Dayview page.""" | ||
121 | 169 | |||
122 | 170 | |||
123 | 171 | class MonthviewPage(Page): | ||
124 | 172 | """Autopilot helper for the Monthview page.""" | ||
125 | 173 | |||
126 | 174 | def __init__(self): | ||
127 | 175 | self.view = self.wait_select_single("MonthView") | ||
128 | 176 | |||
129 | 177 | def change_month(self, delta): | ||
130 | 178 | sign = int(math.copysign(1, delta)) | ||
131 | 179 | |||
132 | 180 | for _ in range(abs(delta)): | ||
133 | 181 | before = month_view.currentMonth.datetime | ||
134 | 182 | |||
135 | 183 | #prevent timing issues with swiping | ||
136 | 184 | old_month = self.currentMonth.datetime | ||
137 | 185 | self.swipe_view(sign, month_view) | ||
138 | 186 | #self.assertThat(lambda: self.currentMonth.datetime, | ||
139 | 187 | # Eventually(NotEquals(old_month))) | ||
140 | 188 | |||
141 | 189 | after = before + relativedelta(months=sign) | ||
142 | 190 | |||
143 | 191 | #self.assertThat(lambda: | ||
144 | 192 | # self.currentMonth.datetime.month, | ||
145 | 193 | # Eventually(Equals(after.month))) | ||
146 | 194 | #self.assertThat(lambda: | ||
147 | 195 | # self.currentMonth.datetime.year, | ||
148 | 196 | # Eventually(Equals(after.year))) | ||
149 | 106 | 197 | ||
150 | === modified file 'tests/autopilot/calendar_app/tests/__init__.py' | |||
151 | --- tests/autopilot/calendar_app/tests/__init__.py 2014-01-31 21:15:52 +0000 | |||
152 | +++ tests/autopilot/calendar_app/tests/__init__.py 2014-03-20 03:45:39 +0000 | |||
153 | @@ -22,6 +22,12 @@ | |||
154 | 22 | import shutil | 22 | import shutil |
155 | 23 | import logging | 23 | import logging |
156 | 24 | 24 | ||
157 | 25 | try: | ||
158 | 26 | from unittest import mock | ||
159 | 27 | except ImportError: | ||
160 | 28 | import mock | ||
161 | 29 | import tempfile | ||
162 | 30 | |||
163 | 25 | from autopilot.input import Mouse, Touch, Pointer | 31 | from autopilot.input import Mouse, Touch, Pointer |
164 | 26 | from autopilot.platform import model | 32 | from autopilot.platform import model |
165 | 27 | from autopilot.testcase import AutopilotTestCase | 33 | from autopilot.testcase import AutopilotTestCase |
166 | @@ -45,20 +51,16 @@ | |||
167 | 45 | 51 | ||
168 | 46 | local_location = "../../calendar.qml" | 52 | local_location = "../../calendar.qml" |
169 | 47 | installed_location = "/usr/share/calendar-app/calendar.qml" | 53 | installed_location = "/usr/share/calendar-app/calendar.qml" |
170 | 48 | sqlite_dir = os.path.expanduser( | ||
171 | 49 | "~/.local/share/com.ubuntu.calendar/Databases") | ||
172 | 50 | backup_dir = sqlite_dir + ".backup" | ||
173 | 51 | 54 | ||
174 | 52 | def setUp(self): | 55 | def setUp(self): |
175 | 53 | self.pointing_device = Pointer(self.input_device_class.create()) | 56 | self.pointing_device = Pointer(self.input_device_class.create()) |
176 | 57 | self.home_dir = self._patch_home() | ||
177 | 54 | super(CalendarTestCase, self).setUp() | 58 | super(CalendarTestCase, self).setUp() |
178 | 55 | self.temp_move_sqlite_db() | ||
179 | 56 | self.addCleanup(self.restore_sqlite_db) | ||
180 | 57 | 59 | ||
181 | 58 | #turn off the OSK so it doesn't block screen elements | 60 | #turn off the OSK so it doesn't block screen elements |
185 | 59 | if model() != 'Desktop': | 61 | #if model() != 'Desktop': |
186 | 60 | os.system("stop maliit-server") | 62 | # os.system("stop maliit-server") |
187 | 61 | self.addCleanup(os.system, "start maliit-server") | 63 | # self.addCleanup(os.system, "start maliit-server") |
188 | 62 | 64 | ||
189 | 63 | # Unset the current locale to ensure locale-specific data | 65 | # Unset the current locale to ensure locale-specific data |
190 | 64 | # (day and month names, first day of the week, …) doesn’t get | 66 | # (day and month names, first day of the week, …) doesn’t get |
191 | @@ -73,6 +75,7 @@ | |||
192 | 73 | self.launch_test_click() | 75 | self.launch_test_click() |
193 | 74 | 76 | ||
194 | 75 | def launch_test_local(self): | 77 | def launch_test_local(self): |
195 | 78 | logger.debug("Running via local installation") | ||
196 | 76 | self.app = self.launch_test_application( | 79 | self.app = self.launch_test_application( |
197 | 77 | "qmlscene", | 80 | "qmlscene", |
198 | 78 | self.local_location, | 81 | self.local_location, |
199 | @@ -80,6 +83,7 @@ | |||
200 | 80 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | 83 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
201 | 81 | 84 | ||
202 | 82 | def launch_test_installed(self): | 85 | def launch_test_installed(self): |
203 | 86 | logger.debug("Running via installed debian package") | ||
204 | 83 | self.app = self.launch_test_application( | 87 | self.app = self.launch_test_application( |
205 | 84 | "qmlscene", | 88 | "qmlscene", |
206 | 85 | self.installed_location, | 89 | self.installed_location, |
207 | @@ -87,39 +91,30 @@ | |||
208 | 87 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | 91 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
209 | 88 | 92 | ||
210 | 89 | def launch_test_click(self): | 93 | def launch_test_click(self): |
211 | 94 | logger.debug("Running via click package") | ||
212 | 90 | self.app = self.launch_click_package( | 95 | self.app = self.launch_click_package( |
213 | 91 | "com.ubuntu.calendar", | 96 | "com.ubuntu.calendar", |
214 | 92 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | 97 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) |
215 | 93 | 98 | ||
244 | 94 | def temp_move_sqlite_db(self): | 99 | def _patch_home(self): |
245 | 95 | try: | 100 | #make a temp dir |
246 | 96 | shutil.rmtree(self.backup_dir) | 101 | temp_dir = tempfile.mkdtemp() |
247 | 97 | except: | 102 | logger.debug("Created fake home directory " + temp_dir) |
248 | 98 | pass | 103 | self.addCleanup(shutil.rmtree, temp_dir) |
249 | 99 | else: | 104 | #if the Xauthority file is in home directory |
250 | 100 | logger.warning("Prexisting backup database found and removed") | 105 | #make sure we copy it to temp home, otherwise do nothing |
251 | 101 | 106 | xauth = os.path.expanduser(os.path.join('~', '.Xauthority')) | |
252 | 102 | try: | 107 | if os.path.isfile(xauth): |
253 | 103 | shutil.move(self.sqlite_dir, self.backup_dir) | 108 | logger.debug("Copying .Xauthority to fake home " + temp_dir) |
254 | 104 | except: | 109 | shutil.copyfile( |
255 | 105 | logger.warning("No current database found") | 110 | os.path.expanduser(os.path.join('~', '.Xauthority')), |
256 | 106 | else: | 111 | os.path.join(temp_dir, '.Xauthority')) |
257 | 107 | logger.debug("Backed up database") | 112 | patcher = mock.patch.dict('os.environ', {'HOME': temp_dir}) |
258 | 108 | 113 | patcher.start() | |
259 | 109 | def restore_sqlite_db(self): | 114 | logger.debug("Patched home to fake home directory " + temp_dir) |
260 | 110 | if os.path.exists(self.backup_dir): | 115 | self.addCleanup(patcher.stop) |
261 | 111 | if os.path.exists(self.sqlite_dir): | 116 | return temp_dir |
234 | 112 | try: | ||
235 | 113 | shutil.rmtree(self.sqlite_dir) | ||
236 | 114 | except: | ||
237 | 115 | logger.error("Failed to remove test database and restore" / | ||
238 | 116 | "database") | ||
239 | 117 | return | ||
240 | 118 | try: | ||
241 | 119 | shutil.move(self.backup_dir, self.sqlite_dir) | ||
242 | 120 | except: | ||
243 | 121 | logger.error("Failed to restore database") | ||
262 | 122 | 117 | ||
263 | 123 | @property | 118 | @property |
264 | 124 | def main_view(self): | 119 | def main_view(self): |
266 | 125 | return self.app.select_single(emulators.MainView) | 120 | return self.app.wait_select_single(emulators.MainView) |
267 | 126 | 121 | ||
268 | === modified file 'tests/autopilot/calendar_app/tests/test_calendar.py' | |||
269 | --- tests/autopilot/calendar_app/tests/test_calendar.py 2014-01-11 06:05:42 +0000 | |||
270 | +++ tests/autopilot/calendar_app/tests/test_calendar.py 2014-03-20 03:45:39 +0000 | |||
271 | @@ -11,7 +11,7 @@ | |||
272 | 11 | 11 | ||
273 | 12 | from autopilot.matchers import Eventually | 12 | from autopilot.matchers import Eventually |
274 | 13 | 13 | ||
276 | 14 | from testtools.matchers import Equals, Not, Is | 14 | from testtools.matchers import Equals, Not, Is, NotEquals |
277 | 15 | 15 | ||
278 | 16 | import time | 16 | import time |
279 | 17 | 17 | ||
280 | @@ -46,6 +46,10 @@ | |||
281 | 46 | 46 | ||
282 | 47 | def test_new_event(self): | 47 | def test_new_event(self): |
283 | 48 | """test add new event """ | 48 | """test add new event """ |
284 | 49 | #go to today | ||
285 | 50 | self.main_view.switch_to_tab("dayTab") | ||
286 | 51 | self.main_view.open_toolbar().click_button("todaybutton") | ||
287 | 52 | num_events = self.main_view.get_num_events() | ||
288 | 49 | 53 | ||
289 | 50 | #click on new event button | 54 | #click on new event button |
290 | 51 | self.main_view.open_toolbar().click_button("neweventbutton") | 55 | self.main_view.open_toolbar().click_button("neweventbutton") |
291 | @@ -68,7 +72,7 @@ | |||
292 | 68 | ok = picker.select_single("Button", objectName="TimePickerOKButton") | 72 | ok = picker.select_single("Button", objectName="TimePickerOKButton") |
293 | 69 | self.pointing_device.click_object(ok) | 73 | self.pointing_device.click_object(ok) |
294 | 70 | 74 | ||
296 | 71 | # Set the end time | 75 | ## Set the end time |
297 | 72 | end_time_field = self.main_view.get_event_end_time_field() | 76 | end_time_field = self.main_view.get_event_end_time_field() |
298 | 73 | self.pointing_device.click_object(end_time_field) | 77 | self.pointing_device.click_object(end_time_field) |
299 | 74 | picker = self.main_view.get_time_picker() | 78 | picker = self.main_view.get_time_picker() |
300 | @@ -83,18 +87,10 @@ | |||
301 | 83 | self.keyboard.type("My location") | 87 | self.keyboard.type("My location") |
302 | 84 | self.assertThat(location_field.text, Eventually(Equals("My location"))) | 88 | self.assertThat(location_field.text, Eventually(Equals("My location"))) |
303 | 85 | 89 | ||
304 | 86 | #input people | ||
305 | 87 | people_field = self.main_view.get_event_people_field() | ||
306 | 88 | self.pointing_device.click_object(people_field) | ||
307 | 89 | self.assertThat(people_field.activeFocus, Eventually(Equals(True))) | ||
308 | 90 | self.keyboard.type("Me") | ||
309 | 91 | self.assertThat(people_field.text, Eventually(Equals("Me"))) | ||
310 | 92 | |||
311 | 93 | #click save button | 90 | #click save button |
312 | 94 | self.main_view.open_toolbar().click_button("eventSaveButton") | 91 | self.main_view.open_toolbar().click_button("eventSaveButton") |
313 | 95 | 92 | ||
314 | 96 | #verify that the event has been created in timeline | 93 | #verify that the event has been created in timeline |
319 | 97 | self.main_view.switch_to_tab("dayTab") | 94 | self.main_view.open_toolbar().click_button("todaybutton") |
320 | 98 | self.assertThat(lambda: self.main_view.get_label_with_text( | 95 | self.assertThat(self.main_view.get_num_events, |
321 | 99 | eventTitle, root=self.main_view.get_day_view()), | 96 | Eventually(NotEquals(num_events))) |
318 | 100 | Eventually(Not(Is(None)))) | ||
322 | 101 | 97 | ||
323 | === modified file 'tests/autopilot/calendar_app/tests/test_monthview.py' | |||
324 | --- tests/autopilot/calendar_app/tests/test_monthview.py 2014-01-09 23:30:55 +0000 | |||
325 | +++ tests/autopilot/calendar_app/tests/test_monthview.py 2014-03-20 03:45:39 +0000 | |||
326 | @@ -24,59 +24,25 @@ | |||
327 | 24 | 24 | ||
328 | 25 | def setUp(self): | 25 | def setUp(self): |
329 | 26 | super(TestMonthView, self).setUp() | 26 | super(TestMonthView, self).setUp() |
330 | 27 | self.assertThat(self.main_view.visible, Eventually(Equals(True))) | ||
331 | 28 | self.main_view.switch_to_tab("monthTab") | ||
332 | 29 | |||
333 | 30 | self.assertThat( | 27 | self.assertThat( |
363 | 31 | self.main_view.get_month_view, Eventually(NotEquals(None))) | 28 | self.main_view.visible, Eventually(Equals(True))) |
364 | 32 | 29 | self.page = self.main_view.open_monthview() | |
365 | 33 | self.month_view = self.main_view.get_month_view() | 30 | |
366 | 34 | 31 | def test_monthview_go_to_today_next_month(self): | |
367 | 35 | def change_month(self, delta): | 32 | self.page.change_month(1) |
368 | 36 | month_view = self.main_view.get_month_view() | 33 | self.main_view.open_toolbar().click_button("todaybutton") |
369 | 37 | sign = int(math.copysign(1, delta)) | 34 | self.assertThat(lambda: self.page.currentMonth.datetime.day, |
341 | 38 | |||
342 | 39 | for _ in range(abs(delta)): | ||
343 | 40 | before = month_view.currentMonth.datetime | ||
344 | 41 | |||
345 | 42 | #prevent timing issues with swiping | ||
346 | 43 | old_month = month_view.currentMonth.datetime | ||
347 | 44 | self.main_view.swipe_view(sign, month_view) | ||
348 | 45 | self.assertThat(lambda: month_view.currentMonth.datetime, | ||
349 | 46 | Eventually(NotEquals(old_month))) | ||
350 | 47 | |||
351 | 48 | after = before + relativedelta(months=sign) | ||
352 | 49 | |||
353 | 50 | self.assertThat(lambda: | ||
354 | 51 | self.month_view.currentMonth.datetime.month, | ||
355 | 52 | Eventually(Equals(after.month))) | ||
356 | 53 | self.assertThat(lambda: | ||
357 | 54 | self.month_view.currentMonth.datetime.year, | ||
358 | 55 | Eventually(Equals(after.year))) | ||
359 | 56 | |||
360 | 57 | def _assert_today(self): | ||
361 | 58 | today = datetime.today() | ||
362 | 59 | self.assertThat(lambda: self.month_view.currentMonth.datetime.day, | ||
370 | 60 | Eventually(Equals(today.day))) | 35 | Eventually(Equals(today.day))) |
372 | 61 | self.assertThat(lambda: self.month_view.currentMonth.datetime.month, | 36 | self.assertThat(lambda: self.page.currentMonth.datetime.month, |
373 | 62 | Eventually(Equals(today.month))) | 37 | Eventually(Equals(today.month))) |
375 | 63 | self.assertThat(lambda: self.month_view.currentMonth.datetime.year, | 38 | self.assertThat(lambda: self.page.currentMonth.datetime.year, |
376 | 64 | Eventually(Equals(today.year))) | 39 | Eventually(Equals(today.year))) |
377 | 65 | 40 | ||
378 | 66 | def _test_go_to_today(self, delta): | ||
379 | 67 | self._assert_today() | ||
380 | 68 | self.change_month(delta) | ||
381 | 69 | self.main_view.open_toolbar().click_button("todaybutton") | ||
382 | 70 | self._assert_today() | ||
383 | 71 | |||
384 | 72 | def test_monthview_go_to_today_next_month(self): | ||
385 | 73 | self._test_go_to_today(1) | ||
386 | 74 | |||
387 | 75 | def test_monthview_go_to_today_prev_month(self): | 41 | def test_monthview_go_to_today_prev_month(self): |
389 | 76 | self._test_go_to_today(-1) | 42 | self.page.change_month(-1) |
390 | 77 | 43 | ||
391 | 78 | def test_monthview_go_to_today_next_year(self): | 44 | def test_monthview_go_to_today_next_year(self): |
393 | 79 | self._test_go_to_today(12) | 45 | self.page.change_month(12) |
394 | 80 | 46 | ||
395 | 81 | def test_monthview_go_to_today_prev_year(self): | 47 | def test_monthview_go_to_today_prev_year(self): |
397 | 82 | self._test_go_to_today(-12) | 48 | self.page.change_month(-12) |
Balloons, this is already too old and the code has changed a lot. I'm rejecting it.