Skip to content

workflow to run cypress against any deployed url #1

workflow to run cypress against any deployed url

workflow to run cypress against any deployed url #1

name: Deployed Regression
on:
workflow_dispatch:
inputs:
branch:
description: Branch containing cypress tests
default: master
required: true
deployedUrl:
description: URL to test
default: https://collaborative-learning.concord.org/index-staging.html
required: true
# just to get this to be available for testing
push:
jobs:
all-tests:
runs-on: ubuntu-latest
container: cypress/browsers:node-20.11.0-chrome-121.0.6167.184-1-ff-123.0-edge-121.0.2277.128-1
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
# run 5 copies of the current job in parallel
containers: [1, 2, 3, 4, 5, 6, 7]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Run Cypress Tests
uses: cypress-io/github-action@v4
with:
# TODO: we might need to manual set the build id
# TODO: the description of the run in cypress will be the commit message of branch
# instead of something about the app being tested.
# only record the results to dashboard.cypress.io if CYPRESS_RECORD_KEY is set
record: ${{ !!secrets.CYPRESS_RECORD_KEY }}
# only do parallel if we have a record key
parallel: ${{ !!secrets.CYPRESS_RECORD_KEY }}
browser: chrome
spec: cypress/e2e/functional/**
env:
# override the baseUrl
CYPRESS_baseUrl: ${{ github.event.inputs.deployedUrl }}
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Increase memory allocation
NODE_OPTIONS: "--max_old_space_size=4096"
# Note: we can't do code coverage because the deployed code will not be
# instrumented