1

APPLITOOLS_API_KEY env variable is missing. It is required to define this variable for Applitools visual tests to run successfully.

Please see the error image here

1 Answers1

1

There are two ways to prevent this.

  1. Pass the env variable using the CLI like:
export APPLITOOLS_API_KEY=<your_key> npx cypress open
  1. Create a file in your project root applitools.config.js and mention your api key like:
module.exports = {
  apiKey: 'YOUR_API_KEY',
  // ...
}

In case you don't have any API key, you can refer this article.

Alapan Das
  • 17,144
  • 3
  • 29
  • 52
  • Couldn't they also set the variable in a `.env` file? – agoff Nov 01 '21 at 13:48
  • 1
    That is a good question actually, the OP can try that as well. I followed the plugins page and this is how they are doing it - https://www.npmjs.com/package/@applitools/eyes-cypress – Alapan Das Nov 01 '21 at 14:33
  • 1
    Yep. I think I default to using a `.env` file and adding that file to the `.gitignore`, since then I don't have to worry about keeping a secret in code (option 2) or any terminal _weirdness_ (potentially option 1). Cheers :D – agoff Nov 01 '21 at 14:50