Test desktop Diary backspace, selections and corrections

apps-diary-editing-test drives the standalone Diary on a private Xvfb
display through real SDL keys: backspace, emoji and combining-mark
deletion, selection delete, a mid-text correction and select-all
delete, then restores the entry for the rest of apps-diary-test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
waoziandClaude Opus 5.5 committed 2026-11-17 15:52:24 -03:00
1 parent fa99f1e807
commit d116acad0f
3 files changed
+29 -1

No files matched your search

+4
View File
@@ -273,6 +273,10 @@ shared-progress-ui-test: $(TARGET)
practice-images-ui-test: $(TARGET)
@sh tests/practice_images_ui_test.sh $(abspath $(TARGET))
.PHONY: apps-diary-editing-test
apps-diary-editing-test: $(TARGET)
sh tests/apps_diary_test.sh $(abspath $(TARGET)) --editing-only
.PHONY: apps-diary-test
apps-diary-test: $(TARGET)
sh tests/apps_diary_test.sh $(abspath $(TARGET))
+24
View File
@@ -158,6 +158,30 @@ with tempfile.TemporaryDirectory(prefix="inbe-diary-ui-") as temporary:
assert time.monotonic() < deadline, "Diary text was not saved"
time.sleep(0.1)
capture(window, "saved")
# Exercise real SDL backspace plus Kryon cursor/selection editing.
command("xdotool", "key", "--clearmodifiers", "BackSpace")
wait_for_text(entry, lambda text: text == "A saved Diary entr", "Backspace did not delete")
driver.type("y 水e\u0301😀")
driver.key("backspace")
wait_for_text(entry, lambda text: text == "A saved Diary entry 水e\u0301", "Emoji deletion split Unicode")
driver.key("backspace")
wait_for_text(entry, lambda text: text == "A saved Diary entry 水", "Combining character deletion split a grapheme")
driver.key("left", shift=True)
driver.key("delete")
wait_for_text(entry, lambda text: text == "A saved Diary entry ", "Selection deletion failed")
driver.key("backspace")
driver.key("home")
driver.key("right", shift=True)
driver.type("One")
wait_for_text(entry, lambda text: text == "One saved Diary entry", "Mid-text correction failed")
driver.key("a", control=True)
driver.key("backspace")
wait_for_text(entry, lambda text: text == "", "Deleting the complete selection failed")
driver.type("A saved Diary entry")
wait_for_text(entry, lambda text: text == "A saved Diary entry", "Typing after deletion failed")
if "--editing-only" in sys.argv:
print("Diary SDL backspace, selections, corrections and Unicode passed")
raise SystemExit(0)
# Typing within a moment of another change joins its undo step.
time.sleep(1.2)
driver.wait_gone(contains="Achievement unlocked", timeout=20)
+1 -1
View File
@@ -5,4 +5,4 @@ binary=${1:-"$root/build/bin/linux/breeze-linux-x86_64"}
exec env -u INBE_DIARY_IMPORT -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
-u SESSION_MANAGER YUE_DESKTOP_RECOVERY=0 SDL_VIDEODRIVER=x11 LIBGL_ALWAYS_SOFTWARE=1 \
xvfb-run -a -n 400 -s '-noreset -screen 0 1280x900x24' \
python3 "$root/tests/apps_diary_test.py" "$binary"
python3 "$root/tests/apps_diary_test.py" "$binary" "${2:-}"