Test accessibility with axe-core on Browserstack #1244
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
name: Test accessibility with axe-core on Browserstack | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
test_for_accessibility_issues: | |
runs-on: ubuntu-latest | |
environment: | |
name: development | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
NEXT_PUBLIC_ARCHIVE_CONTENT_LINK: ${{ vars.ARCHIVE_CONTENT_LINK }} | |
steps: | |
- name: BrowserStack Env Setup π # Invokes the setup-env action | |
id: setup-browserstack-environment | |
uses: browserstack/github-actions/setup-env@master | |
with: | |
username: ${{ secrets.BROWSERSTACK_USERNAME }} | |
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
- name: BrowserStack Local Tunnel Setup π # Invokes the setup-local action | |
id: setup-local-browserstack-tunnel | |
uses: browserstack/github-actions/setup-local@master | |
with: | |
local-testing: start | |
local-identifier: random | |
- name: Checkout ποΈ | |
uses: actions/checkout@v3 | |
- name: Cache pnpm modules πΎ | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-pnpm-modules | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- | |
- name: Install pnpm π¦ | |
id: install-pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: '8.5.1' | |
- name: Install dependencies π§ | |
id: install-dependencies | |
run: | | |
pnpm install --filter energy-vision | |
pnpm install --filter energy-vision-web | |
pnpm install --filter energy-vision-e2e-testing | |
- name: Build web application βοΈ | |
id: build-web-app | |
run: pnpm web build | |
- name: Running application under test βΆοΈ | |
id: run-webapp | |
run: pnpm web start & | |
- name: Running test on BrowserStack π | |
id: execute-tests-on-browserstack | |
run: pnpm e2e test | |
- name: BrowserStackLocal Stop β # Terminating the BrowserStackLocal tunnel connection | |
id: stop-browserstack | |
uses: browserstack/github-actions/setup-local@master | |
with: | |
local-testing: stop | |
- name: Publish results to Slack π¬ | |
id: publish-to-slack | |
uses: equinor/axe-slack-reporter@v1.9 | |
with: | |
fileName: e2e/output/Chrome_envis_news_report.json ## Temporary file name. Will use something more clever. Promise! | |
- name: log-errors-to-slack π | |
uses: act10ns/slack@v2 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
if: failure() |