Giter Club home page Giter Club logo

setup's Introduction

Guidepup Setup

Guidepup Setup available on NPM Guidepup Setup test workflows Guidepup Setup uses the MIT license

MacOS Monetary Support MacOS Ventura Support MacOS Sonoma Support Windows 10 Support Windows Server 2019 Support Windows Server 2022 Support

This package sets up your environment for screen reader automation.

It enables automation for VoiceOver on MacOS and NVDA on Windows.

Getting Started

Run this command:

npx @guidepup/setup

And get cracking with your screen reader automation code!

Usage

GitHub Actions

If you are using GitHub Actions, check out the dedicated guidepup/setup-action:

- name: Setup Environment
  uses: guidepup/setup-action

MacOS

If you are running this command locally you may need to take some manual steps to complete setup by following the manual VoiceOver setup documentation.

CI

If you are running this command in CI/CD, it is recommended to add the --ci flag to prevent interactive prompts:

npx @guidepup/setup --ci

Ignore TCC.db Updates

If updating the TCC.db is not possible (due to SIP) or required you can skip the database update step by using the --ignore-tcc-db flag:

npx @guidepup/setup --ignore-tcc-db

Note

If the necessary permissions have not been granted by other means, using this flag may result in your environment not being set up for reliable screen reader automation.

Recording

If you are encountering errors in CI for MacOS you can pass a --record flag to the command which will output a screen-recording of the setup to a ./recordings/ directory:

npx @guidepup/setup --ci --record

Windows

NVDA Installation

When running on windows a portable NVDA instance compatible with Guidepup will be installed to a temporary directory by default. The location of this installation directory is stored in the Windows registry under the key HKCU\Software\Guidepup\Nvda.

If you want to specify the directory that NVDA is installed to you can pass a --nvda-install-dir flag to the command:

npx @guidepup/setup --nvda-install-dir <NVDA_INSTALLATION_DIRECTORY>

Foreground Timeout Lock

Modern versions of Windows have a setting which prevents new application instances launching in front of other applications in quick succession, requiring over 3 minutes between activations before it will actually show the window - in the interim it launches the window minimized.

Many test automation frameworks will completely close down a browser after a test has finished and then launch a new instance for the next test - on Windows this suffers from the timeout lock on foreground windows. This impacts on screen reader automation which need the window to activate and focus to be able to drive the screen reader on the application.

To mitigate this the setup script updates two keys in the Windows registry under HKCU\Control Panel\Desktop:

  • ForegroundLockTimeout - Specifies the time in milliseconds, following user input, during which the system will not allow applications to force themselves into the foreground. Defaults to 200000.
  • ForegroundFlashCount - Determines the number of times the taskbar button will flash to notify the user that a background window has been activated by the system. If the time elapsed since the last user input exceeds the value of ForegroundLockTimeout, the window will automatically be brought to the foreground. Defaults to 3.

Both of these are set to 0 by the setup script.

Powerful Tooling

Check out some of the other Guidepup modules:

Resources

setup's People

Contributors

cmorten avatar dependabot[bot] avatar jlp-craigmorten avatar msereniti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

setup's Issues

Provide manual setup instructions

Hello! Thank you for the amazing work on this project.

I think it would be good to add manual setup instructions. People may not feel comfortable running an npm script that requires admin credentials.

EACCES: permission denied, open '/private/var/db/Accessibility/.VoiceOverAppleScriptEnabled'

Recently, I've been seeing an error while running guidepup/setup-action on macOS 12.6.9:

[!] Error: Unable to write to the VoiceOver database file - SIP might not be disabled

EACCES: permission denied, open '/private/var/db/Accessibility/.VoiceOverAppleScriptEnabled'

Unable to complete environment setup

Please raise new issues at: https://github.com/guidepup/setup/issues

Example: https://github.com/ariakit/ariakit/actions/runs/6818966513/job/18545531840

NVDA not supported

I've faced an issue with tests launching.
npx @guidepup/setup doesn't work for me

image
It looks like something wrong with my local environment, but I can't find the reason.

Help debugging -Failed to enable "Do not disturb" mode-

Hi,

I've tried guidepup/setup for Github actions and I got it working. Very nice!

My question though is because I'm trying to get it running in a Self-managed Gitlab. VoiceOver AppleScript Control is Enabled, so that's fine but when it runs the setup command I get:

$ npx @guidepup/setup --ci --record
[!] Error: Failed to enable "Do not disturb" mode
Unable to complete environment setup
Please refer to https://github.com/guidepup/guidepup/tree/main/guides for guides to manual environment setup

And the recording directory is empty.

Do you have any ideas, hints or suggestions?

Thank you!

Windows hides new browser windows due to foreground lock

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

Screen reader is installed in a Temp folder on Windows and after some time, the OS removes it

Issue

Setup:

  • Node version: v16.20.2
  • Guidepup version: 0.19.1
  • OS Platform: Windows
  • OS Release: 10 Pro

Details

I noticed that the command "npx @guidepup/setup" installs the screen reader into a temp folder on Windows. Then, sometimes Windows runs the garbage collector (or something similar) and the screen reader is gone. Is there any way to install it in a non-temp folder, so I don't need to re-install it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.