From a183f86b100b4dbdf8ec50221a4ccb8d4f0edc39 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 13 Dec 2025 18:04:32 +0100 Subject: [PATCH] nixosTests.lomiri-calendar-app: Fix test further Had more random failures, this time with finding "Agenda" and "foobar". - Instead of looking for "Agenda" back on the main page, restart the application. - Change event name from "foobar" with "Poke". OCR seems to have an easier time with it, and it's still unique enough. --- nixos/tests/lomiri-calendar-app.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nixos/tests/lomiri-calendar-app.nix b/nixos/tests/lomiri-calendar-app.nix index 2d8a7ae10026..5b18e7dd50b4 100644 --- a/nixos/tests/lomiri-calendar-app.nix +++ b/nixos/tests/lomiri-calendar-app.nix @@ -63,19 +63,28 @@ # On New Event page machine.succeed("xdotool mousemove 500 230 click 1") machine.sleep(2) - machine.send_chars("foobar") + machine.send_chars("Poke") machine.sleep(2) # make sure they're actually in there machine.succeed("xdotool mousemove 1000 40 click 1") + machine.sleep(10) # Give the app some time to save the event + + # Can't consistently OCR for "Agenda". Just restart it. + machine.succeed("pgrep -afx lomiri-calendar-app >&2") + machine.succeed("pkill -efx lomiri-calendar-app >&2") + machine.wait_until_fails("pgrep -afx lomiri-calendar-app >&2") + machine.succeed("lomiri-calendar-app >&2 &") + machine.sleep(10) + machine.send_key("alt-f10") machine.sleep(2) - machine.wait_for_text("Agenda") - machine.screenshot("lomiri-calendar_eventadded") # Back on main page # Event was created, does it have the correct name? - machine.wait_for_text("foobar") + machine.wait_for_text("Poke") machine.screenshot("lomiri-calendar_works") - machine.succeed("pkill -f lomiri-calendar-app") + machine.succeed("pgrep -afx lomiri-calendar-app >&2") + machine.succeed("pkill -efx lomiri-calendar-app >&2") + machine.wait_until_fails("pgrep -afx lomiri-calendar-app >&2") with subtest("lomiri calendar localisation works"): machine.succeed("env LANG=de_DE.UTF-8 lomiri-calendar-app >&2 &")