from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenText import OnscreenText
from ya2.build.build import _branch
+import asyncio
+import xmlrpc
class FunctionalTest:
- screenshot_time = 1.2
- evt_time = 1.0
- drag_time = 1.0
+ screenshot_time = 2.0
+ evt_time = 2.0
+ drag_time = 2.0
start_time = 2
def __init__(self, idx, offset):
+ debug('creating FunctionalTest (%s)' % id(self))
super().__init__()
info('test idx: %s' % idx)
self._offset = offset
- sleep(5)
- self._proxy = ServerProxy('http://localhost:6000')
+ sleep(12)
+ self._proxy = ServerProxy('http://localhost:7000')
self._curr_time = 0
self._tasks = []
self._prev_time = 0
- taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
+ #taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
self._proxy.set_idx(idx)
self._do_screenshots(idx)
self._proxy.screenshot(name)
info('screenshot %s' % name)
- def _screenshot(self, time, name):
- self._tasks += [(
- self._curr_time + time,
- lambda: self._do_screenshot(name),
- 'screenshot: %s' % name)]
- self._curr_time += time
+ async def _screenshot(self, time, name):
+ #self._tasks += [(
+ # self._curr_time + time,
+ # lambda: self._do_screenshot(name),
+ # 'screenshot: %s' % name)]
+ #self._curr_time += time
+ await asyncio.sleep(time)
+ self._do_screenshot(name)
- def __mouse_click(self, tgt, btn):
+ async def __mouse_click(self, tgt, btn):
+ await asyncio.sleep(.5)
offset_x = int((1920 - 1360) / 2) #+ 1 # xfce decorations
offset_y = int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
btn = 3 if btn == 'right' else 1
pos = self._proxy.get_pos(tgt)
- print(tgt, pos)
system('xdotool mousemove %s %s' % (offset_x + pos[0], offset_y + pos[1]))
- def click(task):
- system('xdotool click %s' % btn)
- taskMgr.do_method_later(.28, click, 'click')
+ #def click(task):
+ # system('xdotool click %s' % tgt)
+ # print('CLICK %s' % str(btn))
+ #taskMgr.do_method_later(.28, click, 'click')
+ await asyncio.sleep(.5)
+ system('xdotool click %s' % btn)
- def __mouse_drag(self, start, end, btn):
+ async def __mouse_drag(self, start, end, btn):
+ await asyncio.sleep(.5)
offset_x = int((1920 - 1360) / 2) #+ 1 # xfce decorations
offset_y = int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
btn = 3 if btn == 'right' else 1
start = self._proxy.get_pos(start)
end = self._proxy.get_pos(end)
system('xdotool mousemove %s %s' % (offset_x + start[0], offset_y + start[1]))
- def mousedown(task):
- system('xdotool mousedown %s' % btn)
- def mousemove(task):
- system('xdotool mousemove %s %s' % (offset_x + end[0], offset_y + end[1]))
- def mouseup(task):
- system('xdotool mouseup %s' % btn)
- taskMgr.do_method_later(.28, mouseup, 'mouseup')
- taskMgr.do_method_later(.28, mousemove, 'mousemove')
- taskMgr.do_method_later(.28, mousedown, 'mousedown')
+ await asyncio.sleep(.5)
+ system('xdotool mousedown %s' % btn)
+ await asyncio.sleep(.5)
+ system('xdotool mousemove %s %s' % (offset_x + end[0], offset_y + end[1]))
+ await asyncio.sleep(.5)
+ system('xdotool mouseup %s' % btn)
+ # def mousedown(task):
+ # system('xdotool mousedown %s' % btn)
+ # def mousemove(task):
+ # system('xdotool mousemove %s %s' % (offset_x + end[0], offset_y + end[1]))
+ # def mouseup(task):
+ # system('xdotool mouseup %s' % btn)
+ # taskMgr.do_method_later(.28, mouseup, 'mouseup')
+ # taskMgr.do_method_later(.28, mousemove, 'mousemove')
+ # taskMgr.do_method_later(.28, mousedown, 'mousedown')
- def _event(self, time, evt, mouse_args=None):
+ async def _event(self, time, evt, mouse_args=None):
+ await asyncio.sleep(time)
if evt == 'mouseclick':
- cback = lambda: self.__mouse_click(*mouse_args)
+ #cback = lambda: self.__mouse_click(*mouse_args)
+ await self.__mouse_click(*mouse_args)
elif evt == 'mousedrag':
- cback = lambda: self.__mouse_drag(*mouse_args)
- self._tasks += [(
- self._curr_time + time,
- cback,
- 'event: %s' % evt)]
- self._curr_time += time
+ #cback = lambda: self.__mouse_drag(*mouse_args)
+ await self.__mouse_drag(*mouse_args)
+ #self._tasks += [(
+ # self._curr_time + time,
+ # cback,
+ # 'event: %s' % evt)]
+ #self._curr_time += time
- def _enforce_res(self, time, res):
- def cback():
- self._proxy.enforce_res(res)
- info('enforce_res %s' % res)
- self._tasks += [(
- self._curr_time + time,
- cback,
- 'enforce res: %s' % res)]
- self._curr_time += time
+ async def _enforce_res(self, time, res):
+ await asyncio.sleep(time)
+ self._proxy.enforce_res(res)
+ #def cback():
+ # self._proxy.enforce_res(res)
+ # info('enforce_res %s' % res)
+ #self._tasks += [(
+ # self._curr_time + time,
+ # cback,
+ # 'enforce res: %s' % res)]
+ #self._curr_time += time
- def _enforce_resolution(self, time, res):
- def cback():
- self._proxy.enforce_resolution(res)
- info('enforce_resolution %s (send)' % res)
- self._tasks += [(
- self._curr_time + time,
- cback,
- 'enforce resolution: %s' % res)]
- self._curr_time += time
+ async def _enforce_resolution(self, time, res):
+ await asyncio.sleep(time)
+ self._proxy.enforce_resolution(res)
+ #def cback():
+ # self._proxy.enforce_resolution(res)
+ # info('enforce_resolution %s (send)' % res)
+ #self._tasks += [(
+ # self._curr_time + time,
+ # cback,
+ # 'enforce resolution: %s' % res)]
+ #self._curr_time += time
- def _verify(self):
- def __verify():
- self._proxy.verify()
- info('verify')
- self._tasks += [(
- self._curr_time + 3,
- lambda: __verify(),
- 'verify')]
- self._curr_time += 3
+ async def _verify(self, time):
+ await asyncio.sleep(time)
+ self._proxy.verify()
+ info('verify')
+ #def __verify():
+ # self._proxy.verify()
+ # info('verify')
+ #self._tasks += [(
+ # self._curr_time + 3,
+ # lambda: __verify(),
+ # 'verify')]
+ #self._curr_time += 3
- def _exit(self):
- def do_exit():
+ async def _exit(self, time):
+ await asyncio.sleep(time)
+ try:
self._proxy.close()
- exit()
- self._tasks += [(
- self._curr_time + 3,
- lambda: do_exit(),
- 'exit')]
+ except (ConnectionRefusedError, xmlrpc.client.Fault) as e: # the other part has been closed with the exit button
+ debug('already closed (%s)' % e)
+ debug('destroying FunctionalTest (%s)' % id(self))
+ exit()
+ #def do_exit():
+ # try:
+ # self._proxy.close()
+ # except (ConnectionRefusedError, xmlrpc.client.Fault) as e: # the other part has been closed with the exit button
+ # debug('already closed (%s)' % e)
+ # debug('destroying FunctionalTest (%s)' % id(self))
+ # exit()
+ #self._tasks += [(
+ # self._curr_time + 3,
+ # lambda: do_exit(),
+ # 'exit')]
- 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] < globalClock.getFrameTime():
- debug('%s %s' % (tsk[0], tsk[2]))
- tsk[1]()
- self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
- return task.cont
+ # 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] < globalClock.getFrameTime():
+ # debug('%s %s' % (tsk[0], tsk[2]))
+ # tsk[1]()
+ # self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
+ # return task.cont
- def _do_screenshots_1(self):
+ async 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_exit()
+ await self._screenshot(FunctionalTest.start_time, 'main_menu')
+ await self._do_screenshots_credits()
+ await self._do_screenshots_options()
+ await self._do_screenshots_exit()
- def _do_screenshots_credits(self):
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['credits', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'main_menu_back_from_credits')
+ async def _do_screenshots_credits(self):
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['credits', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'credits_menu')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'main_menu_back_from_credits')
- def _do_screenshots_options(self):
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
+ async def _do_screenshots_options(self):
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
# languages
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['languages', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'open_languages')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 120), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['italian', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_italian')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['languages', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'open_languages')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 120), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['italian', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu_italian')
# volume
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 163), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['volume', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_1')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 163), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['volume', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_1')
# antialiasing
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_no')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_no')
# shadows
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['shadows', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'shadows_no')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['shadows', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'shadows_no')
# test aa and shadows
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
- self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left']) # back
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left']) # play
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
- self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left']) # domino
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(900, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left']) # close instructions
- self._screenshot(FunctionalTest.screenshot_time, 'aa_no_shadows_no')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
- self._event(FunctionalTest.evt_time, 'mouseclick', ['home', 'left']) # home
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left']) # back
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left']) # play
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left']) # domino
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(900, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left']) # close instructions
+ await self._screenshot(FunctionalTest.screenshot_time, 'aa_no_shadows_no')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['home', 'left']) # home
- def _do_screenshots_restore_options(self):
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
+ async def _do_screenshots_restore_options(self):
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
# languages
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['languages', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'open_languages_restored')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 20), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['english', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_english')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['languages', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'open_languages_restored')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 20), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['english', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu_english')
# volume
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(719, 163), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['volume_0', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_2')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(719, 163), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['volume_0', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_2')
# fullscreen
# the first one is because of the windowed mode in test
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'fullscreen')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'fullscreen')
- #self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(440, 120), 'left'])
- #self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
- self._screenshot(8 + FunctionalTest.screenshot_time, 'back_from_fullscreen')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'fullscreen')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'fullscreen')
+ #await self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(440, 120), 'left'])
+ #await self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['fullscreen', 'left'])
+ await self._screenshot(8 + FunctionalTest.screenshot_time, 'back_from_fullscreen')
# resolution
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 340), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['resolutions', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'resolutions')
- self._enforce_resolution(FunctionalTest.evt_time, '1440x900')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1000, 440), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['res_1440x900', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, '1440x900')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 400), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['resolutions', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'resolutions_2')
- self._enforce_resolution(FunctionalTest.evt_time, '1360x768')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1110, 80), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['res_1360x768', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, '1360x768')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 340), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['resolutions', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'resolutions')
+ await self._enforce_resolution(FunctionalTest.evt_time, '1440x900')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1000, 440), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['res_1440x900', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, '1440x900')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 400), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['resolutions', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'resolutions_2')
+ await self._enforce_resolution(FunctionalTest.evt_time, '1360x768')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1110, 80), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['res_1360x768', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, '1360x768')
# antialiasing
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_yes')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_yes')
# shadows
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['shadows', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'shadows_yes')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
- self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['shadows', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'shadows_yes')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
- def _do_screenshots_play(self):
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'play_menu')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
- self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'back_from_play')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino scene
- self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_domino_instructions')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_domino')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
- self._event(FunctionalTest.evt_time, 'mouseclick', ['home', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'home_back_from_scene')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
- self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left']) # info
- self._event(FunctionalTest.evt_time, 'mouseclick', ['information', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'info')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- # self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (430, 280), 'left']) # drag a piece
- # self._screenshot(FunctionalTest.screenshot_time, 'domino_dragged')
- # self._event(FunctionalTest.evt_time, 'mouseclick', [(1220, 740), 'left']) # rewind
- # self._screenshot(FunctionalTest.screenshot_time, 'rewind')
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
- # self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
- self._event(FunctionalTest.evt_time, 'mouseclick', ['home_win', 'left']) # home
- self._screenshot(FunctionalTest.screenshot_time, 'home_back_from_fail')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left']) # play
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
- self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a piece .49 .06
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino_2')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left']) # play
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (570, 380), 'left']) # drag a piece -1.54 .06
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a piece -1.54 .06
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(570, 355), (605, 355), 'right']) # rotate the piece -1.05 .4
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_3', 'right']) # rotate the piece -1.54 .4 -1.05 .4
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_domino')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left']) # play
- self._screenshot(FunctionalTest.screenshot_time, 'scene_box')
+ async def _do_screenshots_play(self):
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'play_menu')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'back_from_play')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino scene
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_domino_instructions')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_domino')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['home', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'home_back_from_scene')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left']) # info
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['information', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'info')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ # await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (430, 280), 'left']) # drag a piece
+ # await self._screenshot(FunctionalTest.screenshot_time, 'domino_dragged')
+ # await self._event(FunctionalTest.evt_time, 'mouseclick', [(1220, 740), 'left']) # rewind
+ # await self._screenshot(FunctionalTest.screenshot_time, 'rewind')
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
+ # await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['home_win', 'left']) # home
+ await self._screenshot(FunctionalTest.screenshot_time, 'home_back_from_fail')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['play', 'left']) # play
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['domino', 'left'])
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a piece .49 .06
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino_2')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left']) # play
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (570, 380), 'left']) # drag a piece -1.54 .06
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a piece -1.54 .06
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(570, 355), (605, 355), 'right']) # rotate the piece -1.05 .4
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_3', 'right']) # rotate the piece -1.54 .4 -1.05 .4
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left']) # play
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_domino')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left']) # play
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_box')
# scene 2
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(880, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box .42 -3.29
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box .42 -3.29
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box .42 -2.18
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box .42 -2.18
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_box')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
- # self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box
- # self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (705, 460), 'left']) # drag a box .35 -1.06
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box .35 -1.06
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_box')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_box_domino')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(880, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box .42 -3.29
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box .42 -3.29
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box .42 -2.18
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box .42 -2.18
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_box')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
+ # await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box
+ # await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (705, 460), 'left']) # drag a box .35 -1.06
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box .35 -1.06
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_box')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_box_domino')
# scene 3
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box 3.21 -.78
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box 3.21 -.78
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 360), 'left']) # drag a box 3.21 .33
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box 3.21 .33
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_box_domino')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (835, 250), 'left']) # drag a box 2.16 1.87
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box 2.16 1.87
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_box_domino')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box 3.21 -.78
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box 3.21 -.78
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 360), 'left']) # drag a box 3.21 .33
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box 3.21 .33
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_box_domino')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (835, 250), 'left']) # drag a box 2.16 1.87
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box 2.16 1.87
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_box_domino')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_basketball')
# scene 4
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (650, 310), 'left']) # drag a ball -.42 1.03
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a ball -.42 1.03
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_basketball')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (380, 50), 'left']) # drag a ball -4.19 4.66
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a ball -4.19 4.66
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_basketball')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_domino_box_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (650, 310), 'left']) # drag a ball -.42 1.03
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a ball -.42 1.03
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (380, 50), 'left']) # drag a ball -4.19 4.66
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a ball -4.19 4.66
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_basketball')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_domino_box_basketball')
# scene 5
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(865, 490), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box -1.4 -.78
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -1.4 -.78
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (590, 370), 'left']) # drag a piece -1.26 .2
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_1', 'left']) # drag a piece -1.26 .2
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino_box_basketball')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (660, 440), 'left']) # drag a piece -.28 -.78
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'left']) # drag a piece -.28 -.78
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 425), (625, 425), 'right']) # rotate a piece -.28 -.57 -.77 -.57
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_2', 'drag_stop_3', 'right']) # rotate a piece -.28 -.57 -.77 -.57
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 435), (650, 445), 'left']) # drag a piece -.28 -.85 -.42 -.85
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_3', 'drag_stop_4', 'left']) # drag a piece -.28 -.85 -.42 -.85
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_domino_box_basketball')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_teeter_tooter')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(865, 490), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box -1.4 -.78
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -1.4 -.78
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (590, 370), 'left']) # drag a piece -1.26 .2
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_1', 'left']) # drag a piece -1.26 .2
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_domino_box_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (660, 440), 'left']) # drag a piece -.28 -.78
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'left']) # drag a piece -.28 -.78
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 425), (625, 425), 'right']) # rotate a piece -.28 -.57 -.77 -.57
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_2', 'drag_stop_3', 'right']) # rotate a piece -.28 -.57 -.77 -.57
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 435), (650, 445), 'left']) # drag a piece -.28 -.85 -.42 -.85
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_3', 'drag_stop_4', 'left']) # drag a piece -.28 -.85 -.42 -.85
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_domino_box_basketball')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_teeter_tooter')
# scene 6
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 485), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 300), 'left']) # drag a box -2.65 1.18
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -2.65 1.18
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_teeter_tooter')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 150), 'left']) # drag a box -2.65 3.27
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -2.65 3.27
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(515, 115), (515, 122), 'right']) # rotate a box -2.3 3.75 -2.5 3.66
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -2.3 3.75 -2.5 3.66
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_teeter_tooter')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
- self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'scene_teeter_domino_box_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 485), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 300), 'left']) # drag a box -2.65 1.18
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -2.65 1.18
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_teeter_tooter')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 150), 'left']) # drag a box -2.65 3.27
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -2.65 3.27
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(515, 115), (515, 122), 'right']) # rotate a box -2.3 3.75 -2.5 3.66
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -2.3 3.75 -2.5 3.66
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_teeter_tooter')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'scene_teeter_domino_box_basketball')
# scene 7
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
- self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (155, 180), 'left']) # drag a box -7.33 4.24
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -7.33 4.24
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_teeter_domino_box_basketball')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
- self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (170, 80), 'left']) # drag a box -7.12 4.24
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -7.12 4.24
- #self._event(FunctionalTest.drag_time, 'mousedrag', [(195, 50), (195, 80), 'right']) # rotate a box -6.77 4.66 -6.77 4.24
- self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -6.77 4.66 -6.77 4.24
- self._enforce_res(FunctionalTest.evt_time, 'win')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
- self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
- self._screenshot(16 + FunctionalTest.screenshot_time, 'win_teeter_domino_box_basketball')
- self._enforce_res(FunctionalTest.evt_time, '')
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
- self._event(FunctionalTest.evt_time, 'mouseclick', ['home_win', 'left'])
- self._screenshot(FunctionalTest.screenshot_time, 'home_from_play')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['close_instructions', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (155, 180), 'left']) # drag a box -7.33 4.24
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -7.33 4.24
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'fail_teeter_domino_box_basketball')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['replay', 'left'])
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (170, 80), 'left']) # drag a box -7.12 4.24
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -7.12 4.24
+ #await self._event(FunctionalTest.drag_time, 'mousedrag', [(195, 50), (195, 80), 'right']) # rotate a box -6.77 4.66 -6.77 4.24
+ await self._event(FunctionalTest.drag_time, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -6.77 4.66 -6.77 4.24
+ await self._enforce_res(FunctionalTest.evt_time, 'win')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['right', 'left'])
+ await self._screenshot(16 + FunctionalTest.screenshot_time, 'win_teeter_domino_box_basketball')
+ await self._enforce_res(FunctionalTest.evt_time, '')
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['home_win', 'left'])
+ await self._screenshot(FunctionalTest.screenshot_time, 'home_from_play')
- def _exit(self):
- self._tasks += [(
- self._curr_time + 3,
- lambda: exit(),
- 'exit')]
+ async def _do_screenshots_exit(self):
+ await self._verify(FunctionalTest.evt_time)
+ #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 600), 'left'])
+ await self._event(FunctionalTest.evt_time, 'mouseclick', ['exit', 'left'])
+ await self._exit(FunctionalTest.evt_time)
- def _do_screenshots_exit(self):
- self._verify()
- #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 600), 'left'])
- self._event(FunctionalTest.evt_time, 'mouseclick', ['exit', 'left'])
- self._exit()
-
- def _do_screenshots_2(self):
+ async def _do_screenshots_2(self):
info('_do_screenshots_2')
- self._screenshot(FunctionalTest.start_time, 'main_menu_2')
- self._do_screenshots_restore_options()
- self._do_screenshots_play()
- self._do_screenshots_exit()
+ await self._screenshot(FunctionalTest.start_time, 'main_menu_2')
+ await self._do_screenshots_restore_options()
+ await self._do_screenshots_play()
+ await self._do_screenshots_exit()
def _do_screenshots(self, idx):
- [self._do_screenshots_1, self._do_screenshots_2][int(idx) - 1]()
+ asyncio.run(
+ [self._do_screenshots_1, self._do_screenshots_2][int(idx) - 1]()
+ )
class TestApp(ShowBase):