Skip to content

jaws-test

jaws-test #24

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: jaws-test
on:
workflow_dispatch:
inputs:
aria_at_ref:
description: |
The sha / ref to checkout for aria-at tests
required: false
type: string
test_pattern:
description: |
The test pattern passed to the aria-at-automation harness.
Uses a default of "{reference/**,test-*-jaws.*}" if not provided
required: false
type: string
work_dir:
description: |
The --plan-workingdir passed to the aria-at-automation harness.
Based from the aria-at repo build folder.
Uses a default of tests/alert if not provided.
required: false
type: string
callback_url:
description: |
The harness will send POST requests to this url using callback_header
header with test results.
required: false
type: string
status_url:
description: |
The harness will send POST requests to this url using callback_header
header with status updates.
required: false
type: string
callback_header:
description: |
The harness will send POST requests to callback_url using this header
with status updates.
required: false
type: string
browser:
description: |
The browser to use for testing, "chrome" or "firefox", default "chrome"
required: false
type: string
jaws_version:
description: |
The version number for JAWS installer.
required: false
type: string
# TODO - JAWS specfic version selection param some day
# nvda_version:
# description: |
# The specific version of NVDA to use (e.g., '2023.1'). If not provided, the latest version will be used.
# required: false
# type: string
env:
ARIA_AT_WORK_DIR: ${{ inputs.work_dir || 'tests/alert' }}
ARIA_AT_TEST_PATTERN: ${{ inputs.test_pattern || '{reference/**,test-*-jaws.*}'}}
ARIA_AT_CALLBACK_URL: ${{ inputs.callback_url }}
ARIA_AT_STATUS_URL: ${{ inputs.status_url }}
ARIA_AT_CALLBACK_HEADER: ${{ inputs.callback_header || 'x-header-param:empty' }}
BROWSER: ${{ inputs.browser || 'chrome' }}
# var in JAWS\InstallJAWSUnattended.ps1
JAWS_VERSION: ${{ inputs.jaws_version || 'default' }}
jobs:
jaws-test:
runs-on: windows-2025
steps:
- name: Log job state QUEUED
shell: powershell
if: inputs.status_url
run: |
$headerbits = $env:ARIA_AT_CALLBACK_HEADER -split ":\s*", 2
$headers = @{$headerbits[0]=$headerbits[1]; "Content-Type" = "application/json"}
$body = @{'status'='QUEUED'; 'externalLogsUrl'="$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"} | ConvertTo-JSON
Invoke-WebRequest $env:ARIA_AT_STATUS_URL -Headers $headers -Method 'POST' -Body $body
# Checkout all repos first (helps cache purposes)
- uses: actions/checkout@v4
- name: Checkout aria-at ref ${{ inputs.aria_at_ref || 'master' }}
uses: actions/checkout@v4
with:
repository: "w3c/aria-at"
path: "aria-at"
ref: ${{ inputs.aria_at_ref || 'master' }}
# for testing specific branch or SHA you can use
# npm install https://github.com/w3c/aria-at-automation-harness#branch-name
- name: Install the ARIA-AT Automation Harness package
run: npm install @bocoup/[email protected]
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- uses: browser-actions/setup-chrome@v1
if: (inputs.browser || 'chrome') == 'chrome'
with:
chrome-version: stable
- uses: browser-actions/setup-firefox@v1
if: inputs.browser == 'firefox'
# Installing Scream as a virtual audio driver to avoid exceptions later
- name: Install Scream (Virtual Audio Driver)
shell: powershell
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Expand-Archive -Path C:\Scream3.6.zip -DestinationPath C:\Scream
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
cd C:\Scream\Install\driver
C:\Scream\Install\helpers\devcon install Scream.inf *Scream
- name: "aria-at: npm install"
shell: powershell
run: |
cd aria-at
npm install
- name: "aria-at: npm run build"
shell: powershell
run: |
cd aria-at
npm run build
- name: Decrypt JAWS license
shell: powershell
env:
JAWS_SECRET: ${{ secrets.JAWS_SECRET }}
run: |
cd JAWS
gpg --quiet --batch --yes --decrypt --passphrase="$env:JAWS_SECRET" --output secret_JAWS.lic secret_JAWS.lic.gpg
- name: Install and start JAWS
shell: powershell
run: |
cd JAWS
& .\InstallJAWSUnattended.ps1
- name: Zip JAWS install logs
shell: powershell
if: always()
run: |
Compress-Archive -Path "$env:TEMP\J2025*" -CompressionLevel "Fastest" -DestinationPath "${{ github.workspace }}\JAWS-Install-logs.zip"
- name: Log job state RUNNING
shell: powershell
if: inputs.status_url
run: |
$headerbits = $env:ARIA_AT_CALLBACK_HEADER -split ":\s*", 2
$headers = @{$headerbits[0]=$headerbits[1]; "Content-Type" = "application/json"}
$body = @{'status'='RUNNING'; 'externalLogsUrl'="$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"; 'work_dir'="$env:ARIA_AT_WORK_DIR"} | ConvertTo-JSON
Invoke-WebRequest $env:ARIA_AT_STATUS_URL -Headers $headers -Method 'POST' -Body $body
- name: Run harness
shell: powershell
timeout-minutes: 30
run: |
& .\run-tester.ps1
- name: Log job state ERROR
shell: powershell
if: failure() && inputs.status_url
run: |
$headerbits = $env:ARIA_AT_CALLBACK_HEADER -split ":\s*", 2
$headers = @{$headerbits[0]=$headerbits[1]; "Content-Type" = "application/json"}
$body = @{'status'='ERROR'; 'externalLogsUrl'="$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"} | ConvertTo-JSON
Invoke-WebRequest $env:ARIA_AT_STATUS_URL -Headers $headers -Method 'POST' -Body $body
- name: Log job state COMPLETED
shell: powershell
if: success() && inputs.status_url
run: |
$headerbits = $env:ARIA_AT_CALLBACK_HEADER -split ":\s*", 2
$headers = @{$headerbits[0]=$headerbits[1]; "Content-Type" = "application/json"}
$body = @{'status'='COMPLETED'; 'externalLogsUrl'="$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"} | ConvertTo-JSON
Invoke-WebRequest $env:ARIA_AT_STATUS_URL -Headers $headers -Method 'POST' -Body $body
- name: upload *.{log,png}
uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: |
${{ github.workspace }}\*.log
${{ github.workspace }}\*.png
${{ github.workspace }}\*.zip