Skip to content

Test accessibility with axe-core on Browserstack #1244

Test accessibility with axe-core on Browserstack

Test accessibility with axe-core on Browserstack #1244

Workflow file for this run

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()