Skip to content

Commit

Permalink
VACMS-19813-Testing existing script for reporting axe violations when…
Browse files Browse the repository at this point in the history
… testing in … (#19815)

* Testing existing script for reporting axe violations when testing in parallel

* Updating comment title
  • Loading branch information
keisterj-oddball authored Nov 15, 2024
1 parent d0bf28f commit 8b296d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/report_cypress_accessibility_errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const getText = (violations) => {
})
.join("\n");
return `${token}
## Cypress Accessibility Test Failures
## Cypress Accessibility Violations
${text}
Expand Down
13 changes: 1 addition & 12 deletions tests/scripts/cypress-parallel-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ set -x
repo_root="$(git rev-parse --show-toplevel)"
pushd "${repo_root}" > /dev/null

: "${GITHUB_COMMENT_TYPE:=unset}"

[ -d node_modules ] || npm install
./node_modules/.bin/cypress install

Expand All @@ -18,16 +16,7 @@ npm run test:cypress:verify
npm run test:cypress:parallel -- "${@}"
exit_code=$?

accessibility_violations=$(<cypress_accessibility_violations.json)
violations_count=$(jq length < cypress_accessibility_violations.json)
if [ "${GITHUB_COMMENT_TYPE}" == "pr" ]; then
if [ "$violations_count" -ne 0 ]; then
comment="$(printf 'Accessibility Violations Found:\n``` json\n%b\n```' "${accessibility_violations}")"
github-commenter \
-delete-comment-regex="Accessibility Violations Found" \
-comment="${comment}"
fi
fi
node tests/report_cypress_accessibility_errors.js

popd > /dev/null

Expand Down

0 comments on commit 8b296d8

Please sign in to comment.