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.
This commit is contained in:
OPNA2608
2025-12-13 18:05:35 +01:00
parent 23735a82a8
commit a183f86b10
+14 -5
View File
@@ -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 &")