Skip to content

feat(e2e): add end-to-end testing with Selenium AT-SPI#3

Open
hikaps wants to merge 19 commits intodevelopfrom
feat/e2e
Open

feat(e2e): add end-to-end testing with Selenium AT-SPI#3
hikaps wants to merge 19 commits intodevelopfrom
feat/e2e

Conversation

@hikaps
Copy link
Copy Markdown
Owner

@hikaps hikaps commented Mar 23, 2026

Re-merge of #2 after CI infrastructure fixes.

Summary

  • Add accessibility identifiers (objectName, Accessible.*) to all interactive QML elements across 15 files (pages, components, dialogs)
  • Set up Selenium AT-SPI e2e test infrastructure (appiumtests/)
  • 43 tests: 36 smoke tests (no helper needed) + 7 session lifecycle tests (mock D-Bus helper)
  • Mock D-Bus helper service implements all 29 helper methods — LaunchInstance() returns fake PID, no real gamescope/GPU needed
  • Virtual gamepad creation via evdev/uinput for device assignment tests
  • CI job (e2e-tests) runs headless via selenium-webdriver-at-spi-run with virtual KWin Wayland session

Changes

  • 15 QML files: Added objectName, Accessible.role, Accessible.name, Accessible.onPressAction to every interactive element
  • appiumtests/: New directory with pytest + Appium test suite
  • .github/workflows/ci.yml: New e2e-tests job (depends on build job)
  • AGENTS.md: Updated structure table, conventions, build commands

hikaps added 12 commits March 23, 2026 11:59
- Remove non-existent packages: systemd-loginctl (not a real package),
  selenium-webdriver-at-spi (not in Fedora 41 repos)
- Add 'Build selenium-webdriver-at-spi' step: clone from KDE invent,
  patch out videorecorder (Qt6GuiPrivate conflict on F41), build & install
- Add all required build/runtime deps: ruby, qt6-qtwayland-devel,
  kf6-kwindowsystem-devel, kwayland-devel, kpipewire-devel,
  plasma-wayland-protocols-devel, python3-flask, python3-pyatspi,
  python3-gobject-base, gobject-introspection-devel, dbus-x11, etc.
- Move dbus-python and evdev from pip requirements to dnf packages
  (pip builds fail on Fedora, system packages work correctly)
CMake failed to find Wayland_Client/Wayland_Server because the base
wayland-devel package was missing — qt6-qtwayland-devel only pulls in
the runtime library, not the dev headers.
The Ruby runner script expects pip3 in PATH. Fedora's python3-pip only
provides 'python3 -m pip', not /usr/bin/pip3. Create a shell wrapper.
The wrapper must exist before selenium-webdriver-at-spi-run starts, which
happens in the test step. Moving it to the system deps step ensures it
persists across all subsequent steps.
The runner script uses system('which', 'pip3') to check for pip3 in PATH.
Without the 'which' binary installed, this check always fails even when
/usr/bin/pip3 exists.
The runner crashes with 'no implicit conversion of nil into String' when
XDG_RUNTIME_DIR is unset. Docker containers don't have this env var —
set it to a writable tmp path.
hikaps added 7 commits March 23, 2026 13:14
selenium-webdriver-at-spi-run launches kwin_wayland --virtual to host the
app under test. Without it: No such file or directory - kwin_wayland.
GitHub Actions containers lack DRM/GPU capabilities needed by kwin_wayland
--virtual (EPERM on exec). Set TEST_WITH_KWIN_WAYLAND=0 to skip the
compositor and QT_QPA_PLATFORM=offscreen for headless rendering.
The Flask driver (selenium-webdriver-at-spi.py) imports numpy at startup.
Without it: ModuleNotFoundError: No module named 'numpy'.
pytest was running from the project root, so 'from helpers.base_test import
BaseTest' failed with ModuleNotFoundError. --rootdir=appiumtests makes
pytest resolve imports relative to the test directory.
pytest runs from the project root (via selenium-webdriver-at-spi-run), so
'from helpers.base_test import BaseTest' failed. Add conftest.py to
sys.path so helpers/ resolves correctly.
selenium-webdriver-at-spi-run overrides XDG_DATA_HOME to a temp dir,
so ~/.local/share/applications/ is invisible. Install to the system
location /usr/share/applications/ and symlink binary to /usr/local/bin/.
GAppInfo tries to execute 'io.github.hikaps.couchplay' (the desktop file ID)
as a binary when it can't find the desktop file. Add a symlink with that name
to /usr/local/bin/ so the binary is findable by GLib's app lookup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant