Skip to content

Cypress E2E Testing of Deployed React Adobe Embed Component as a Heartbeat Canary #12912

Cypress E2E Testing of Deployed React Adobe Embed Component as a Heartbeat Canary

Cypress E2E Testing of Deployed React Adobe Embed Component as a Heartbeat Canary #12912

name: Cypress E2E Testing of Deployed React Adobe Embed Component as a Heartbeat Canary
on:
repository_dispatch:
types: [react_adobe_embed_code_pushed]
push:
branches: [main]
schedule:
- cron: '*/12 13-23 * * *'
- cron: '*/12 0-5 * * *'
jobs:
install:
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress install
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
# Disable running of tests within install job
runTests: false
build: npm install
config-file: "cypress.config.ts"
cypress-runner-verify:
name: Cypress Runner that runs a single test suite which verifies the accessed page is with the latest deployed code
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
needs: install
environment: canary-continous-deployment
if: github.event_name == 'repository_dispatch'
steps:
- name: Checkout test code
uses: actions/checkout@v2
- name: Install dependencies required for Cypress"
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
config-file: "cypress.config.ts"
runTests: false
- name: Run Verify Test Suite
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
install: false # Explicit due to having done so in a different step
record: true
spec: cypress/e2e/push.*.ts
config-file: "cypress.config.ts"
browser: chrome
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
REACT_ADOBE_EMBED_API_KEY: ${{ secrets.REACT_ADOBE_EMBED_API_KEY }}
DATEMODIFIED_CODE_DEPLOYED: ${{ github.event.client_payload.message.DATEMODIFIED_CODE_DEPLOYED }}
cypress-runner:
name: Cypress Runner for completing a run of all tests
runs-on: ubuntu-latest
container: cypress/browsers:node18.6.0-chrome105-ff104
needs: install
environment: canary-continous-deployment
steps:
- name: Checkout test code
uses: actions/checkout@v2
- name : Install dependencies required for Cypress"
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
config-file: "cypress.config.ts"
runTests: false
- name: Run Cypress tests
uses: cypress-io/github-action@v6.5.0 #use the explicit version number
with:
install: false # Explicit due to having done so in a different step
record: false
spec: |
cypress/e2e/base.*.ts
cypress/e2e/lightbox.*.ts
config-file: "cypress.config.ts"
browser: chrome
env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
REACT_ADOBE_EMBED_API_KEY: ${{ secrets.REACT_ADOBE_EMBED_API_KEY }}