Screenshotting stellaris settings for traceability

This commit is contained in:
J-Doiron
2025-08-20 18:03:34 -07:00
parent 2ff305ca6d
commit d2bdb0c198

View File

@@ -23,6 +23,7 @@ from harness_utils.output import (
)
from harness_utils.steam import get_app_install_location
from harness_utils.keras_service import KerasService
from harness_utils.artifacts import ArtifactManager, ArtifactType
SCRIPT_DIR = Path(__file__).resolve().parent
@@ -67,12 +68,29 @@ def run_benchmark(keras_host, keras_port):
start_game()
setup_start_time = int(time.time())
time.sleep(5)
am = ArtifactManager(LOG_DIR)
result = keras_service.wait_for_word("credits", interval=0.5, timeout=100)
if not result:
logging.info("Could not find the paused notification. Unable to mark start time!")
sys.exit(1)
result = keras_service.look_for_word("settings", attempts=10, interval=1)
if not result:
logging.info("Did not find the settings button. Is there something wrong on the screen?")
sys.exit(1)
gui.moveTo(result["x"], result["y"])
time.sleep(0.2)
gui.mouseDown()
time.sleep(0.2)
gui.mouseUp()
time.sleep(0.5)
am.take_screenshot("settings.png", ArtifactType.CONFIG_IMAGE, "settings")
time.sleep(0.2)
user.press("esc")
result = keras_service.look_for_word("load", attempts=10, interval=1)
if not result:
logging.info("Did not find the load save menu. Is there something wrong on the screen?")
@@ -141,6 +159,8 @@ def run_benchmark(keras_host, keras_port):
score = find_score_in_log()
logging.info("The one year passed in %s seconds", score)
terminate_processes(PROCESS_NAME)
am.create_manifest()
return test_start_time, test_end_time, score