-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,21 +92,25 @@ jobs: | |
with: | ||
skip-ruby: true | ||
|
||
- run: npm install | ||
- name: Run Axe accessibility tests against QA sitemap pages | ||
- name: Install axe-core and sitemap-urls | ||
run: npm install -g @axe-core/cli sitemap-urls | ||
|
||
- name: Get list of URLs to test against from QA sitemap | ||
run: | | ||
npm install -g @axe-core/cli sitemap-urls | ||
# Gets all urls from sitemap in an array | ||
urls=($(curl https://$HTTP_BASIC_USER:[email protected]/sitemap.xml | sitemap-urls)) | ||
# Removes sitemap urls that are redundant | ||
# Removes redundant sitemap urls | ||
urls=("${urls[@]/*teaching-jobs-in-*}") | ||
urls=("${urls[@]/*\-jobs*}") | ||
# Delete empty elements | ||
for i in ${!urls[@]}; do [[ -z ${urls[i]} ]] && unset urls[i]; done | ||
# Transforms URLS to authenticated URLs | ||
urls=("${urls[@]/qa\./$HTTP_BASIC_USER\:$HTTP_BASIC_PASSWORD\@qa\.}") | ||
# Runs axe against each url from the sitemap | ||
axe $(for url in "${urls[@]}"; do echo $url, ; done;) --exit | ||
echo "URLS=$urls" >> $GITHUB_ENV | ||
- name: Run Axe accessibility tests against QA sitemap pages | ||
run: | | ||
axe $(for url in "${URLS[@]}"; do echo $url, ; done;) --exit | ||
- name: Configure AWS credentials | ||
if: failure() | ||
|