tau-introduction-to-playwright icon indicating copy to clipboard operation
tau-introduction-to-playwright copied to clipboard

Setting up the env file with API Key - trying to find the setup explained chapter 4 video mentioned to refer

Open pkunarap opened this issue 1 year ago • 2 comments

🐞 Describe the question: I am trying to get the env file setup done to run my tests but couldn't get it done as I am unable to find chapter 4 video for env file setup mentioned. Could you please help me find that with the exact location or what to refer?

📸 Screenshots/GIFs/Videos: image

🛝 Additional context: No

Thanks, Priya

pkunarap avatar Feb 01 '24 02:02 pkunarap

In the root folder of the project (/tau-introduction-to-playwright), there is a ".env.example" file, you can copy or rename this to just ".env" then put in your applitools API key (once you've registered on applitools.com for a free account then click on the user icon in the upper right corner then select "Your API key" from the drop down menu)

jamesjlopez avatar Feb 05 '24 21:02 jamesjlopez

@pkunarap this is explained in chapter 2

you need this in your playwright.config

/**
 * Read environment variables from file.
 * https://github.com/motdotla/dotenv
 */
require('dotenv').config();

and you need to make sure you have dotenv installed and your package.json includes

"devDependencies": {
   "dotenv": "^16.0.3"
 }

emyjamalian avatar May 28 '24 07:05 emyjamalian