Skip to content

Commit

Permalink
Add headless mode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraelleHub committed Jul 31, 2024
1 parent 6c84e05 commit 5422831
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/documentation_accessibility_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ jobs:
cache: yarn
cache-dependency-path: VAMobile/yarn.lock
- name: Install ChromeDriver
run: npm install -g [email protected]

run: |
# Determine the Chrome version installed
chrome_version=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+')
# Install the matching ChromeDriver version
npm install -g chromedriver@$chrome_version
- name: Test build
working-directory: VAMobile
run: |
Expand Down Expand Up @@ -59,13 +64,14 @@ jobs:
# Extract URLs from sitemap and iterate
for url in $(grep -o '<loc>[^<]*' "$sitemap_path" | sed 's/<loc>//'); do
if axe "$url" --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver --timeout=300000 --exit; then
if axe "$url" --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver --chrome-options='--no-sandbox --disable-gpu' --timeout=300000 --exit; then
echo "No accessibility issues found in $url"
else
echo "Accessibility issues found in $url"
echo "$url" >> accessibility_issues.txt

# Extract number of issues from axe output
issues=$(axe "$url" --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver --timeout=300000 | grep -oP '\d+ Accessibility issues detected' | grep -oP '\d+')
issues=$(axe "$url" --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver --chrome-options='--no-sandbox --disable-gpu' --timeout=300000 | grep -oP '\d+ Accessibility issues detected' | grep -oP '\d+')
if [ -n "$issues" ]; then
num_issues=$((num_issues + issues))
fi
Expand All @@ -87,7 +93,6 @@ jobs:

start_slack_thread:
name: Start Slack thread
if: ${{ failure() }}
needs: axe-scan
uses: ./.github/workflows/start_slack_thread.yml
secrets: inherit
Expand Down

0 comments on commit 5422831

Please sign in to comment.