raptatinha / tau-introduction-to-playwright

Course Introduction to Playwright by Renata Andrade for Test Automation University
https://testautomationu.applitools.com/
128 stars 606 forks source link

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

Open pkunarap opened 7 months ago

pkunarap commented 7 months ago

🐞 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

jamesjlopez commented 7 months ago

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)

emyjamalian commented 3 months ago

@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"
  }