From 6a78ac580705c5ea9fb2487650c0261120f9d9a7 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 5 Aug 2025 13:34:58 -0400 Subject: [PATCH] Renames NODE_ENV to PLAYWRIGHT_ENV Updates the environment variable name from NODE_ENV to PLAYWRIGHT_ENV across the project. This change ensures consistency and clarity in environment variable usage, specifically for Playwright configurations. --- playwright-tests/.env | 2 +- playwright-tests/.env.dev | 2 +- playwright-tests/.env.example | 2 +- playwright-tests/pages/BasePage.ts | 2 +- playwright-tests/playwright.config.ts | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/playwright-tests/.env b/playwright-tests/.env index 5f37c7ddf..3429bc864 100644 --- a/playwright-tests/.env +++ b/playwright-tests/.env @@ -2,7 +2,7 @@ # Environment configuration # Environment type -NODE_ENV="qa" +PLAYWRIGHT_ENV="qa" # Skip content site SKIP_CONTENT_SITE=false diff --git a/playwright-tests/.env.dev b/playwright-tests/.env.dev index 0f8e62d0c..c2c7b2d43 100644 --- a/playwright-tests/.env.dev +++ b/playwright-tests/.env.dev @@ -2,7 +2,7 @@ # Environment configuration # Environment type -NODE_ENV="qa" +PLAYWRIGHT_ENV="qa" # Skip content site SKIP_CONTENT_SITE=false diff --git a/playwright-tests/.env.example b/playwright-tests/.env.example index 5f37c7ddf..3429bc864 100644 --- a/playwright-tests/.env.example +++ b/playwright-tests/.env.example @@ -2,7 +2,7 @@ # Environment configuration # Environment type -NODE_ENV="qa" +PLAYWRIGHT_ENV="qa" # Skip content site SKIP_CONTENT_SITE=false diff --git a/playwright-tests/pages/BasePage.ts b/playwright-tests/pages/BasePage.ts index ec6c5d767..577a466d2 100644 --- a/playwright-tests/pages/BasePage.ts +++ b/playwright-tests/pages/BasePage.ts @@ -104,7 +104,7 @@ export class BasePage { async mockScheduleResponseForEarlyBird(customerDetails: ICustomerDetails) { - const apiUrl = `https://digitalapi.${process.env['NODE_ENV']!.replace('sys', 'test').toLowerCase()}.safelite.io/schedule/api/v1/schedule/mobile-time-slots`; + const apiUrl = `https://digitalapi.${process.env['PLAYWRIGHT_ENV']!.replace('sys', 'test').toLowerCase()}.safelite.io/schedule/api/v1/schedule/mobile-time-slots`; await this.page.route(apiUrl, async (route) => { const currentDate = new Date().toISOString().split('T')[0]; // e.g., "2025-07-23" if(route.request().postDataJSON().startDate === currentDate) { diff --git a/playwright-tests/playwright.config.ts b/playwright-tests/playwright.config.ts index 2fe027426..40b1ddb01 100644 --- a/playwright-tests/playwright.config.ts +++ b/playwright-tests/playwright.config.ts @@ -9,7 +9,7 @@ if (!process.env.CI) { // Environment variables are present in CI environment, no need to read from file const basePath = __dirname; // This gets the directory where the config file is located - if (process.env.NODE_ENV == 'undefined' || process.env.NODE_ENV == null) { + if (process.env.PLAYWRIGHT_ENV == 'undefined' || process.env.PLAYWRIGHT_ENV == null) { dotenv.config({ path: path.join(basePath, '.env.dev'), example: path.join(basePath, '.env.example') @@ -17,7 +17,7 @@ if (!process.env.CI) { } else { dotenv.config({ - path: path.join(basePath, `.env.${process.env.NODE_ENV}`), + path: path.join(basePath, `.env.${process.env.PLAYWRIGHT_ENV}`), example: path.join(basePath, '.env.example') }); } @@ -42,7 +42,7 @@ const ortoniReportConfig: OrtoniReportConfig = { filename: `ortoni_report_${formatDateForFilename(new Date())}.html`, showProject: false, projectName: "FMG-Nextgen-Playwright-Report", - testType: `E2E- Environment: ${process.env.NODE_ENV} `, + testType: `E2E- Environment: ${process.env.PLAYWRIGHT_ENV} `, preferredTheme: "light", base64Image: true, }