Installs the tools of the browser levels of --check into a directory of the user
mix expresso --install-check-tools and expresso --install-check-tools
call install/2. The function installs the npm packages playwright and
axe-core into directory/1, and the Chromium and the headless shell of
Playwright into the cache of Playwright. The check then finds each tool
there, so a project with no node_modules can run each level. The
installation needs Node and npm on the PATH.
--check=browser in a Mix project also needs the Hex package
playwright_ex in the deps of the project. The binary holds it.
Summary
Functions
Return the directory of the tools
The variable EXPRESSO_TOOLS in env gives the directory. Without it, the
directory is expresso in the cache directory of the user, such as
~/.cache/expresso on Linux and ~/Library/Caches/expresso on macOS.
@spec install(%{required(String.t()) => String.t()}, (String.t(), [String.t()] -> non_neg_integer())) :: :ok | {:error, String.t()}
Install the tools, write the progress, and return :ok or an error
The function runs these commands, in sequence:
npm install --prefix <directory> playwright axe-core, with the versions ofpackages/0.node <directory>/node_modules/playwright/cli.js install chromium, which installs the Chromium and the headless shell of Playwright.
run runs one command with its arguments, and returns its exit status.
The default writes the output of the command to the standard output.
@spec packages() :: [String.t()]
Return the npm packages that install/2 installs, with their versions
Each version is the version of the package in package.json, so the list
has the form ["playwright@<version>", "axe-core@<version>"].