From 22f7665ea1ef44a5e08c7f52296f52ffc33e68d5 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 21 Nov 2024 15:59:30 -0800 Subject: [PATCH 1/3] added screenshots for tlou --- .../the_last_of_us_part_i.py | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/the_last_of_us_part_i/the_last_of_us_part_i.py b/the_last_of_us_part_i/the_last_of_us_part_i.py index 130b437..e858ad3 100644 --- a/the_last_of_us_part_i/the_last_of_us_part_i.py +++ b/the_last_of_us_part_i/the_last_of_us_part_i.py @@ -23,6 +23,9 @@ from harness_utils.steam import ( get_registry_active_user, exec_steam_run_command, ) +from harness_utils.misc import press_n_times + +from harness_utils.artifacts import ArtifactManager, ArtifactType STEAM_GAME_ID = 1888930 SCRIPT_DIRECTORY = os.path.dirname(os.path.realpath(__file__)) @@ -31,14 +34,50 @@ PROCESS_NAME = "tlou" user.FAILSAFE = False +def take_screenshots(am: ArtifactManager) -> None: + """Take screenshots of the benchmark settings""" + logging.info("Taking screenshots of benchmark settings") + press_n_times("s",2,0.2 ) + user.press("enter") + press_n_times("s",4,0.2 ) + user.press("enter") + am.take_screenshot("video1.png", ArtifactType.CONFIG_IMAGE, "screenshot of video settings1") -def navigate_main_menu() -> None: + press_n_times("s",15,0.2) + am.take_screenshot("video2.png", ArtifactType.CONFIG_IMAGE, "screenshot of video settings2") + + press_n_times("s",6, 0.2) + am.take_screenshot("video3.png", ArtifactType.CONFIG_IMAGE, "screenshot of video settings3") + + user.press("backspace") + user.press("s") + user.press("enter") + am.take_screenshot("graphics1.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings1") + press_n_times("s", 10, 0.2) + am.take_screenshot("graphics2.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings2") + press_n_times("s", 7, 0.2) + am.take_screenshot("graphics3.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings3") + press_n_times("s", 9, 0.2) + am.take_screenshot("graphics4.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings4") + press_n_times("s", 7, 0.2) + am.take_screenshot("graphics5.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings5") + press_n_times("s", 6, 0.2) + am.take_screenshot("graphics6.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings6") + press_n_times("s", 5, 0.2) + am.take_screenshot("graphics7.png", ArtifactType.CONFIG_IMAGE, "screenshot of graphics settings7") + user.press("backspace") + user.press("backspace") + press_n_times("w", 2, 0.2) + +def navigate_main_menu(am: ArtifactManager) -> None: """Input to navigate main menu""" logging.info("Navigating main menu") # Enter TLOU menu user.press("space") time.sleep(0.5) + take_screenshots(am) + user.press("space") time.sleep(0.5) # Press load game @@ -61,7 +100,7 @@ def run_benchmark(): """Starts the benchmark""" exec_steam_run_command(STEAM_GAME_ID) setup_start_time = time.time() - + am = ArtifactManager(LOG_DIRECTORY) time.sleep(10) result = kerasService.wait_for_word("press", interval=3, timeout=60) @@ -69,8 +108,9 @@ def run_benchmark(): logging.info("Did not see start screen") sys.exit(1) - navigate_main_menu() + navigate_main_menu(am) + am.take_screenshot("benchmark.png", ArtifactType.CONFIG_IMAGE, "screenshot of benchmark settings") # press load save result = kerasService.look_for_word("yes", attempts=10, interval=1) if not result: From 992b51c0f1986309970d289e9c78ea1ff45ed757 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 21 Nov 2024 16:32:11 -0800 Subject: [PATCH 2/3] added create manifest --- the_last_of_us_part_i/the_last_of_us_part_i.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/the_last_of_us_part_i/the_last_of_us_part_i.py b/the_last_of_us_part_i/the_last_of_us_part_i.py index e858ad3..7b15799 100644 --- a/the_last_of_us_part_i/the_last_of_us_part_i.py +++ b/the_last_of_us_part_i/the_last_of_us_part_i.py @@ -151,6 +151,9 @@ def run_benchmark(): time.sleep(3) terminate_processes(PROCESS_NAME) + + am.create_manifest() + return test_start_time, test_end_time From 89324e2d3ae457271afecd58538f0306e9b72de9 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 21 Nov 2024 17:11:41 -0800 Subject: [PATCH 3/3] removed test screenshot, fully working and tested on bench ready for showtime --- the_last_of_us_part_i/the_last_of_us_part_i.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/the_last_of_us_part_i/the_last_of_us_part_i.py b/the_last_of_us_part_i/the_last_of_us_part_i.py index 7b15799..fd937b0 100644 --- a/the_last_of_us_part_i/the_last_of_us_part_i.py +++ b/the_last_of_us_part_i/the_last_of_us_part_i.py @@ -110,7 +110,6 @@ def run_benchmark(): navigate_main_menu(am) - am.take_screenshot("benchmark.png", ArtifactType.CONFIG_IMAGE, "screenshot of benchmark settings") # press load save result = kerasService.look_for_word("yes", attempts=10, interval=1) if not result: @@ -153,7 +152,7 @@ def run_benchmark(): terminate_processes(PROCESS_NAME) am.create_manifest() - + return test_start_time, test_end_time