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-19412-Reporting accessibility violations in a PR comment #19625

Conversation

keisterj-oddball
Copy link
Contributor

@keisterj-oddball keisterj-oddball commented Oct 28, 2024

Description

Testing accessibility reporting

Relates to #19412 . (or closes?)

Testing done

Screenshots

QA steps

What needs to be checked to prove this works?

  • After cypress testing completes in tugboat, a comment should be posted in the PR with the contents of the cypress_accessbility_violations.json file from the tugboat instance.
    What needs to be checked to prove it didn't break any related things?
    What variations of circumstances (users, actions, values) need to be checked?

As user uid with user_role

  1. Do this
    • Validate that
  2. Then
    • Validate that
  3. Then validate Acceptance Criteria from issue
    • a
    • b
    • c

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 28, 2024 20:35 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 28, 2024 20:40 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 28, 2024 21:44 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 29, 2024 09:04 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 29, 2024 15:32 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 29, 2024 16:58 Destroyed
Copy link

Checking composer.lock changes...

…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 29, 2024 19:50 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 29, 2024 21:23 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2024 08:56 Destroyed
…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2024 15:31 Destroyed
Copy link

Checking composer.lock changes...

…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2024 20:15 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 31, 2024 08:55 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2024 08:49 Destroyed
…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2024 15:07 Destroyed
Copy link

github-actions bot commented Nov 1, 2024

Checking composer.lock changes...

…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2024 15:56 Destroyed
Copy link

github-actions bot commented Nov 1, 2024

Checking composer.lock changes...

@keisterj-oddball keisterj-oddball marked this pull request as ready for review November 1, 2024 15:57
@keisterj-oddball keisterj-oddball requested review from a team as code owners November 1, 2024 15:57
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2024 17:24 Destroyed
Copy link

github-actions bot commented Nov 1, 2024

Checking composer.lock changes...

Copy link

github-actions bot commented Nov 1, 2024

Checking composer.lock changes...

…-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2024 18:34 Destroyed
Copy link

github-actions bot commented Nov 1, 2024

Checking composer.lock changes...

@va-cms-bot
Copy link
Collaborator

Accessibility Violations Found:

[
  {
    "route": "/test-data-et",
    "id": "button-name",
    "impact": "critical",
    "tags": [
      "cat.name-role-value",
      "wcag2a",
      "wcag412",
      "section508",
      "section508.22.a",
      "ACT",
      "TTv5",
      "TT6.a"
    ],
    "description": "Ensures buttons have discernible text",
    "help": "Buttons must have discernible text",
    "helpUrl": "https://dequeuniversity.com/rules/axe/4.7/button-name?application=axeAPI",
    "nodes": [
      {
        "any": [
          {
            "id": "button-has-visible-text",
            "data": null,
            "relatedNodes": [],
            "impact": "critical",
            "message": "Element does not have inner text that is visible to screen readers"
          },
          {
            "id": "aria-label",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-label attribute does not exist or is empty"
          },
          {
            "id": "aria-labelledby",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty"
          },
          {
            "id": "non-empty-title",
            "data": {
              "messageKey": "noAttr"
            },
            "relatedNodes": [],
            "impact": "serious",
            "message": "Element has no title attribute"
          },
          {
            "id": "presentational-role",
            "data": null,
            "relatedNodes": [],
            "impact": "minor",
            "message": "Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
          }
        ],
        "all": [],
        "none": [],
        "impact": "critical",
        "html": "<button class=\"proofing-element-help\" role=\"tooltip\" data-proofing-help-title=\"About 'Page introduction' field\" data-proofing-help=\"Add an introduction that helps visitors understand if information on the page is relevant to them.\">
          <span aria-hidden=\"true\">i</span>
        </button>",
        "target": [
          ".field--name-field-intro-text-limited-html > .field__label > .proofing-element-help[role=\"tooltip\"]"
        ],
        "failureSummary": "Fix any of the following:
  Element does not have inner text that is visible to screen readers
  aria-label attribute does not exist or is empty
  aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
  Element has no title attribute
  Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
      },
      {
        "any": [
          {
            "id": "button-has-visible-text",
            "data": null,
            "relatedNodes": [],
            "impact": "critical",
            "message": "Element does not have inner text that is visible to screen readers"
          },
          {
            "id": "aria-label",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-label attribute does not exist or is empty"
          },
          {
            "id": "aria-labelledby",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty"
          },
          {
            "id": "non-empty-title",
            "data": {
              "messageKey": "noAttr"
            },
            "relatedNodes": [],
            "impact": "serious",
            "message": "Element has no title attribute"
          },
          {
            "id": "presentational-role",
            "data": null,
            "relatedNodes": [],
            "impact": "minor",
            "message": "Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
          }
        ],
        "all": [],
        "none": [],
        "impact": "critical",
        "html": "<button class=\"proofing-element-help\" role=\"tooltip\" data-proofing-help-title=\"About 'Generate a table of contents from major headings' field\" data-proofing-help=\"By checking this box, all h2's below this point on the page will be linked with with anchor links. This helps users navigate content on very long pages. Do not check this box unless there is at least 2 h2's on the page.\">",
        "target": [
          ".field--name-field-table-of-contents-boolean > .field__label > .proofing-element-help[role=\"tooltip\"]"
        ],
        "failureSummary": "Fix any of the following:
  Element does not have inner text that is visible to screen readers
  aria-label attribute does not exist or is empty
  aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
  Element has no title attribute
  Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
      },
      {
        "any": [
          {
            "id": "button-has-visible-text",
            "data": null,
            "relatedNodes": [],
            "impact": "critical",
            "message": "Element does not have inner text that is visible to screen readers"
          },
          {
            "id": "aria-label",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-label attribute does not exist or is empty"
          },
          {
            "id": "aria-labelledby",
            "data": null,
            "relatedNodes": [],
            "impact": "serious",
            "message": "aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty"
          },
          {
            "id": "non-empty-title",
            "data": {
              "messageKey": "noAttr"
            },
            "relatedNodes": [],
            "impact": "serious",
            "message": "Element has no title attribute"
          },
          {
            "id": "presentational-role",
            "data": null,
            "relatedNodes": [],
            "impact": "minor",
            "message": "Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
          }
        ],
        "all": [],
        "none": [],
        "impact": "critical",
        "html": "<button class=\"proofing-element-help\" role=\"tooltip\" data-proofing-help-title=\"About 'Main content' field\" data-proofing-help=\"The main body of the page, which appears below the featured content.\">
          <span aria-hidden=\"true\">i</span>
        </button>",
        "target": [
          "button[data-proofing-help-title=\"About 'Main content' field\"]"
        ],
        "failureSummary": "Fix any of the following:
  Element does not have inner text that is visible to screen readers
  aria-label attribute does not exist or is empty
  aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
  Element has no title attribute
  Element's default semantics were not overridden with role=\"none\" or role=\"presentation\""
      }
    ]
  }
]

});
},
// Don't fail tests now that violations are reported in PR comments
skipFailures
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming this is the only actual change; everything else looks like reformatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's all reformatting except for the definition of skipFailures and passing that in the checkA11y function. This just makes it so that accessibility violations are logged instead of explicitly failing cypress tests.

@keisterj-oddball keisterj-oddball merged commit fef4eb9 into main Nov 1, 2024
18 checks passed
@keisterj-oddball keisterj-oddball deleted the VACMS-19412-comprehensive-test-plan-dump-the-cypress_accessibility_violationsjson-file-into-the-pr-after-cypress-tests-have-run-in-tugboat branch November 1, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants