ya2 · news · projects · code · about

fixes for building
authorFlavio Calva <f.calva@gmail.com>
Mon, 1 Aug 2022 18:33:06 +0000 (19:33 +0100)
committerFlavio Calva <f.calva@gmail.com>
Mon, 1 Aug 2022 18:33:06 +0000 (19:33 +0100)
pmachines/gui/menu.py
pmachines/posmgr.py
prj.org
tests/functional_test.py
tests/test_functional.py
ya2/utils/functional.py

index 3fa571d8668ff076eb786cfb6a2e00b806c16acb..8ec41a3c8d727246f962d865eebda7d76565d343 100644 (file)
@@ -106,7 +106,7 @@ class Menu(DirectObject):
 
         def btn_exit():
             if self._fun_test:
 
         def btn_exit():
             if self._fun_test:
-                ServerProxy('http://localhost:6000').destroy()
+                ServerProxy('http://localhost:7000').destroy()
             exit()
         self._widgets += [DirectButton(
             text=_('Exit'), pos=(0, 1, -.6), command=lambda: btn_exit(),
             exit()
         self._widgets += [DirectButton(
             text=_('Exit'), pos=(0, 1, -.6), command=lambda: btn_exit(),
index 0ec5340390d577855fc4efb1d618aace1925251b..077bd2a59d29b1ced9ff35f4e1504f4b426c02e5 100644 (file)
@@ -7,7 +7,7 @@ class PositionMgr:
         self._pos = {}
 
     def register(self, wdg, pos):
         self._pos = {}
 
     def register(self, wdg, pos):
-        print('register', wdg, pos)
+        print('register', wdg, pos)
         self._pos[wdg] = pos
 
     def get(self, tgt):
         self._pos[wdg] = pos
 
     def get(self, tgt):
diff --git a/prj.org b/prj.org
index 4887b944ef6dffcd27360294c334219344ea9dd8..a0b4289ae6fd9d16369778d1f78ca959b89a3e86 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,7 +3,8 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* CODE create builds and update website/itch.io
+* CODE logging functional tests: process name; during the execution and in the file
+* READY create builds and update website/itch.io
 * READY refactoring (recurring task)
 * BACKLOG intro animation (from target item to start position)
 * BACKLOG buttons of the scenes enabled sequentially
 * READY refactoring (recurring task)
 * BACKLOG intro animation (from target item to start position)
 * BACKLOG buttons of the scenes enabled sequentially
index acc95464ab173c6f4913b27f8faca5cc4fa919c7..e039c1c64cb0b63f99c00b7f49a8bba5310ba804 100644 (file)
@@ -21,25 +21,28 @@ from panda3d.core import Filename
 from direct.showbase.ShowBase import ShowBase
 from direct.gui.OnscreenText import OnscreenText
 from ya2.build.build import _branch
 from direct.showbase.ShowBase import ShowBase
 from direct.gui.OnscreenText import OnscreenText
 from ya2.build.build import _branch
+import asyncio
+import xmlrpc
 
 
 class FunctionalTest:
 
 
 
 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):
     start_time = 2
 
     def __init__(self, idx, offset):
+        debug('creating FunctionalTest (%s)' % id(self))
         super().__init__()
         info('test idx: %s' % idx)
         self._offset = offset
         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
         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.set_idx(idx)
         self._do_screenshots(idx)
 
@@ -49,439 +52,468 @@ class FunctionalTest:
         self._proxy.screenshot(name)
         info('screenshot %s' % name)
 
         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)
         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]))
         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]))
         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':
         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':
         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()
             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')
         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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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
         # 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')
         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):
 
     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):
 
 
 class TestApp(ShowBase):
index 49ab3ffbd727d9d9480fd55b2ce9a1f2b9d9d31e..c5cb38047dd43c54bf5f91a97461269a8ea7cf63 100644 (file)
@@ -11,6 +11,7 @@ from time import sleep
 from os import system, remove, environ
 from os.path import exists, basename, join
 from glob import glob
 from os import system, remove, environ
 from os.path import exists, basename, join
 from glob import glob
+from subprocess import PIPE, run, Popen
 from panda3d.core import Filename
 from ya2.build.build import exec_cmd, _branch, _version
 
 from panda3d.core import Filename
 from ya2.build.build import exec_cmd, _branch, _version
 
@@ -66,14 +67,54 @@ class FunctionalTests(TestCase):
         print('compare %s %s: %s' % (ref_img, tst_img, res))
         return float(res) > .8
 
         print('compare %s %s: %s' % (ref_img, tst_img, res))
         return float(res) > .8
 
-    def __test_template(self, cmd, path):
+    def __test_template(self, app_cmd, test1_cmd, test2_cmd, path):
         if environ.get('FUNCTIONAL') != '1':
             self.skipTest('skipped functional tests')
         self.__clean()
         self.__awake()
         system('amixer sset Master 0%')
         if environ.get('FUNCTIONAL') != '1':
             self.skipTest('skipped functional tests')
         self.__clean()
         self.__awake()
         system('amixer sset Master 0%')
-        ret = system(cmd)
-        self.assertEqual(ret, 0, 'error while executing ' + cmd)
+        #ret = system(cmd)
+        #proc = run(cmd, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=check)
+        #return proc.stdout.strip() + proc.stderr.strip()
+        info('launching ' + app_cmd)
+        print('launching ' + app_cmd)
+        p_app = Popen(app_cmd, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+        sleep(8)
+        info('launching ' + test1_cmd)
+        print('launching ' + test1_cmd)
+        p_test = Popen(test1_cmd, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+        p_app_out, p_app_err = p_app.communicate()
+        t_out, t_err = p_test.communicate()
+        info('output (%s): %s' % (app_cmd, p_app_out))
+        info('error (%s): %s' % (app_cmd, p_app_err))
+        info('output (%s): %s' % (test1_cmd, t_out))
+        info('error (%s): %s' % (test1_cmd, t_err))
+        print('output (%s): %s' % (app_cmd, p_app_out))
+        print('error (%s): %s' % (app_cmd, p_app_err))
+        print('output (%s): %s' % (test1_cmd, t_out))
+        print('error (%s): %s' % (test1_cmd, t_err))
+        self.assertEqual(p_app.returncode, 0, 'error while executing ' + app_cmd)
+        self.assertEqual(p_test.returncode, 0, 'error while executing ' + test1_cmd)
+        sleep(12)
+        info('launching ' + app_cmd)
+        print('launching ' + app_cmd)
+        p_app = Popen(app_cmd, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+        sleep(8)
+        info('launching ' + test2_cmd)
+        print('launching ' + test2_cmd)
+        p_test = Popen(test2_cmd, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+        p_app_out, p_app_err = p_app.communicate()
+        t_out, t_err = p_test.communicate()
+        info('output (%s): %s' % (app_cmd, p_app_out))
+        info('error (%s): %s' % (app_cmd, p_app_err))
+        info('output (%s): %s' % (test2_cmd, t_out))
+        info('error (%s): %s' % (test2_cmd, t_err))
+        print('output (%s): %s' % (app_cmd, p_app_out))
+        print('error (%s): %s' % (app_cmd, p_app_err))
+        print('output (%s): %s' % (test2_cmd, t_out))
+        print('error (%s): %s' % (test2_cmd, t_err))
+        self.assertEqual(p_app.returncode, 0, 'error while executing ' + app_cmd)
+        self.assertEqual(p_test.returncode, 0, 'error while executing ' + test2_cmd)
         files = glob(str(Path.home()) + '/.local/share/pmachines/tests/functional_ref_%s/*.png' % _branch())
         self.assertGreater(len(files), 1)
         for fname in files:
         files = glob(str(Path.home()) + '/.local/share/pmachines/tests/functional_ref_%s/*.png' % _branch())
         self.assertGreater(len(files), 1)
         for fname in files:
@@ -92,10 +133,9 @@ class FunctionalTests(TestCase):
     def test_code(self):
         info('test_code')
         self.__test_template(
     def test_code(self):
         info('test_code')
         self.__test_template(
-            'timeout 720s ~/venv/bin/python main.py --functional-test & '
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 1; sleep 5; '
-            'timeout 720s ~/venv/bin/python main.py --functional-test & '
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 2',
+            'timeout 7200s ~/venv/bin/python main.py --functional-test',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2',
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_appimage(self):
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_appimage(self):
@@ -103,10 +143,9 @@ class FunctionalTests(TestCase):
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
         bld_branch = '' if bld_branch == 'stable' else ('-' + bld_branch)
         self.__test_template(
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
         bld_branch = '' if bld_branch == 'stable' else ('-' + bld_branch)
         self.__test_template(
-            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test & '
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 1; sleep 5; '
-            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test & ' % (bld_branch, bld_branch) +
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 2',
+            'timeout 7200s ./dist/Pmachines%s-x86_64.AppImage --functional-test' % bld_branch,
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2',
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     # def test_flatpak(self):
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     # def test_flatpak(self):
@@ -144,10 +183,9 @@ class FunctionalTests(TestCase):
             return
         self.__update_itchio()
         self.__test_template(
             return
         self.__update_itchio()
         self.__test_template(
-            'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test & '
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 1; sleep 5; '
-            'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test & '
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 2',
+            'timeout 7200s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2',
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_windows(self):
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_windows(self):
@@ -155,10 +193,9 @@ class FunctionalTests(TestCase):
         system('pkill -f "pmachines.exe"')
         abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
         self.__test_template(
         system('pkill -f "pmachines.exe"')
         abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
         self.__test_template(
-            'timeout 720s wine %s --functional-test & ' % abspath +
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 1; sleep 5; '
-            'timeout 720s wine %s --functional-test & ' % abspath +
-            'timeout 720s ~/venv/bin/python -m tests.functional_test.py 2',
+            'timeout 7200s wine %s --functional-test' % abspath,
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1',
+            'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2',
             str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     def test_versions(self):
             str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     def test_versions(self):
@@ -177,15 +214,15 @@ class FunctionalTests(TestCase):
                 __ver = fver.read().strip() + '-'
         exp = '%s-%s' % (__ver, commit)
         cmds = [
                 __ver = fver.read().strip() + '-'
         exp = '%s-%s' % (__ver, commit)
         cmds = [
-            ('timeout 720s ./build/manylinux2010_x86_64/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
-            ('timeout 720s ./dist/Pmachines-%s-x86_64.AppImage --version' % bld_branch, str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
-            ('timeout 720s wine ./build/win_amd64/pmachines.exe --version', '/home/flavio/.wine/drive_c/users/flavio/AppData/Local/pmachines/obs_version.txt')
+            ('timeout 7200s ./build/manylinux2010_x86_64/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
+            ('timeout 7200s ./dist/Pmachines-%s-x86_64.AppImage --version' % bld_branch, str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt'),
+            ('timeout 7200s wine ./build/win_amd64/pmachines.exe --version', '/home/flavio/.wine/drive_c/users/flavio/AppData/Local/pmachines/obs_version.txt')
         ]
         if environ.get('FUNCTIONALPOST') == '1':
             if _branch() == 'master':
                 self.__update_itchio()
         ]
         if environ.get('FUNCTIONALPOST') == '1':
             if _branch() == 'master':
                 self.__update_itchio()
-                cmds += [('timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt')]
-            # cmds += [('timeout 720s flatpak run it.ya2.Pmachines//%s --version' % bld_branch, '/home/flavio/.var/app/it.ya2.Pmachines/data/pmachines/obs_version.txt')]
+                cmds += [('timeout 7200s /home/flavio/.config/itch/apps/pmachines/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt')]
+            # cmds += [('timeout 7200s flatpak run it.ya2.Pmachines//%s --version' % bld_branch, '/home/flavio/.var/app/it.ya2.Pmachines/data/pmachines/obs_version.txt')]
         # info('executing flatpak update --user -y it.ya2.Pmachines//%s' % bld_branch)
         # #system('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
         # fout = exec_cmd('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
         # info('executing flatpak update --user -y it.ya2.Pmachines//%s' % bld_branch)
         # #system('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
         # fout = exec_cmd('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
index 719bcbfe1f53eb48387f3499da1122f74f5da2a9..abe1079e0f8fe83f82ca2c68784c24bac5de26bc 100644 (file)
@@ -13,7 +13,7 @@ from ya2.build.build import _branch
 class RPCServer(SimpleXMLRPCServer):
 
     def __init__(self, callbacks):
 class RPCServer(SimpleXMLRPCServer):
 
     def __init__(self, callbacks):
-        super().__init__(('localhost', 6000), allow_none=True)
+        super().__init__(('localhost', 7000), allow_none=True)
         self._callbacks = callbacks
         self.register_introspection_functions()
         self.register_function(self.screenshot, 'screenshot')
         self._callbacks = callbacks
         self.register_introspection_functions()
         self.register_function(self.screenshot, 'screenshot')