From: Flavio Calva Date: Tue, 22 Mar 2022 17:49:03 +0000 (+0100) Subject: functional tests: options X-Git-Url: http://git.ya2.it/?p=pmachines.git;a=commitdiff_plain;h=d982c0a5d0a222a237eac9e9a955b216212e99d6 functional tests: options --- diff --git a/game/app.py b/game/app.py index f3fa873..6ca298f 100755 --- a/game/app.py +++ b/game/app.py @@ -129,6 +129,9 @@ class PmachinesApp: load_prc_file_data('', 'window-title pmachines') load_prc_file_data('', 'framebuffer-srgb true') load_prc_file_data('', 'sync-video true') + if args.functional_test or args.functional_ref: + load_prc_file_data('', 'win-size 1280 720') + # otherwise it is not centered in exwm # load_prc_file_data('', 'threading-model Cull/Draw') # it freezes when you go to the next scene if args.screenshot: @@ -198,11 +201,11 @@ class PmachinesApp: _res(idx) for idx in range(d_i.get_total_display_modes())] res = sorted(resolutions)[-1] fullscreen = self._options['settings']['fullscreen'] + props = WindowProperties() if args.functional_test or args.functional_ref: - res = 1280, 720 fullscreen = False - props = WindowProperties() - props.set_size(res) + else: + props.set_size(res) props.set_fullscreen(fullscreen) props.set_icon_filename('assets/images/icon/pmachines.ico') if not args.screenshot: diff --git a/lib/engine/functional.py b/lib/engine/functional.py index 8c1f019..87211b8 100644 --- a/lib/engine/functional.py +++ b/lib/engine/functional.py @@ -23,7 +23,7 @@ class FunctionalTest(GameObject): screenshot_time = 1.2 evt_time = 1.0 - start_time = 5 + start_time = 2 def __init__(self, idx, ref): super().__init__() @@ -176,7 +176,7 @@ class FunctionalTest(GameObject): info('_do_screenshots_1') self._screenshot(FunctionalTest.start_time, 'main_menu') self._do_screenshots_credits() - # self._do_screenshots_options() + self._do_screenshots_options() self._do_screenshots_exit() def _do_screenshots_credits(self): @@ -203,7 +203,55 @@ class FunctionalTest(GameObject): # self._event(FunctionalTest.evt_time, 'arrow_up') # self._event(FunctionalTest.evt_time, 'arrow_up') - # def _do_screenshots_options(self): + def _do_screenshots_options(self): + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -80), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'options_menu') + # languages + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -300), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'open_languages_1') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(280, -324), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'options_menu_english') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -300), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'open_languages_2') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(280, -240), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'options_menu_italian') + # volume + self._event(FunctionalTest.evt_time, 'mousedrag', False, False, [(44, -207), (67, -207), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_1') + self._event(FunctionalTest.evt_time, 'mousedrag', False, False, [(67, -207), (44, -207), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'options_menu_drag_2') + # fullscreen + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -120), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'fullscreen') + self._event(8 + FunctionalTest.evt_time, 'mouseclick', False, False, [(-320, -300), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'back_from_fullscreen') + # resolution + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -24), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'resolutions') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(314, 116), 'left']) + self._screenshot(FunctionalTest.screenshot_time, '1440x900') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(98, 47), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'resolutions_2') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(478, 59), 'left']) + self._screenshot(FunctionalTest.screenshot_time, '1280x720') + # antialiasing + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(12, 62), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'antialiasing_no') + # shadows + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(12, 145), 'left']) + self._screenshot(FunctionalTest.screenshot_time, 'shadows_no') + # test aa and shadows + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 270), 'left']) # back + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -230), 'left']) # play + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(-430, -210), 'left']) # domino + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(200, 100), 'left']) # close instructions + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(-620, 336), 'left']) # home + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, -80), 'left']) # options + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(12, 62), 'left']) # aa + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(12, 145), 'left']) # shadows + self._screenshot(FunctionalTest.screenshot_time, 'aa_no_shadows_no') + self._event(FunctionalTest.evt_time, 'mouseclick', False, False, [(0, 270), 'left']) # back + # # go to options # self._event(FunctionalTest.evt_time, 'arrow_down') # self._event(FunctionalTest.evt_time, 'arrow_down') diff --git a/prj.org b/prj.org index 03b8cf0..9b7924c 100644 --- a/prj.org +++ b/prj.org @@ -4,7 +4,7 @@ ** build pipeline *** functional tests - [X] credits - - [ ] options + - [X] options - [ ] play - [ ] code - [ ] appimage