* python main.py --functional-test 1 --functional-ref
* python main.py --functional-test 2 --functional-ref
* M-x fla-unset-fun-test'''
+import datetime
+from os import getcwd, system
from logging import debug, info
from pathlib import Path
from shutil import rmtree
#self._path = ''
#if self.eng.is_appimage:
self._path = str(Filename().get_user_appdata_directory())
- self._path += '/yocto_racer/'
+ self._path += '/pmachines/'
self._path += 'tests/functional%s/' % ('_ref' if ref else '')
home = '/home/flavio' # we must force this for wine
# if self._path.startswith('/c/users/') and exists(str(Path.home()) + '/.local/share/flatpak-wine601/default/'):
if ref:
self._path = join(
Filename().get_user_appdata_directory(),
- 'yocto_racer/tests/functional_ref_%s/' % _branch())
+ 'pmachines/tests/functional_ref_%s/' % _branch())
self._curr_time = 0
if int(idx) == 1:
rmtree(self._path, ignore_errors=True)
self._fnames = []
self._tasks = []
self._prev_time = 0
- self.eng.attach_obs(self.on_frame_unpausable)
+ #self.eng.attach_obs(self.on_frame_unpausable)
+ taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
self._do_screenshots(idx)
+ def _do_screenshot(self, path=None):
+ time = datetime.datetime.now().strftime('%y%m%d%H%M%S')
+ #res = base.win.save_screenshot(Filename(path or ("yocto%s.png" % time)))
+ #debug('screenshot %s (%s)' % (path or ("yocto%s.png" % time), res))
+ res = base.screenshot(path or ("pmachines%s.png" % time), False)
+ info('screenshot %s (%s; %s)' % (path or ("pmachines%s.png" % time), res, getcwd()))
+
def _screenshot(self, time, name):
self._fnames += [self._path + name + '.png']
self._tasks += [(
self._curr_time + time,
- lambda: self.eng.gfx.gfx_mgr.screenshot(self._path + name + '.png'),
+ lambda: self._do_screenshot(self._path + name + '.png'),
'screenshot: %s' % name)]
def txt(show_hide):
self.txt['text'] = name
dev = base.win.getInputDevice(0)
dev.keystroke(ord(char))
- def _event(self, time, evt, messenger_evt=False, append_up=True):
+ def __mouse_click(self, pos, btn):
+ center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
+ tgt = pos[0] + center[0], pos[1] + center[1]
+ btn = 3 if btn == 'right' else 1
+ system('xdotool mousemove %s %s click %s' % (tgt[0], tgt[1], btn))
+
+ def __mouse_move(self, pos):
+ center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
+ tgt = pos[0] + center[0], pos[1] + center[1]
+ system('xdotool mousemove %s %s' % tgt)
+
+ def __mouse_drag(self, start, end, btn):
+ center = base.pipe.get_display_width() / 2, base.pipe.get_display_height() / 2
+ start = start[0] + center[0], start[1] + center[1]
+ end = end[0] + center[0], end[1] + center[1]
+ btn = 3 if btn == 'right' else 1
+ system('xdotool mousemove %s %s mousedown %s mousemove %s %s mouseup %s' % (
+ start[0], start[1], btn, end[0], end[1], btn))
+
+ def _event(self, time, evt, messenger_evt=False, append_up=True, mouse_args=None):
def _append_up(evt_name):
return evt + ('' if evt.endswith('-up') or not append_up else '-up')
def cback_char(_evt):
self.__keypress(_evt)
self.__keypress('raw-' + _evt)
cback = lambda: (cback_char(evt) if len(evt) == 1 else cback_keyp(evt))
+ if evt in ['mousemove', 'mouseclick', 'mousedrag']:
+ if evt == 'mousemove':
+ cback = lambda: self.__mouse_move(*mouse_args)
+ elif evt == 'mouseclick':
+ cback = lambda: self.__mouse_click(*mouse_args)
+ elif evt == 'mousedrag':
+ cback = lambda: self.__mouse_drag(*mouse_args)
if messenger_evt:
cback = lambda: messenger.send(_append_up(evt))
self._tasks += [(
lambda: exit(),
'exit')]
- def on_frame_unpausable(self):
+ def on_frame_unpausable(self, task):
for tsk in self._tasks:
- if self._prev_time <= tsk[0] < self.eng.event.unpaused_time:
+ #if self._prev_time <= tsk[0] < self.eng.event.unpaused_time:
+ if self._prev_time <= tsk[0] < globalClock.getFrameTime():
debug('%s %s' % (tsk[0], tsk[2]))
tsk[1]()
- self._prev_time = self.eng.event.unpaused_time
+ self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
+ return task.cont
def _do_screenshots_1(self):
info('_do_screenshots_1')
self._screenshot(FunctionalTest.start_time, 'main_menu')
self._do_screenshots_credits()
- self._do_screenshots_options()
+ # self._do_screenshots_options()
self._do_screenshots_exit()
def _do_screenshots_credits(self):
- # go to credits
- self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._screenshot(FunctionalTest.screenshot_time, 'main_menu_highlight')
- self._event(FunctionalTest.evt_time, 'rcontrol')
+ self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 50), 'left'])
self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
- # go to supporters
- self._event(FunctionalTest.evt_time, 'joypad0-face_a', True)
- self._screenshot(FunctionalTest.screenshot_time, 'supporters_menu')
- # back to main
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'joypad0-face_b', True)
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'arrow_up')
+ self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 280), 'left'])
+ self._screenshot(FunctionalTest.screenshot_time, 'main_menu_back_from_credits')
+ # # go to credits
+ # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._screenshot(FunctionalTest.screenshot_time, 'main_menu_highlight')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
+ # # go to supporters
+ # self._event(FunctionalTest.evt_time, 'joypad0-face_a', True)
+ # self._screenshot(FunctionalTest.screenshot_time, 'supporters_menu')
+ # # back to main
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'joypad0-face_b', True)
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
- def _do_screenshots_options(self):
- # go to options
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
- # language
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'language_open')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._screenshot(FunctionalTest.screenshot_time, 'language_highlight')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'language_it')
- # volume
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_right')
- self._event(FunctionalTest.evt_time, 'arrow_right')
- self._screenshot(FunctionalTest.screenshot_time, 'volume')
- # car's number
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'cars_open')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'cars_changed')
- # back
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'arrow_up')
+ # def _do_screenshots_options(self):
+ # # go to options
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
+ # # language
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'language_open')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._screenshot(FunctionalTest.screenshot_time, 'language_highlight')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'language_it')
+ # # volume
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_right')
+ # self._event(FunctionalTest.evt_time, 'arrow_right')
+ # self._screenshot(FunctionalTest.screenshot_time, 'volume')
+ # # car's number
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'cars_open')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'cars_changed')
+ # # back
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
def _do_screenshots_exit(self):
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
self._verify()
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._exit()
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._exit()
+ self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 200), 'left'])
+
def _do_screenshots_2(self):
info('_do_screenshots_2')
- self._do_screenshots_restore_options()
- self._do_screenshots_game()
- self._do_screenshots_end()
+ # self._do_screenshots_restore_options()
+ # self._do_screenshots_game()
+ # self._do_screenshots_end()
- def _do_screenshots_restore_options(self):
- # go to options
- self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
- # # language
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'language_en_restored')
- # # volume
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_left')
- self._event(FunctionalTest.evt_time, 'arrow_left')
- self._screenshot(FunctionalTest.screenshot_time, 'volume_restored')
- # car's number
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'cars_restored')
- # graphics settings
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'graphics_settings')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'antialiasing')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'shadows')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'fog')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'normal_mapping')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'occlusion')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- # input
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'input')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_rec')
- self._event(FunctionalTest.evt_time, '8', True, False)
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_changed')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up', True, False)
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_restored')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'w', True, False)
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already_closed')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p2')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p3')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p4')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'arrow_up')
+ # def _do_screenshots_restore_options(self):
+ # # go to options
+ # self._event(FunctionalTest.evt_time, 'joypad0-dpad_down', True)
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
+ # # # language
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'language_en_restored')
+ # # # volume
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_left')
+ # self._event(FunctionalTest.evt_time, 'arrow_left')
+ # self._screenshot(FunctionalTest.screenshot_time, 'volume_restored')
+ # # car's number
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'cars_restored')
+ # # graphics settings
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'graphics_settings')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'antialiasing')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'shadows')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'fog')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'normal_mapping')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'occlusion')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # # input
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'input')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_rec')
+ # self._event(FunctionalTest.evt_time, '8', True, False)
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_changed')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up', True, False)
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_restored')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'w', True, False)
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p1_already_closed')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p2')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p3')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'keyboard_p4')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
- def _do_screenshots_game(self):
- # single player
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'single_player_menu')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'track_page')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'car_page_start')
- self._event(FunctionalTest.evt_time, 'arrow_left')
- self._screenshot(FunctionalTest.screenshot_time, 'car_page_sel')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'driver_page_start')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_left')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_left')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(FunctionalTest.evt_time, 'arrow_up')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._event(FunctionalTest.evt_time, 'backspace')
- self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_empty')
- self._event(FunctionalTest.evt_time, 'f')
- self._event(FunctionalTest.evt_time, 'l')
- self._event(FunctionalTest.evt_time, 'a')
- self._event(FunctionalTest.evt_time, 'v')
- self._event(FunctionalTest.evt_time, 'i')
- self._event(FunctionalTest.evt_time, 'o')
- self._event(FunctionalTest.evt_time, 'enter')
- self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_full')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_right')
- self._screenshot(FunctionalTest.screenshot_time, 'driver_page_sel')
- # some ai tests
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._event(40, 'escape-up')
- self._screenshot(FunctionalTest.screenshot_time, 'ingame_menu')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'race_back')
- self._event(FunctionalTest.evt_time, 'escape-up')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._screenshot(FunctionalTest.screenshot_time, 'ingame_sel')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'main_page_back_race')
+ # def _do_screenshots_game(self):
+ # # single player
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'single_player_menu')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'track_page')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'car_page_start')
+ # self._event(FunctionalTest.evt_time, 'arrow_left')
+ # self._screenshot(FunctionalTest.screenshot_time, 'car_page_sel')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_start')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_left')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_left')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(FunctionalTest.evt_time, 'arrow_up')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._event(FunctionalTest.evt_time, 'backspace')
+ # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_empty')
+ # self._event(FunctionalTest.evt_time, 'f')
+ # self._event(FunctionalTest.evt_time, 'l')
+ # self._event(FunctionalTest.evt_time, 'a')
+ # self._event(FunctionalTest.evt_time, 'v')
+ # self._event(FunctionalTest.evt_time, 'i')
+ # self._event(FunctionalTest.evt_time, 'o')
+ # self._event(FunctionalTest.evt_time, 'enter')
+ # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_entry_full')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_right')
+ # self._screenshot(FunctionalTest.screenshot_time, 'driver_page_sel')
+ # # some ai tests
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._event(40, 'escape-up')
+ # self._screenshot(FunctionalTest.screenshot_time, 'ingame_menu')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'race_back')
+ # self._event(FunctionalTest.evt_time, 'escape-up')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._screenshot(FunctionalTest.screenshot_time, 'ingame_sel')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'main_page_back_race')
- def _do_screenshots_end(self):
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._screenshot(FunctionalTest.screenshot_time, 'exit_page')
- self._event(FunctionalTest.evt_time, 'arrow_down')
- self._screenshot(FunctionalTest.screenshot_time, 'exit_page_sel')
- self._verify()
- self._event(FunctionalTest.evt_time, 'rcontrol')
- self._exit()
+ # def _do_screenshots_end(self):
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._screenshot(FunctionalTest.screenshot_time, 'exit_page')
+ # self._event(FunctionalTest.evt_time, 'arrow_down')
+ # self._screenshot(FunctionalTest.screenshot_time, 'exit_page_sel')
+ # self._verify()
+ # self._event(FunctionalTest.evt_time, 'rcontrol')
+ # self._exit()
def _do_screenshots(self, idx):
[self._do_screenshots_1, self._do_screenshots_2][int(idx) - 1]()