-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add playwright job (QLT-83) (#308)
- Loading branch information
1 parent
c5c8bf1
commit b9a75a2
Showing
4 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
playwright-version: | ||
type: string | ||
docker: # run the steps with Docker. | ||
- image: mcr.microsoft.com/playwright:v<< parameters.playwright-version >>-noble | ||
resource_class: xlarge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
executor: | ||
name: playwright-executor | ||
playwright-version: << parameters.playwright-version >> | ||
parallelism: << parameters.parallelism >> | ||
|
||
parameters: | ||
playwright-version: | ||
type: string | ||
default: "1.48.2" | ||
e2e-env-name: | ||
type: string | ||
default: "" | ||
parallelism: | ||
type: integer | ||
default: 1 | ||
target-url: | ||
type: string | ||
default: "" | ||
description: "use this to override the e2e-env-name and set the full creator-app URL" | ||
branch-or-commit: | ||
type: string | ||
default: "master" | ||
description: "the branch or commit of the automated-testing repo to checkout" | ||
smoke-command: | ||
type: string | ||
default: "test:smoke:playwright" | ||
env-name-path: | ||
type: string | ||
description: Path to the env_name file | ||
default: "/home/circleci/voiceflow/env_name.txt" | ||
steps: | ||
- clone_repo: | ||
github_repo_name: automated-testing | ||
github_commit: << parameters.branch-or-commit >> | ||
path_to_clone: ~/project | ||
- install_node_modules: | ||
avoid_post_install_scripts: false | ||
cache_prefix: playwright-smoke-test | ||
- restore_cache: | ||
key: env_name_cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ .Environment.CIRCLE_WORKFLOW_ID }} | ||
- run: | ||
name: "Set Environment Variables" | ||
command: | | ||
# env_name.txt is used to store the e2e env name and passed to the smoke tests | ||
# uses e2e-env-name if env_name.txt is 'null' | ||
if [ ! -z "<< parameters.target-url >>" ]; then | ||
echo 'export CREATOR_APP_URL=<< parameters.target-url >>' >> $BASH_ENV | ||
elif [ -f << parameters.env-name-path >> ] && [ "$(cat << parameters.env-name-path >>)" != "null" ]; then | ||
echo 'export CREATOR_APP_URL=https://creator-$(cat << parameters.env-name-path >>).br-2.development.voiceflow.com' >> $BASH_ENV | ||
else | ||
echo 'export CREATOR_APP_URL=https://creator-<< parameters.e2e-env-name >>.br-2.development.voiceflow.com' >> $BASH_ENV | ||
fi | ||
shell: /bin/bash | ||
- run: | ||
name: "Reference commit SHA" | ||
command: git rev-parse HEAD >> commit.txt | ||
- restore_cache: | ||
# use the commit of the smoke-test-runner repo as the cache key | ||
key: playwright-smoke-test-build-cache-{{ checksum "commit.txt" }} | ||
- run: | ||
name: Run Smoke Tests | ||
command: yarn << parameters.smoke-command >> | ||
- save_cache: | ||
key: playwright-smoke-test-build-cache-{{ checksum "commit.txt" }} | ||
paths: | ||
- node_modules/.cache/turbo | ||
- store_test_results: | ||
path: tests/smoke-playwright/e2e.report.xml | ||
- store_artifacts: | ||
path: tests/smoke-playwright/test-results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters