guidepup / setup

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

Windows hides new browser windows due to foreground lock #15

Closed cmorten closed 8 months ago

cmorten commented 1 year ago

If using something like Playwright to run tests against NVDA on Windows then the second test onwards fail because Windows has a mechanism in place to prevent application windows taking the foreground in quick succession.

Attempted at resolving with https://github.com/guidepup/setup/blob/main/src/windows/removeForegroundLock.ts and https://github.com/guidepup/setup/blob/main/src/windows/restartExplorer.ts but doesn't appear to be having the desired effect. Reading around it certainly seems to suggest that the foreground lock timeout is the solution, but often says a restart is required afterwards - it doesn't look like restarting explorer.exe cuts it (was a bit of a wild guess - restarting the Windows Manager might be a better punt?). Not sure how to work around as can't imagine can restart the agent, that almost certainly will result in losing connection and the build failing.

Perhaps one that needs to be raised against https://github.com/actions/runner-images/issues

cmorten commented 8 months ago

Closing as there are UI automation workarounds.