Skip to main content
This file has three provision.installer() tests in a Linux sandbox:
  • One installs a command-line tool from a .deb and runs it.
  • One installs a desktop app from a .deb and checks that its window opens.
  • One downloads a shell script without running it and checks that it exists.

Watch it run

The test

installer.test.mjs

How it works

  • provision.installer({ url }) downloads the file, installs it by extension, and returns its path.
  • On Linux, a .deb is installed with dpkg, and missing dependencies are installed with apt-get. The step fails if the package still isn’t fully installed.
  • With launch: true (the default), a .deb app is started from its .desktop entry, then appName is focused. That’s how the Yaak window opens.
  • A .sh script is made executable and run.
  • launch: false makes a .sh script executable without running it. It also skips focusing the app when you pass appName.
  • With launch: false, packages such as .deb files are still installed.
  • exec('sh', command, timeout) runs a shell command and returns its output. The test uses it to check that bat is installed.
  • it.skipIf(!isLinux) skips every test when TD_OS is set to windows.

Run it

The test is in the TestDriver SDK repository. Clone it, install dependencies, and run the file:
The test reads your API key from TD_API_KEY. Create a key at console.testdriver.ai/team/api-keys. Then set it in your environment or a .env file.