Playwright Automation Framework with POM | Part 3
Code And Test
0:00 / 0:00
Playwright Automation Framework with POM | Part 3
1 просмотр · 7 дн. назад
Code And Test
4 подписчика
1 просмотр · 7 дн. назад
🎯 Playwright Automation Framework with POM | Part 3
In this video, we add more tests to our Playwright framework, create a .env file for credentials and configuration, build an Env Helper, and use the environment data inside our tests.
📌 What you’ll learn:
✅ Adding new tests to the framework (reusing page objects and custom fixtures from Part 2)
✅ Structuring and organizing tests
✅ Why hardcoded credentials and URLs are a problem (security risks, difficult maintenance, no environment switching)
✅ What is a .env file and how key-value pairs work (BASE_URL, USERNAME, PASSWORD, ENV)
✅ Installing and configuring dotenv (npm install dotenv, loading it in playwright.config.ts)
✅ Loading different env files per environment (.env.dev, .env.staging, .env.prod using the path option)
✅ Building an Env Helper utility (a single class/file to read and validate environment variables)
✅ Running tests against environments (using ENV=staging npx playwright test, cross-env for Windows)
✅ Running and validating the tests (checking results in the console and HTML report, troubleshooting common dotenv issues)
✅ Folder structure update (adding utils/envHelper.ts and env files at the project root)
🔔 Subscribe for more Playwright & QA automation videos
👍 Like the video if it helped
#Playwright #DotEnv #AutomationFramework #PlaywrightTutorial #EnvironmentVariables #PageObjectModel #TestAutomation #QAAutomation #TypeScript #SDET #AutomationTesting #PlaywrightAutomation #SoftwareTesting