Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-19813-Testing existing script for reporting axe violations when testing in … #19815

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
Loading