ya2 · news · projects · code · about

8c1f01916d8a82a181cd48146c8eb33be60014ce
[pmachines.git] / lib / engine / functional.py
1 '''Create ref:
2 * M-x fla-set-fun-test
3 * rm options.ini
4 * python main.py --functional-test 1 --functional-ref
5 * python main.py --functional-test 2 --functional-ref
6 * M-x fla-unset-fun-test'''
7 import datetime
8 from os import getcwd, system
9 from logging import debug, info
10 from pathlib import Path
11 from shutil import rmtree
12 from os import makedirs
13 from os.path import join, exists
14 from glob import glob
15 from sys import exit
16 from panda3d.core import Filename
17 from direct.gui.OnscreenText import OnscreenText
18 from lib.gameobject import GameObject
19 from lib.build.build import _branch
20
21
22 class FunctionalTest(GameObject):
23
24 screenshot_time = 1.2
25 evt_time = 1.0
26 start_time = 5
27
28 def __init__(self, idx, ref):
29 super().__init__()
30 self.txt = OnscreenText('', fg=(1, 0, 0, 1), scale=.16)
31 #self._path = ''
32 #if self.eng.is_appimage:
33 self._path = str(Filename().get_user_appdata_directory())
34 self._path += '/pmachines/'
35 self._path += 'tests/functional%s/' % ('_ref' if ref else '')
36 home = '/home/flavio' # we must force this for wine
37 # if self._path.startswith('/c/users/') and exists(str(Path.home()) + '/.local/share/flatpak-wine601/default/'):
38 # self._path = str(Path.home()) + '/.local/share/flatpak-wine601/default/drive_' + self._path[1:]
39 if self._path.startswith('/c/users/') and exists(home + '/.wine/'):
40 self._path = home + '/.wine/drive_' + self._path[1:]
41 if ref:
42 self._path = join(
43 Filename().get_user_appdata_directory(),
44 'pmachines/tests/functional_ref_%s/' % _branch())
45 self._curr_time = 0
46 if int(idx) == 1:
47 rmtree(self._path, ignore_errors=True)
48 info('creating dir: %s' % self._path)
49 makedirs(self._path, exist_ok=True)
50 self._fnames = []
51 self._tasks = []
52 self._prev_time = 0
53 #self.eng.attach_obs(self.on_frame_unpausable)
54 taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
55 self._do_screenshots(idx)
56
57 def _do_screenshot(self, path=None):
58 time = datetime.datetime.now().strftime('%y%m%d%H%M%S')
59 #res = base.win.save_screenshot(Filename(path or ("yocto%s.png" % time)))
60 #debug('screenshot %s (%s)' % (path or ("yocto%s.png" % time), res))
61 res = base.screenshot(path or ("pmachines%s.png" % time), False)
62 info('screenshot %s (%s; %s)' % (path or ("pmachines%s.png" % time), res, getcwd()))
63
64 def _screenshot(self, time, name):
65 self._fnames += [self._path + name + '.png']
66 self._tasks += [(
67 self._curr_time + time,
68 lambda: self._do_screenshot(self._path + name + '.png'),
69 'screenshot: %s' % name)]
70 def txt(show_hide):
71 self.txt['text'] = name
72 (self.txt.show if show_hide else self.txt.hide)()
73 self._tasks += [(
74 self._curr_time + time + .1,
75 lambda: txt(True),
76 'screenshot: %s (show)' % name)]
77 self._tasks += [(
78 self._curr_time + time + FunctionalTest.evt_time - .1,
79 lambda: txt(False),
80 'screenshot: %s (hide)' % name)]
81 self._curr_time += time
82
83 def __keypress(self, key):
84 '''Emulates a keypress'''
85 dev = base.win.getInputDevice(0)
86 dev.buttonDown(key)
87 dev.buttonUp(key)
88
89 def __char_entered(self, char):
90 '''Emulates a character being entered.'''
91 dev = base.win.getInputDevice(0)
92 dev.keystroke(ord(char))
93
94 def __mouse_click(self, pos, btn):
95 center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
96 tgt = pos[0] + center[0], pos[1] + center[1]
97 btn = 3 if btn == 'right' else 1
98 system('xdotool mousemove %s %s click %s' % (tgt[0], tgt[1], btn))
99
100 def __mouse_move(self, pos):
101 center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
102 tgt = pos[0] + center[0], pos[1] + center[1]
103 system('xdotool mousemove %s %s' % tgt)
104
105 def __mouse_drag(self, start, end, btn):
106 center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
107 start = start[0] + center[0], start[1] + center[1]
108 end = end[0] + center[0], end[1] + center[1]
109 btn = 3 if btn == 'right' else 1
110 system('xdotool mousemove %s %s mousedown %s mousemove %s %s mouseup %s' % (
111 start[0], start[1], btn, end[0], end[1], btn))
112
113 def _event(self, time, evt, messenger_evt=False, append_up=True, mouse_args=None):
114 def _append_up(evt_name):
115 return evt + ('' if evt.endswith('-up') or not append_up else '-up')
116 def cback_char(_evt):
117 self.__char_entered(_evt)
118 def cback_keyp(_evt):
119 self.__keypress(_evt)
120 self.__keypress('raw-' + _evt)
121 cback = lambda: (cback_char(evt) if len(evt) == 1 else cback_keyp(evt))
122 if evt in ['mousemove', 'mouseclick', 'mousedrag']:
123 if evt == 'mousemove':
124 cback = lambda: self.__mouse_move(*mouse_args)
125 elif evt == 'mouseclick':
126 cback = lambda: self.__mouse_click(*mouse_args)
127 elif evt == 'mousedrag':
128 cback = lambda: self.__mouse_drag(*mouse_args)
129 if messenger_evt:
130 cback = lambda: messenger.send(_append_up(evt))
131 self._tasks += [(
132 self._curr_time + time,
133 cback,
134 'event: %s' % evt)]
135 def txt(show_hide):
136 self.txt['text'] = evt
137 (self.txt.show if show_hide else self.txt.hide)()
138 self._tasks += [(
139 self._curr_time + time + .2,
140 lambda: txt(True),
141 'event: %s (show)' % evt)]
142 self._tasks += [(
143 self._curr_time + time + .8,
144 lambda: txt(False),
145 'event: %s (hide)' % evt)]
146 self._curr_time += time
147
148 def _verify(self):
149 def __verify():
150 files = glob(self._path + '*')
151 for fname in self._fnames:
152 info('verifying %s' % fname)
153 assert exists(fname)
154 self._tasks += [(
155 self._curr_time + 3,
156 lambda: __verify(),
157 'verify')]
158 self._curr_time += 3
159
160 def _exit(self):
161 self._tasks += [(
162 self._curr_time + 3,
163 lambda: exit(),
164 'exit')]
165
166 def on_frame_unpausable(self, task):
167 for tsk in self._tasks:
168 #if self._prev_time <= tsk[0] < self.eng.event.unpaused_time:
169 if self._prev_time <= tsk[0] < globalClock.getFrameTime():
170 debug('%s %s' % (tsk[0], tsk[2]))
171 tsk[1]()
172 self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
173 return task.cont
174
175 def _do_screenshots_1(self):
176 info('_do_screenshots_1')
177 self._screenshot(FunctionalTest.start_time, 'main_menu')
178 self._do_screenshots_credits()
179 # self._do_screenshots_options()
180 self._do_screenshots_exit()
181
182 def _do_screenshots_credits(self):
183 self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 50), 'left'])
184 self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
185 self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 280), 'left'])
186 self._screenshot(FunctionalTest.screenshot_time, 'main_menu_back_from_credits')
187 # # go to credits
188 # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
189 # self._event(FunctionalTest.evt_time, 'arrow_down')
190 # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
191 # self._event(FunctionalTest.evt_time, 'arrow_down')
192 # self._screenshot(FunctionalTest.screenshot_time, 'main_menu_highlight')
193 # self._event(FunctionalTest.evt_time, 'rcontrol')
194 # self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
195 # # go to supporters
196 # self._event(FunctionalTest.evt_time, 'joypad0-face_a', True)
197 # self._screenshot(FunctionalTest.screenshot_time, 'supporters_menu')
198 # # back to main
199 # self._event(FunctionalTest.evt_time, 'rcontrol')
200 # self._event(FunctionalTest.evt_time, 'joypad0-face_b', True)
201 # self._event(FunctionalTest.evt_time, 'arrow_up')
202 # self._event(FunctionalTest.evt_time, 'arrow_up')
203 # self._event(FunctionalTest.evt_time, 'arrow_up')
204 # self._event(FunctionalTest.evt_time, 'arrow_up')
205
206 # def _do_screenshots_options(self):
207 # # go to options
208 # self._event(FunctionalTest.evt_time, 'arrow_down')
209 # self._event(FunctionalTest.evt_time, 'arrow_down')
210 # self._event(FunctionalTest.evt_time, 'rcontrol')
211 # self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
212 # # language
213 # self._event(FunctionalTest.evt_time, 'rcontrol')
214 # self._screenshot(FunctionalTest.screenshot_time, 'language_open')
215 # self._event(FunctionalTest.evt_time, 'arrow_down')
216 # self._screenshot(FunctionalTest.screenshot_time, 'language_highlight')
217 # self._event(FunctionalTest.evt_time, 'rcontrol')
218 # self._screenshot(FunctionalTest.screenshot_time, 'language_it')
219 # # volume
220 # self._event(FunctionalTest.evt_time, 'arrow_down')
221 # self._event(FunctionalTest.evt_time, 'arrow_right')
222 # self._event(FunctionalTest.evt_time, 'arrow_right')
223 # self._screenshot(FunctionalTest.screenshot_time, 'volume')
224 # # car's number
225 # self._event(FunctionalTest.evt_time, 'arrow_down')
226 # self._event(FunctionalTest.evt_time, 'rcontrol')
227 # self._screenshot(FunctionalTest.screenshot_time, 'cars_open')
228 # self._event(FunctionalTest.evt_time, 'rcontrol')
229 # self._screenshot(FunctionalTest.screenshot_time, 'cars_changed')
230 # # back
231 # self._event(FunctionalTest.evt_time, 'arrow_down')
232 # self._event(FunctionalTest.evt_time, 'arrow_down')
233 # self._event(FunctionalTest.evt_time, 'arrow_down')
234 # self._event(FunctionalTest.evt_time, 'rcontrol')
235 # self._event(FunctionalTest.evt_time, 'arrow_up')
236 # self._event(FunctionalTest.evt_time, 'arrow_up')
237
238 def _do_screenshots_exit(self):
239 # self._event(FunctionalTest.evt_time, 'arrow_down')
240 # self._event(FunctionalTest.evt_time, 'arrow_down')
241 # self._event(FunctionalTest.evt_time, 'arrow_down')
242 # self._event(FunctionalTest.evt_time, 'arrow_down')
243 # self._event(FunctionalTest.evt_time, 'arrow_down')
244 # self._event(FunctionalTest.evt_time, 'rcontrol')
245 # self._event(FunctionalTest.evt_time, 'arrow_down')
246 self._verify()
247 # self._event(FunctionalTest.evt_time, 'rcontrol')
248 # self._exit()
249 self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 200), 'left'])
250
251
252 def _do_screenshots_2(self):
253 info('_do_screenshots_2')
254 # self._do_screenshots_restore_options()
255 # self._do_screenshots_game()
256 # self._do_screenshots_end()
257
258 # def _do_screenshots_restore_options(self):
259 # # go to options
260 # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
261 # self._event(FunctionalTest.evt_time, 'arrow_down')
262 # self._event(FunctionalTest.evt_time, 'rcontrol')
263 # self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
264 # # # language
265 # self._event(FunctionalTest.evt_time, 'rcontrol')
266 # self._event(FunctionalTest.evt_time, 'arrow_up')
267 # self._event(FunctionalTest.evt_time, 'rcontrol')
268 # self._screenshot(FunctionalTest.screenshot_time, 'language_en_restored')
269 # # # volume
270 # self._event(FunctionalTest.evt_time, 'arrow_down')
271 # self._event(FunctionalTest.evt_time, 'arrow_left')
272 # self._event(FunctionalTest.evt_time, 'arrow_left')
273 # self._screenshot(FunctionalTest.screenshot_time, 'volume_restored')
274 # # car's number
275 # self._event(FunctionalTest.evt_time, 'arrow_down')
276 # self._event(FunctionalTest.evt_time, 'rcontrol')
277 # self._event(FunctionalTest.evt_time, 'arrow_down')
278 # self._event(FunctionalTest.evt_time, 'arrow_down')
279 # self._event(FunctionalTest.evt_time, 'arrow_down')
280 # self._event(FunctionalTest.evt_time, 'arrow_down')
281 # self._event(FunctionalTest.evt_time, 'rcontrol')
282 # self._screenshot(FunctionalTest.screenshot_time, 'cars_restored')
283 # # graphics settings
284 # self._event(FunctionalTest.evt_time, 'arrow_down')
285 # self._event(FunctionalTest.evt_time, 'rcontrol')
286 # self._screenshot(FunctionalTest.screenshot_time, 'graphics_settings')
287 # self._event(FunctionalTest.evt_time, 'arrow_down')
288 # self._event(FunctionalTest.evt_time, 'arrow_down')
289 # self._event(FunctionalTest.evt_time, 'rcontrol')
290 # self._screenshot(FunctionalTest.screenshot_time, 'antialiasing')
291 # self._event(FunctionalTest.evt_time, 'rcontrol')
292 # self._event(FunctionalTest.evt_time, 'arrow_down')
293 # self._event(FunctionalTest.evt_time, 'rcontrol')
294 # self._screenshot(FunctionalTest.screenshot_time, 'shadows')
295 # self._event(FunctionalTest.evt_time, 'rcontrol')
296 # self._event(FunctionalTest.evt_time, 'arrow_down')
297 # self._event(FunctionalTest.evt_time, 'rcontrol')
298 # self._screenshot(FunctionalTest.screenshot_time, 'fog')
299 # self._event(FunctionalTest.evt_time, 'rcontrol')
300 # self._event(FunctionalTest.evt_time, 'arrow_down')
301 # self._event(FunctionalTest.evt_time, 'rcontrol')
302 # self._screenshot(FunctionalTest.screenshot_time, 'normal_mapping')
303 # self._event(FunctionalTest.evt_time, 'rcontrol')
304 # self._event(FunctionalTest.evt_time, 'arrow_down')
305 # self._event(FunctionalTest.evt_time, 'rcontrol')
306 # self._screenshot(FunctionalTest.screenshot_time, 'occlusion')
307 # self._event(FunctionalTest.evt_time, 'rcontrol')
308 # self._event(FunctionalTest.evt_time, 'arrow_down')
309 # self._event(FunctionalTest.evt_time, 'rcontrol')
310 # # input
311 # self._event(FunctionalTest.evt_time, 'arrow_down')
312 # self._event(FunctionalTest.evt_time, 'rcontrol')
313 # self._screenshot(FunctionalTest.screenshot_time, 'input')
314 # self._event(FunctionalTest.evt_time, 'rcontrol')
315 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1')
316 # self._event(FunctionalTest.evt_time, 'rcontrol')
317 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_rec')
318 # self._event(FunctionalTest.evt_time, '8', True, False)
319 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_changed')
320 # self._event(FunctionalTest.evt_time, 'rcontrol')
321 # self._event(FunctionalTest.evt_time, 'arrow_up', True, False)
322 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_restored')
323 # self._event(FunctionalTest.evt_time, 'rcontrol')
324 # self._event(FunctionalTest.evt_time, 'w', True, False)
325 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already')
326 # self._event(FunctionalTest.evt_time, 'rcontrol')
327 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already_closed')
328 # self._event(FunctionalTest.evt_time, 'arrow_down')
329 # self._event(FunctionalTest.evt_time, 'arrow_down')
330 # self._event(FunctionalTest.evt_time, 'arrow_down')
331 # self._event(FunctionalTest.evt_time, 'arrow_down')
332 # self._event(FunctionalTest.evt_time, 'rcontrol')
333 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p2')
334 # self._event(FunctionalTest.evt_time, 'arrow_down')
335 # self._event(FunctionalTest.evt_time, 'arrow_down')
336 # self._event(FunctionalTest.evt_time, 'arrow_down')
337 # self._event(FunctionalTest.evt_time, 'arrow_down')
338 # self._event(FunctionalTest.evt_time, 'rcontrol')
339 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p3')
340 # self._event(FunctionalTest.evt_time, 'arrow_down')
341 # self._event(FunctionalTest.evt_time, 'arrow_down')
342 # self._event(FunctionalTest.evt_time, 'arrow_down')
343 # self._event(FunctionalTest.evt_time, 'arrow_down')
344 # self._event(FunctionalTest.evt_time, 'rcontrol')
345 # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p4')
346 # self._event(FunctionalTest.evt_time, 'arrow_down')
347 # self._event(FunctionalTest.evt_time, 'arrow_down')
348 # self._event(FunctionalTest.evt_time, 'arrow_down')
349 # self._event(FunctionalTest.evt_time, 'arrow_down')
350 # self._event(FunctionalTest.evt_time, 'rcontrol')
351 # self._event(FunctionalTest.evt_time, 'arrow_down')
352 # self._event(FunctionalTest.evt_time, 'rcontrol')
353 # self._event(FunctionalTest.evt_time, 'arrow_down')
354 # self._event(FunctionalTest.evt_time, 'rcontrol')
355 # self._event(FunctionalTest.evt_time, 'arrow_down')
356 # self._event(FunctionalTest.evt_time, 'rcontrol')
357 # self._event(FunctionalTest.evt_time, 'arrow_down')
358 # self._event(FunctionalTest.evt_time, 'rcontrol')
359 # self._event(FunctionalTest.evt_time, 'arrow_down')
360 # self._event(FunctionalTest.evt_time, 'rcontrol')
361 # self._event(FunctionalTest.evt_time, 'arrow_up')
362 # self._event(FunctionalTest.evt_time, 'arrow_up')
363
364 # def _do_screenshots_game(self):
365 # # single player
366 # self._event(FunctionalTest.evt_time, 'rcontrol')
367 # self._screenshot(FunctionalTest.screenshot_time, 'single_player_menu')
368 # self._event(FunctionalTest.evt_time, 'rcontrol')
369 # self._screenshot(FunctionalTest.screenshot_time, 'track_page')
370 # self._event(FunctionalTest.evt_time, 'rcontrol')
371 # self._screenshot(FunctionalTest.screenshot_time, 'car_page_start')
372 # self._event(FunctionalTest.evt_time, 'arrow_left')
373 # self._screenshot(FunctionalTest.screenshot_time, 'car_page_sel')
374 # self._event(FunctionalTest.evt_time, 'rcontrol')
375 # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_start')
376 # self._event(FunctionalTest.evt_time, 'arrow_down')
377 # self._event(FunctionalTest.evt_time, 'arrow_down')
378 # self._event(FunctionalTest.evt_time, 'rcontrol')
379 # self._event(FunctionalTest.evt_time, 'arrow_down')
380 # self._event(FunctionalTest.evt_time, 'arrow_down')
381 # self._event(FunctionalTest.evt_time, 'rcontrol')
382 # self._event(FunctionalTest.evt_time, 'arrow_down')
383 # self._event(FunctionalTest.evt_time, 'rcontrol')
384 # self._event(FunctionalTest.evt_time, 'arrow_up')
385 # self._event(FunctionalTest.evt_time, 'rcontrol')
386 # self._event(FunctionalTest.evt_time, 'rcontrol')
387 # self._event(FunctionalTest.evt_time, 'arrow_left')
388 # self._event(FunctionalTest.evt_time, 'rcontrol')
389 # self._event(FunctionalTest.evt_time, 'rcontrol')
390 # self._event(FunctionalTest.evt_time, 'rcontrol')
391 # self._event(FunctionalTest.evt_time, 'rcontrol')
392 # self._event(FunctionalTest.evt_time, 'rcontrol')
393 # self._event(FunctionalTest.evt_time, 'arrow_left')
394 # self._event(FunctionalTest.evt_time, 'rcontrol')
395 # self._event(FunctionalTest.evt_time, 'arrow_up')
396 # self._event(FunctionalTest.evt_time, 'rcontrol')
397 # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry')
398 # self._event(FunctionalTest.evt_time, 'backspace')
399 # self._event(FunctionalTest.evt_time, 'backspace')
400 # self._event(FunctionalTest.evt_time, 'backspace')
401 # self._event(FunctionalTest.evt_time, 'backspace')
402 # self._event(FunctionalTest.evt_time, 'backspace')
403 # self._event(FunctionalTest.evt_time, 'backspace')
404 # self._event(FunctionalTest.evt_time, 'backspace')
405 # self._event(FunctionalTest.evt_time, 'backspace')
406 # self._event(FunctionalTest.evt_time, 'backspace')
407 # self._event(FunctionalTest.evt_time, 'backspace')
408 # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_empty')
409 # self._event(FunctionalTest.evt_time, 'f')
410 # self._event(FunctionalTest.evt_time, 'l')
411 # self._event(FunctionalTest.evt_time, 'a')
412 # self._event(FunctionalTest.evt_time, 'v')
413 # self._event(FunctionalTest.evt_time, 'i')
414 # self._event(FunctionalTest.evt_time, 'o')
415 # self._event(FunctionalTest.evt_time, 'enter')
416 # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_full')
417 # self._event(FunctionalTest.evt_time, 'arrow_down')
418 # self._event(FunctionalTest.evt_time, 'arrow_right')
419 # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_sel')
420 # # some ai tests
421 # self._event(FunctionalTest.evt_time, 'rcontrol')
422 # self._event(40, 'escape-up')
423 # self._screenshot(FunctionalTest.screenshot_time, 'ingame_menu')
424 # self._event(FunctionalTest.evt_time, 'rcontrol')
425 # self._screenshot(FunctionalTest.screenshot_time, 'race_back')
426 # self._event(FunctionalTest.evt_time, 'escape-up')
427 # self._event(FunctionalTest.evt_time, 'arrow_down')
428 # self._screenshot(FunctionalTest.screenshot_time, 'ingame_sel')
429 # self._event(FunctionalTest.evt_time, 'rcontrol')
430 # self._screenshot(FunctionalTest.screenshot_time, 'main_page_back_race')
431
432 # def _do_screenshots_end(self):
433 # self._event(FunctionalTest.evt_time, 'arrow_down')
434 # self._event(FunctionalTest.evt_time, 'arrow_down')
435 # self._event(FunctionalTest.evt_time, 'arrow_down')
436 # self._event(FunctionalTest.evt_time, 'arrow_down')
437 # self._event(FunctionalTest.evt_time, 'arrow_down')
438 # self._event(FunctionalTest.evt_time, 'rcontrol')
439 # self._screenshot(FunctionalTest.screenshot_time, 'exit_page')
440 # self._event(FunctionalTest.evt_time, 'arrow_down')
441 # self._screenshot(FunctionalTest.screenshot_time, 'exit_page_sel')
442 # self._verify()
443 # self._event(FunctionalTest.evt_time, 'rcontrol')
444 # self._exit()
445
446 def _do_screenshots(self, idx):
447 [self._do_screenshots_1, self._do_screenshots_2][int(idx) - 1]()