slint icon indicating copy to clipboard operation
slint copied to clipboard

Accessibility: expose `author-id`

Open okrightall opened this issue 1 year ago • 11 comments

We should expose our element id that we now have internally for our test API as the author_id property in accesskit

Original Issue text:

[requests] Add automationID

https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/

okrightall avatar Nov 21 '23 11:11 okrightall

Can you maybe provide some more information on what this ticket is supposed to be about?

hunger avatar Nov 21 '23 11:11 hunger

UI Automation - Microsoft UI Automation Just like automationID in UIA.

Using UI Automation for Automated Testing:

https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/using-ui-automation-for-automated-testing

okrightall avatar Nov 21 '23 14:11 okrightall

What is your use case? How would you use that with Slint?

(For general UI testing, we already have a tracking issue: https://github.com/slint-ui/slint/issues/464 )

ogoffart avatar Nov 21 '23 14:11 ogoffart

Going by that link: The automation is based on Microsofts accessibility support. Slint does support accessibility on windows, maybe we already assign such an ID when preparing the accessibility tree?

I am not sure how stable that ID is or how stable it needs to be for this test framework.

hunger avatar Nov 22 '23 13:11 hunger

The automation of GUI aims to achieve faster speed, which is the same as the pursuit of zero loss speed in Rust performance. Both aim to enable users to use faster speed while also reducing the workload of user operations, especially repetitive keyboard and mouse operations. The progress does not need to be very urgent, only the automation ID can be implemented like QT in the end. First of all, I wish slint success and thank you to slint.

okrightall avatar Nov 22 '23 13:11 okrightall

This does not make too much sense to have before we have full support for actions (see #2872 and #2895).

hunger avatar Jan 23 '24 12:01 hunger

We have added a new author_id property in accesskit 0.15 specifically for the purpose of platform-dependant automated testing. It is exposed on Windows, macOS and Linux following best practice on each platform.

Once the AccessKit dependencies are updated, Slint could assign the name of the elements (as defined in .slint files) to this property.

@tronical The original title of this issue was more descriptive, as UI Automation is the name of the entire accessibility IPC protocol on Windows. You'll get a cross-platform option with the property described above anyway.

DataTriny avatar Jun 09 '24 19:06 DataTriny

Great! Thanks for the update (and implementing that in access kit). My guts feeling is that it would be best to have an explicit accessibility-id property in Slint. We could consider initialising it from the element name, but I'm hesitant as an explicit choice for automation might be better than a semi-implicit one. The element name is chosen by the developer for their own liking, while the id we're talking about here becomes part of the "contract" between the developer and the engineers running the test automation (they might be different folks).

What do you think?

tronical avatar Jun 10 '24 09:06 tronical

For context: Chromium (which inspired AccessKit) uses the HTML ID for this purpose.

DataTriny avatar Jun 10 '24 16:06 DataTriny

Fair point :-)

tronical avatar Jun 10 '24 16:06 tronical

QT, MFC, and WPF all support UIA. Minimalism, the simplest way of calling is the best.

okrightall avatar Jun 11 '24 04:06 okrightall