From 2510f3c9debb9b2acecc99b30701cd0467ef047d Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 10 Apr 2025 13:51:18 -0400 Subject: [PATCH] Adds skip content site functionality. Allows skipping the content site (home page) based on an environment variable. This provides flexibility in test execution, enabling tests to bypass the home page when it's not relevant to the specific scenario being tested. The SKIP_CONTENT_SITE environment variable controls whether to skip the content site. --- playwright-tests/.env.dev | 4 ++++ playwright-tests/tests/0000__M.test.ts | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/playwright-tests/.env.dev b/playwright-tests/.env.dev index 47ec8336d..8c064ba62 100644 --- a/playwright-tests/.env.dev +++ b/playwright-tests/.env.dev @@ -4,9 +4,13 @@ # Environment type NODE_ENV="qa" +SKIP_CONTENT_SITE=false + # Base URLs by environment (uncomment the one you need) # qa BASE_URL="https://www-qa2.safelite.com/" +# qa with skipToInsurance Turned Off +# BASE_URL="https://fixmyglassqa.safelite.com/?cns=all&experiments=ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_VinAndEmailOptional=true,NextGen_IGQSkipToInsurance=NextGen_IGQSkipToInsurance_V1=NextGen_IGQSkipToInsurance_CONTROL=true" # sys # BASE_URL="https://www-test2.safelite.com/fmg/?fmgPage=vehicle" # dev diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 6bef5a2f3..656e078c2 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -192,8 +192,9 @@ 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') { + // Use Environment Variable to decide whether or not we want to skip content site aka home page + + 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}`);