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

handle axe violations issues resolved #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohanqxf2
Copy link
Collaborator

  • Updated the snapshot_util.py to handle the resolved, updated axe accessibility violations and displayed a better message for users.

@mohanqxf2 mohanqxf2 self-assigned this Jan 17, 2025
@mohanqxf2 mohanqxf2 linked an issue Jan 17, 2025 that may be closed by this pull request
@mohanqxf2 mohanqxf2 requested a review from avinash010 January 17, 2025 07:31
@mohanqxf2
Copy link
Collaborator Author

mohanqxf2 commented Jan 20, 2025

I have tested the following cases:

  1. New violation added:
    When the snapshot finds new violation item [i.e dictionary_item_added] in the snapshot it says as New violation added
    { "description": "id": "impact": "nodes": "tags": }

  1. Violation resolved:
    When the snapshot has resolved the existing violation item [i.e dictionary_item_removed] in the snapshot it says as Violation resolved
    { "description": "id": "impact": "nodes": "tags": }

  1. Violation Node updated:
    When the snapshot violations are changed/updated/modified [i.e values_changed] in the snapshot, it says as Violation updated along with the Old value and New value of the violations

Update the node item/violation data, Here in this case I have updated 2015 to 2025

{
                                "html": "<p class=\"text-center qxf2_copyright\">\n© Qxf2 Services 2013 - 2025\n</p>",
                                "target": [
                                    ".qxf2_copyright"
                                ]
}

  1. Violation Node added:
    When the snapshot violations Nodes/Related nodes found newly [i.e iterable_item_added] in the snapshot,, It says as Violation Node added along with the node details

Remove the Node item in the existing snapshot to test this case.

{
                        "data": null,
                        "id": "aria-label",
                        "impact": "serious",
                        "message": "aria-label attribute does not exist or is empty",
                        "relatedNodes": []
}

  1. Violation Node resolved
    When the snapshot violations Nodes/Related nodes resolved[i.e iterable_item_removed] in the snapshot,, It says as Violation Node resolved with the node details

Add the Node item in the existing snapshot to test this case.

@avinash010
Copy link
Collaborator

@mohanqxf2 If the violation gets removed shouldn't the test status be Passed with a message to the user to update the snapshot?

@avinash010
Copy link
Collaborator

@mohanqxf2 The tests that you performed aren't complete. You can try other conditions too like

  • What if you add some nodes and remove others for the same root element?
  • Add some nodes and remove others for different root elements.
  • Similarly add new violations and remove others.

I could find some issues with these tests

@mohanqxf2
Copy link
Collaborator Author

@mohanqxf2 The tests that you performed aren't complete. You can try other conditions too like

  • What if you add some nodes and remove others for the same root element?
    For this case, Case 3 Violation Node updated: will handle and display as changed from old element to new element
    image
  • Add some nodes and remove others for different root elements.
  • Similarly add new violations and remove others.
    Also works with case 3 Violation Node updated

@mohanqxf2
Copy link
Collaborator Author

@mohanqxf2 If the violation gets removed shouldn't the test status be Passed with a message to the user to update the snapshot?

For this case, need to slightly change the logic part, as of now the snapshots are comparing with each other, if any changes found then the test will be failed, if matches then the test will pass

I will update the login to handle if any violations/nodes resvoled, then the test should be pass[for this case, the current and existing snapshot will not match because of violation will be resolved in the current snapshot]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle the script when there are no accessibility issues found
2 participants