guidepup / setup

Setup your environment for screen reader test automation.
https://guidepup.dev
MIT License
5 stars 2 forks source link

fix: explicitly disable dictation input auto enable #1

Closed msereniti closed 1 year ago

msereniti commented 1 year ago

Intro

When I started using guidepup for a11y testing of Intergalactic repository sometimes tests were falling. Instead of an expected text .lastSpokenPhrase() was returning "Dictation system dialog To use Dictation, you need to select a microphone or connect an external microphone. You can configure your microphone in Dictation preferences. To use Dictation, you need to select a microphone or connect an external microphone." or other texts from the Dictation system dialog.

The worst things were that this was not reproducible on local machine, bug was appearing only about every 8th run and the only way to reproduce it outside of our repository was to copy whole test code (I tried to run parts many times but it was not reproducing at all).

Unexpected behaviour

Sometimes (not stably) when VoiceOver focuses on text input, MacOS recommends user to enable dictation feature with a system dialog.

Solution

After little remote (on ci) interactions with dictation dialog, the "Never ask again" button was spotted. Diffing system defaults before and after clicking the button uncovered important field – com.apple.HIToolbox AppleDictationAutoEnable.

Setting that field to false value resolved the issue in our repository. As far as the bug is very weird and hard for debugging, I suppose this change would be very valuable for other users of guidepup.

@cmorten, is that change is really valuable or I have missed something in documentation (again 😁) ?

cmorten commented 1 year ago

Great spot @phytonmk and fantastic sleuthing to find the necessary config setting.

I believe this change is valuable!