Olivia's blog

While not enabled by default, Java Swing has support for accessibility APIs. Unfortunately, only Windows is supported by Java itself, but other operating systems are implemented by the different OSes themselves.

The flag is -Djavax.accessibility.assistive_technologies=<provider>, where some of the platform-specific providers are:

Once enabled, the app can be tested using various testing tools. I was unable to find a solution that supports AT-SPI2[1], so for my use, I hacked one together with pywinctl[1], pyautogui[2], and the adapter pattern to allow for other APIs to just be dropped into the testing framework.

I may make an open-source testing framework based on this concept At Some Point:tm:, but I have no immediate use for it for my personal projects. The amount of testing frameworks using accessibility APIs is fairly high, but the amount that _also_ support AT-SPI2 on Linux is functionally non-existent[3].

Footnotes

  1. KDE's promising-looking webdriver using appium is out of the question because it uses wayland, and it's licensed under AGPL, which alone is enough to exclude it from my use.

    Usages: [1], [2]
  2. Technically redundant since the windows it produces are incompatible with the windows AT-SPI2 uses, and AT-SPI2 still gives a chunk of the same functionality

    Usages: [1]
  3. Again exceluding KDE's webdriver, because AGPL is a cancer

    Usages: [1]