ya2 · news · projects · code · about

retrieve test coordinates
authorFlavio Calva <f.calva@gmail.com>
Thu, 16 Jun 2022 18:15:10 +0000 (19:15 +0100)
committerFlavio Calva <f.calva@gmail.com>
Thu, 16 Jun 2022 18:15:10 +0000 (19:15 +0100)
gui/menu.py
logics/app.py
logics/posmgr.py [new file with mode: 0644]
logics/scene.py
prj.org
tests/functional_test.py
ya2/p3d/p3d.py
ya2/utils/functional.py

index 54929d986f73db30473e41163f659476867602f0..335fadec4c061f61e97bccf8d8c3984e17f53db6 100644 (file)
@@ -7,20 +7,21 @@ from inspect import isclass
 from webbrowser import open_new_tab
 from xmlrpc.client import ServerProxy
 from panda3d.core import Texture, TextNode, WindowProperties, LVector2i, \
-    TextProperties, TextPropertiesManager
+    TextProperties, TextPropertiesManager, NodePath
 from direct.gui.DirectGui import DirectButton, DirectCheckButton, \
     DirectOptionMenu, DirectSlider, DirectCheckButton
 from direct.gui.DirectGuiGlobals import FLAT
 from direct.gui.OnscreenText import OnscreenText
 from direct.showbase.DirectObject import DirectObject
 from ya2.utils.cursor import MouseCursor
+from ya2.p3d.p3d import LibP3d
 from logics.scene import Scene
 from panda3d.bullet import BulletWorld
 
 
 class Menu(DirectObject):
 
-    def __init__(self, fsm, lang_mgr, opt_file, music, pipeline, scenes, fun_test):
+    def __init__(self, fsm, lang_mgr, opt_file, music, pipeline, scenes, fun_test, pos_mgr):
         super().__init__()
         self._fsm = fsm
         self._lang_mgr = lang_mgr
@@ -29,6 +30,7 @@ class Menu(DirectObject):
         self._pipeline = pipeline
         self._scenes = scenes
         self._fun_test = fun_test
+        self._pos_mgr = pos_mgr
         self._enforced_res = ''
         self._cursor = MouseCursor(
             'assets/images/buttons/arrowUpLeft.dds', (.04, 1, .04), (.5, .5, .5, 1),
@@ -76,16 +78,20 @@ class Menu(DirectObject):
         info('enforced resolution: ' + val)
 
     def _set_main(self):
+        self._pos_mgr.reset()
         self._widgets = []
         self._widgets += [DirectButton(
             text=_('Play'), pos=(0, 1, .6), command=self.on_play,
             **self._common_btn)]
+        self._pos_mgr.register('play', LibP3d.wdg_pos(self._widgets[-1]))
         self._widgets += [DirectButton(
             text=_('Options'), pos=(0, 1, .2), command=self.on_options,
             **self._common_btn)]
+        self._pos_mgr.register('options', LibP3d.wdg_pos(self._widgets[-1]))
         self._widgets += [DirectButton(
             text=_('Credits'), pos=(0, 1, -.2), command=self.on_credits,
             **self._common_btn)]
+        self._pos_mgr.register('credits', LibP3d.wdg_pos(self._widgets[-1]))
         def btn_exit():
             if self._fun_test:
                 ServerProxy('http://localhost:6000').destroy()
@@ -93,10 +99,12 @@ class Menu(DirectObject):
         self._widgets += [DirectButton(
             text=_('Exit'), pos=(0, 1, -.6), command=lambda: btn_exit(),
             **self._common_btn)]
+        self._pos_mgr.register('exit', LibP3d.wdg_pos(self._widgets[-1]))
         self._rearrange_width()
         self.accept('enforce_resolution', self.enforce_res)
 
     def _set_options(self):
+        self._pos_mgr.reset()
         self._widgets = []
         self._lang_funcs = [lambda: _('English'), lambda: _('Italian')]
         items = [fnc() for fnc in self._lang_funcs]
@@ -110,6 +118,12 @@ class Menu(DirectObject):
         btn.popupMenu['frameColor'] = self._common_btn['frameColor']
         btn.popupMenu['relief'] = self._common_btn['relief']
         self._widgets += [btn]
+        pos_lang = LibP3d.wdg_pos(self._widgets[-1])
+        self._pos_mgr.register('languages', pos_lang)
+        pos_eng = pos_lang[0] + 300, pos_lang[1] - 57
+        pos_it = pos_lang[0] + 300, pos_lang[1] + 33
+        self._pos_mgr.register('english', pos_eng)
+        self._pos_mgr.register('italian', pos_it)
         self._widgets += [OnscreenText(
             _('Volume'), pos=(-.1, .55), font=self._common['text_font'],
             scale=self._common['scale'], fg=self._common['text_fg'],
@@ -119,6 +133,9 @@ class Menu(DirectObject):
             value=self._opt_file['settings']['volume'],
             command=self.on_volume,
             **self._common_slider)]
+        vol_pos = LibP3d.wdg_pos(self._widgets[-1])
+        self._pos_mgr.register('volume', vol_pos)
+        self._pos_mgr.register('volume_0', [vol_pos[0] - 153, vol_pos[1]])
         self._slider = self._widgets[-1]
         self._widgets += [DirectCheckButton(
             text=_('Fullscreen'), pos=(0, 1, .3), command=self.on_fullscreen,
@@ -126,6 +143,7 @@ class Menu(DirectObject):
             indicator_relief=self._common_btn['relief'],
             indicatorValue=self._opt_file['settings']['fullscreen'],
             **self._common_btn)]
+        self._pos_mgr.register('fullscreen', LibP3d.wdg_pos(self._widgets[-1]))
         res = self._opt_file['settings']['resolution']
         d_i = base.pipe.get_display_information()
         def _res(idx):
@@ -145,24 +163,32 @@ class Menu(DirectObject):
         btn.popupMenu['frameColor'] = self._common_btn['frameColor']
         btn.popupMenu['relief'] = self._common_btn['relief']
         self._widgets += [btn]
+        pos_res = LibP3d.wdg_pos(self._widgets[-1])
+        self._pos_mgr.register('resolutions', pos_res)  # 680 365
+        self._pos_mgr.register('res_1440x900', [pos_res[0] + 320, pos_res[1] + 75])
+        self._pos_mgr.register('res_1360x768', [pos_res[0] + 430, pos_res[1] -285])
         self._widgets += [DirectCheckButton(
             text=_('Antialiasing'), pos=(0, 1, -.2), command=self.on_aa,
             indicator_frameColor=self._common_opt['highlightColor'],
             indicator_relief=self._common_btn['relief'],
             indicatorValue=self._opt_file['settings']['antialiasing'],
             **self._common_btn)]
+        self._pos_mgr.register('aa', LibP3d.wdg_pos(self._widgets[-1]))
         self._widgets += [DirectCheckButton(
             text=_('Shadows'), pos=(0, 1, -.45), command=self.on_shadows,
             indicator_frameColor=self._common_opt['highlightColor'],
             indicator_relief=self._common_btn['relief'],
             indicatorValue=self._opt_file['settings']['shadows'],
             **self._common_btn)]
+        self._pos_mgr.register('shadows', LibP3d.wdg_pos(self._widgets[-1]))
         self._widgets += [DirectButton(
             text=_('Back'), pos=(0, 1, -.8), command=self.on_back,
             **self._common_btn)]
+        self._pos_mgr.register('back', LibP3d.wdg_pos(self._widgets[-1]))
         self.accept('enforce_resolution', self.enforce_res)
 
     def _set_credits(self):
+        self._pos_mgr.reset()
         self._widgets = []
         tp_scale = TextProperties()
         tp_scale.set_text_scale(.64)
@@ -183,9 +209,11 @@ class Menu(DirectObject):
         self._widgets += [DirectButton(
             text=_('Back'), pos=(0, 1, -.8), command=self.on_back,
             **self._common_btn)]
+        self._pos_mgr.register('back', LibP3d.wdg_pos(self._widgets[-1]))
         self.accept('enforce_resolution', self.enforce_res)
 
     def on_play(self):
+        self._pos_mgr.reset()
         self.destroy()
         self._cursor = MouseCursor(
             'assets/images/buttons/arrowUpLeft.dds', (.04, 1, .04), (.5, .5, .5, 1),
@@ -204,6 +232,8 @@ class Menu(DirectObject):
                 command=self.start, extraArgs=[cls], text_wordwrap=6,
                 frameTexture='assets/images/scenes/%s.dds' % cls.__name__,
                 **cmn)]
+            name = cls.__name__[5:].lower()
+            self._pos_mgr.register(name, LibP3d.wdg_pos(self._widgets[-1]))
             for j in range(4):
                 tnode = self._widgets[-1].component('text%s' % j).textNode
                 height = - tnode.getLineHeight() / 2
@@ -212,6 +242,7 @@ class Menu(DirectObject):
         self._widgets += [DirectButton(
             text=_('Back'), pos=(0, 1, -.8), command=self.on_back,
             **self._common_btn)]
+        self._pos_mgr.register('back', LibP3d.wdg_pos(self._widgets[-1]))
 
     def start(self, cls):
         self._fsm.demand('Scene', cls)
index 904a7a6e77412c0faea887befec4dbb9b04fc773..0ee87cc2829b3d456c8eb8ec9cc887ca0370da0d 100755 (executable)
@@ -25,6 +25,7 @@ from logics.scenes.scene_domino_box import SceneDominoBox
 from logics.scenes.scene_domino import SceneDomino
 from logics.scenes.scene_teeter_domino_box_basketball import SceneTeeterDominoBoxBasketball
 from logics.scenes.scene_teeter_tooter import SceneTeeterTooter
+from logics.posmgr import PositionMgr
 from ya2.utils.dictfile import DctFile
 from ya2.p3d.p3d import LibP3d
 from ya2.utils.lang import LangMgr
@@ -72,6 +73,7 @@ class PmachinesApp:
         self.updating = args.update
         self.version = args.version
         self.log_mgr = LogMgr.init_cls()(self)
+        self._pos_mgr = PositionMgr()
         self._prepare_window(args)
         if args.update:
             return
@@ -98,13 +100,14 @@ class PmachinesApp:
         else:
             self._fsm.demand('Menu')
         if args.functional_test or args.functional_ref:
-            FunctionalTest(args.functional_ref)
+            FunctionalTest(args.functional_ref, self._pos_mgr)
 
     def on_menu_enter(self):
         self._menu_bg = Background()
         self._menu = Menu(
             self._fsm, self.lang_mgr, self._options, self._music,
-            self._pipeline, self.scenes, self._args.functional_test or self._args.functional_ref)
+            self._pipeline, self.scenes, self._args.functional_test or self._args.functional_ref,
+            self._pos_mgr)
 
     def on_home(self):
         self._fsm.demand('Menu')
@@ -120,7 +123,8 @@ class PmachinesApp:
             self._options['development']['auto_close_instructions'],
             self._options['development']['debug_items'],
             self.reload,
-            self.scenes)
+            self.scenes,
+            self._pos_mgr)
 
     def on_scene_exit(self):
         self._unset_physics()
diff --git a/logics/posmgr.py b/logics/posmgr.py
new file mode 100644 (file)
index 0000000..980d43c
--- /dev/null
@@ -0,0 +1,14 @@
+class PositionMgr:
+
+    def __init__(self):
+        self._pos = {}
+
+    def reset(self):
+        self._pos = {}
+
+    def register(self, wdg, pos):
+        print('register', wdg, pos)
+        self._pos[wdg] = pos
+
+    def get(self, tgt):
+        return self._pos[tgt]
index 548ec22bcd50f7564b3d5e394ef4b46dddcae9e5..ae168b35add3b41bafac90957175ae492ee5d172 100644 (file)
@@ -16,16 +16,19 @@ from logics.items.background import Background
 from gui.sidepanel import SidePanel
 from ya2.utils.cursor import MouseCursor
 from ya2.p3d.gfx import P3dGfxMgr
+from ya2.p3d.p3d import LibP3d
 
 
 class Scene(DirectObject):
 
-    def __init__(self, world, exit_cb, auto_close_instr, dbg_items, reload_cb, scenes):
+    def __init__(self, world, exit_cb, auto_close_instr, dbg_items, reload_cb, scenes, pos_mgr):
         super().__init__()
         self._world = world
         self._exit_cb = exit_cb
         self._dbg_items = dbg_items
         self._reload_cb = reload_cb
+        self._pos_mgr = pos_mgr
+        self._pos_mgr.reset()
         self._scenes = scenes
         self._enforce_res = ''
         self.accept('enforce_res', self.enforce_res)
@@ -177,6 +180,7 @@ class Scene(DirectObject):
                 rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
                 clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
             btn.set_transparency(True)
+            self._pos_mgr.register(binfo[0], LibP3d.wdg_pos(btn))
             btns += [btn]
         self.__home_btn, self.__info_btn, self.__right_btn = btns
         # , self.__next_btn, self.__prev_btn, self.__rewind_btn
@@ -427,6 +431,7 @@ class Scene(DirectObject):
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
         btn.set_transparency(True)
+        self._pos_mgr.register('close_instructions', LibP3d.wdg_pos(btn))
 
     def _set_win(self):
         loader.load_sfx('assets/audio/sfx/success.ogg').play()
@@ -471,6 +476,7 @@ class Scene(DirectObject):
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
         btn.set_transparency(True)
+        self._pos_mgr.register('home_win', LibP3d.wdg_pos(btn))
         imgs = [self.__load_img_btn('rewind', col) for col in colors]
         btn = DirectButton(
             image=imgs, scale=btn_scale,
@@ -479,6 +485,7 @@ class Scene(DirectObject):
             relief=FLAT, frameColor=(.6, .6, .6, .08),
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
+        self._pos_mgr.register('replay', LibP3d.wdg_pos(btn))
         btn.set_transparency(True)
         enabled = self._scenes.index(self.__class__) < len(self._scenes) - 1
         if enabled:
@@ -495,6 +502,7 @@ class Scene(DirectObject):
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
         btn['state'] = NORMAL if enabled else DISABLED
+        self._pos_mgr.register('next', LibP3d.wdg_pos(btn))
         btn.set_transparency(True)
 
     def _set_fail(self):
@@ -539,6 +547,7 @@ class Scene(DirectObject):
             relief=FLAT, frameColor=(.6, .6, .6, .08),
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
+        self._pos_mgr.register('home_win', LibP3d.wdg_pos(btn))
         btn.set_transparency(True)
         imgs = [self.__load_img_btn('rewind', col) for col in colors]
         btn = DirectButton(
@@ -548,6 +557,7 @@ class Scene(DirectObject):
             relief=FLAT, frameColor=(.6, .6, .6, .08),
             rolloverSound=loader.load_sfx('assets/audio/sfx/rollover.ogg'),
             clickSound=loader.load_sfx('assets/audio/sfx/click.ogg'))
+        self._pos_mgr.register('replay', LibP3d.wdg_pos(btn))
         btn.set_transparency(True)
 
     def _on_restart(self, frm):
diff --git a/prj.org b/prj.org
index 409095735424a1400535999cb08a6832a756fd2f..97eef1a7162f61445f2e7846a46732025b15117b 100644 (file)
--- a/prj.org
+++ b/prj.org
@@ -3,8 +3,7 @@
 #+CATEGORY: pmachines
 #+TAGS: bug(b) calendar(c) waiting(w)
 
-* RED retrieve the coordinates of testing elements
-* READY functional tests for performance (frame rate)
+* RED functional tests for performance (frame rate)
 * READY functional tests for "cleaning" i.e. at the end of the states verify:
 - [ ] active threads
 - [ ] active tasks
index 83e7e704c878fbab4be512180f79adf2f24cb077..9aa1d8ac045095e9721da214449c8d8404fa3df0 100644 (file)
@@ -57,10 +57,12 @@ class FunctionalTest(GameObject):
             'screenshot: %s' % name)]
         self._curr_time += time
 
-    def __mouse_click(self, pos, btn):
+    def __mouse_click(self, tgt, btn):
         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)
@@ -148,208 +150,285 @@ class FunctionalTest(GameObject):
         self._do_screenshots_exit()
 
     def _do_screenshots_credits(self):
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left'])
+        #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', [(680, 680), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['back', 'left'])
         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', [(680, 300), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'options_menu')
         # languages
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
+        #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', [(980, 120), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['italian', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'options_menu_italian')
         # volume
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 163), 'left'])
+        #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')
         # antialiasing
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+        #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_no')
         # shadows
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
+        #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['shadows', 'left'])
         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', [(680, 140), 'left'])  # play
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left'])  # domino
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(900, 490), 'left'])  # close instructions
+        #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', [(25, 740), 'left'])  # home
+        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', [(680, 300), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['options', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'options_menu_restored')
         # languages
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
+        #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', [(980, 20), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['english', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'options_menu_english')
         # volume
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(719, 163), 'left'])
+        #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')
         # 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', [(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', [(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(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')
         # resolution
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 340), 'left'])
+        #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', [(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', [(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', [(1110, 80), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['res_1360x768', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, '1360x768')
         # antialiasing
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+        #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['aa', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_yes')
         # shadows
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
+        #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', [(680, 680), 'left'])  # back
+        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', [(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', [(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', [(230, 160), 'left'])  # domino 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 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', [(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', [(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', [(230, 160), 'left'])  # domino
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left'])  # close instructions
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left'])  # info
+        #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', [(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', [(35, 60), (715, 380), 'left'])  # drag a piece
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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', [(230, 160), 'left'])  # domino
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left'])  # close instructions
+        #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', [(35, 60), (715, 380), 'left'])  # drag a piece
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(570, 355), (605, 355), 'right'])  # rotate the piece
         self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), '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', [(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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])  # play
         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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left'])  # drag a box
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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', [(65, 60), (710, 540), 'left'])  # drag a box
         self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (705, 460), 'left'])  # drag a box
         self._enforce_res(FunctionalTest.evt_time, 'win')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
         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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 360), 'left'])  # drag a box
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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', [(65, 60), (835, 250), 'left'])  # drag a box
         self._enforce_res(FunctionalTest.evt_time, 'win')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
         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', [(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
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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
         self._enforce_res(FunctionalTest.evt_time, 'win')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
         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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (590, 370), 'left'])  # drag a piece
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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', [(30, 60), (660, 440), 'left'])  # drag a piece
         self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 425), (625, 425), 'right'])  # rotate a piece
         self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 435), (650, 445), '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', [(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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
         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', [(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
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(515, 115), (515, 122), 'right'])  # rotate a box
         self._enforce_res(FunctionalTest.evt_time, 'win')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(735, 450), 'left'])  # next
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['next', 'left'])
         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', [(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
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(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
         self._event(FunctionalTest.drag_time, 'mousedrag', [(195, 50), (195, 80), 'right'])  # rotate a box
         self._enforce_res(FunctionalTest.evt_time, 'win')
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left'])  # play
+        #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', [(630, 450), 'left'])  # home
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['home_win', 'left'])
         self._screenshot(FunctionalTest.screenshot_time, 'home_from_play')
 
     def _exit(self):
@@ -360,7 +439,8 @@ class FunctionalTest(GameObject):
 
     def _do_screenshots_exit(self):
         self._verify()
-        self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 600), 'left'])
+        #self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 600), 'left'])
+        self._event(FunctionalTest.evt_time, 'mouseclick', ['exit', 'left'])
         self._exit()
 
     def _do_screenshots_2(self):
index f4115e99b81b4d1be5a872d220f57c0bceee64fa..2ea7b6f9e2f4d9f469f093004f83e3cb337d3730 100755 (executable)
@@ -266,6 +266,11 @@ class LibP3d(DirectObject):
     @property
     def aspect_ratio(self): return base.getAspectRatio()
 
+    @staticmethod
+    def wdg_pos(wdg):
+        pos = wdg.get_pos(pixel2d)
+        return int(round(pos[0])), int(round(-pos[2]))
+
     @staticmethod
     def set_icon(filename):
         props = WindowProperties()
index a3459ca0fa27a672351cb2ba420faa4f9a17db03..1a886cb13155af3bf08270258cdc4fe887ca7b5a 100644 (file)
@@ -26,6 +26,7 @@ class RPCServer(SimpleXMLRPCServer):
         self.register_function(self.verify, 'verify')
         self.register_function(self.set_idx, 'set_idx')
         self.register_function(self.enforce_resolution, 'enforce_resolution')
+        self.register_function(self.get_pos, 'get_pos')
         self.register_function(self.destroy, 'destroy')
 
     def screenshot(self, arg):
@@ -43,6 +44,9 @@ class RPCServer(SimpleXMLRPCServer):
     def enforce_resolution(self, arg):
         taskMgr.doMethodLater(.01, self._callbacks[4], 'cb4', [arg])
 
+    def get_pos(self, arg):
+        return self._callbacks[5](arg)
+
     def destroy(self):
         self._BaseServer__shutdown_request = True
 
@@ -60,9 +64,10 @@ class RPCServerThread(Thread):
 
 class FunctionalTest(GameObject):
 
-    def __init__(self, ref):
+    def __init__(self, ref, pos_mgr):
         super().__init__()
-        RPCServerThread([self._do_screenshot, self._do_enforce_res, self.__verify, self._set_idx, self._do_enforce_resolution]).start()
+        self._pos_mgr = pos_mgr
+        RPCServerThread([self._do_screenshot, self._do_enforce_res, self.__verify, self._set_idx, self._do_enforce_resolution, self.__get_pos]).start()
         self.txt = OnscreenText('', fg=(1, 0, 0, 1), scale=.16)
         #self._path = ''
         #if self.eng.is_appimage:
@@ -88,6 +93,9 @@ class FunctionalTest(GameObject):
         info('creating dir: %s' % self._path)
         makedirs(self._path, exist_ok=True)
 
+    def __get_pos(self, tgt):
+        return self._pos_mgr.get(tgt)
+
     def _do_screenshot(self, name):
         self._fnames += [self._path + name]
         #time = datetime.datetime.now().strftime('%y%m%d%H%M%S')