From ae4c26499bc5adaa890aaae3b103863b8ee71629 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 24 Apr 2025 11:26:21 -0400 Subject: [PATCH] Uses env var to control content site execution Updates the workflow to conditionally execute the content site (home page) based on the SKIP_CONTENT_SITE environment variable. This allows for skipping the content site in specific environments. Also, removes unused test data properties. --- playwright-tests/.env.dev | 4 +++- playwright-tests/tests/0000__M.test.ts | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/playwright-tests/.env.dev b/playwright-tests/.env.dev index 47ec8336d..0330919bf 100644 --- a/playwright-tests/.env.dev +++ b/playwright-tests/.env.dev @@ -19,4 +19,6 @@ CCIS_API_URL="https://api.test.belronus.io" ADMIN_SERVICE_API_URL="https://issadminapi.dev.sagaws.net/iss-admin/api/v1/" # API authentication (replace with actual value when running tests) -CCIS_API_AUTH="undefined" \ No newline at end of file +CCIS_API_AUTH="undefined" + +SKIP_CONTENT_SITE=false \ No newline at end of file diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index cb2ac2a82..0c1abb757 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -156,12 +156,9 @@ async function runWorkflow(page: Page, testCase: TestCase) { // Destructure test data for easier access const { - servicePackage, paymentMethod, customerDetails, vehicleDetails, vehicleDamage, - appointmentDetails, paymentDetails, claimDetails, partQuestions, enterFunnelWithZip, - capabilityQuestions, vehiclePartQuestions, moldingQuestions, isPolicyFound, - otherVehiclesOnPolicy, isUseVehicleOnPolicy, isDuplicateClaim, isRecalNotification, - alertFlags, endorsements, isPolicyDriver, skipEstimatePage, isRecalVehicle, canNotRecal, - dynamicRecal, hasOemEndorsement, promoCode + paymentMethod, customerDetails, vehicleDetails, vehicleDamage, + paymentDetails, partQuestions, enterFunnelWithZip, capabilityQuestions, + vehiclePartQuestions, moldingQuestions, skipEstimatePage } = testCase.testData; // Check if the vehicle damage includes a windshield crack @@ -172,7 +169,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { //============================= TEST WORKFLOW STEPS ============================= // Execute home page for qa and dev environments (skip for sys) - if (process.env.NODE_ENV !== 'sys') { + if (process.env.SKIP_CONTENT_SITE == "false") { await test.step('HomePage >> Lets Get Started', async () => { let homePage = testCase.pages.homePage; console.log(`Customer for this test: ${customerDetails?.firstName} ${customerDetails?.lastName}`);