Skip to content

Cypress staging a11y tests #2007

Cypress staging a11y tests

Cypress staging a11y tests #2007

name: Cypress staging a11y tests
on:
schedule:
- cron: 0 */3 * * *
defaults:
run:
shell: bash
jobs:
cypress-tests:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 16.x
- name: Write the cypress.env.json file
# use quotes around the secret, as its value
# is simply inserted as a string into the command
run: |
echo '${{ secrets.CYPRESS_ENV_JSON }}' > tests_cypress/cypress.env.json
- name: Run the cypress tests
uses: cypress-io/github-action@d79d2d530a66e641eb4a5f227e13bc985c60b964 # v4.2.2
with:
record: false
config: video=false,screenshotOnRunFailure=false
build: npx cypress info
working-directory: tests_cypress
spec: |
cypress/e2e/admin/a11y/app_pages.cy.js
cypress/e2e/admin/a11y/gca_pages.cy.js
- name: Notify Slack channel if this job failed
if: ${{ failure() }}
run: |
json="{'text':'<!here> Staging a11y tests failed: <https://github.com/cds-snc/notification-admin/actions/runs/${GITHUB_RUN_ID}|see failure details> !'}"
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_WEBHOOK }}