From 53ed7383c405eed19d213cd72798d168e512df3e Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Wed, 9 Jul 2025 14:20:17 -0400 Subject: [PATCH] Adds Playwright test stage for pull requests Introduces a new stage in the pipeline to run Playwright tests specifically for pull requests. This ensures that UI tests are executed and pass before merging pull requests, preventing regressions. The automated testing is now configured to run regression tests. Uses the source branch from the build context to extract the JIRA card number. --- azure-pipelines-automated-testing.yml | 2 +- azure-pipelines.yml | 16 ++++++++++++++++ temp/playwright-test.yml | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-automated-testing.yml b/azure-pipelines-automated-testing.yml index a1de83de3..f43fe6d0c 100644 --- a/azure-pipelines-automated-testing.yml +++ b/azure-pipelines-automated-testing.yml @@ -35,7 +35,7 @@ stages: totalShards: 2 targetUrl: $(BASE_URL) dockerFileName: 'Dockerfile.playwright' - isRegression: false + isRegression: true filterTags: '' playwrightTestsPath: 'playwright-tests' npmServePath: '.' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3867fdcd6..6acbc0e6a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,6 +59,22 @@ stages: npmLocation: $(Build.SourcesDirectory) testResultsFile: junit.xml summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml + - stage: TestPrPlaywright + displayName: Run Playwright Tests For PullRequest + jobs: + - template: temp/playwright-test.yml + parameters: + totalShards: 4 + targetUrl: $(BASE_URL) + dockerFileName: 'Dockerfile.playwright' + isRegression: false + filterTags: '' + playwrightTestsPath: 'playwright-tests' + npmServePath: '.' + npmrcPath: 'playwright-tests/.npmrc' + secrets: + CCIS_API_AUTH: $(CCIS_API_AUTH) + JIRA_API_KEY: $(JIRA_API_KEY) - ${{ else }}: # Dev Build/Deploy - stage: Dev diff --git a/temp/playwright-test.yml b/temp/playwright-test.yml index ac38941a1..7510834ad 100644 --- a/temp/playwright-test.yml +++ b/temp/playwright-test.yml @@ -240,7 +240,7 @@ jobs: arguments: '--no-cache --pull' - bash: | printenv > "${{ parameters.envFileName }}" - branch_name=$(System.PullRequest.SourceBranch) + branch_name=$(Build.SourceBranch) # TODO: Change back to PullRequest.SourceBranch echo "Retrieved branch name: '$branch_name'" JIRA_CARD_NUMBER="${branch_name##*/}" echo "Extracted JIRA Card number: '$JIRA_CARD_NUMBER'"