Test accessibility with axe-core on Browserstack #1275
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/[email protected] | |
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() |