-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Issue 923 accessibility testing #1014
Issue 923 accessibility testing #1014
Conversation
…nth-api-bench#923) Add cypress-axe, create dynamic tests for each page added in the constants page object, they all pass if skipFailures is true.
WalkthroughCodeRabbit has integrated enhancements into the documentation website's accessibility. The updates encompass ignoring specific directories, refining Cypress configurations for accessibility testing, and introducing new constants and dependencies to facilitate this functionality. The primary emphasis is on automated accessibility testing across various UI modes. Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This is paused. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
documentation-website/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (5)
- .gitignore (1 hunks)
- documentation-website/cypress.config.ts (1 hunks)
- documentation-website/cypress/e2e/accessibility.cy.ts (1 hunks)
- documentation-website/cypress/fixtures/constants.ts (1 hunks)
- documentation-website/package.json (2 hunks)
Files skipped from review due to trivial changes (2)
- .gitignore
- documentation-website/cypress/fixtures/constants.ts
Additional Context Used
Path-based Instructions (2)
documentation-website/cypress.config.ts (1)
Pattern
**/*.ts
: Review the code for conformity with the .eslintrc files in / and /*/.documentation-website/cypress/e2e/accessibility.cy.ts (1)
Pattern
**/*.ts
: Review the code for conformity with the .eslintrc files in / and /*/.
Additional comments not posted (11)
documentation-website/cypress.config.ts (3)
7-11
: Imports from 'fs' module are added to handle file operations.
13-14
: ConstantACCESSIBILITY_FILES_DIR
is correctly imported from constants file.
28-39
: New taskwriteFile
is added to handle writing of accessibility test results. Ensure directory exists before writing to prevent errors.Verification successful
The task
writeFile
has been verified within thedocumentation-website/cypress.config.ts
file. The implementation checks for the existence of the directory before performing file write operations, aligning with the intended functionality to prevent errors due to non-existent directories.
documentation-website/cypress.config.ts
: Proper directory check and file writing operations are implemented.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the directory creation and file writing operations are handled correctly. # Test: Search for usage of `writeFile` task. Expect: Proper checks before file operations. rg --type typescript $'writeFile'Length of output: 67
Script:
#!/bin/bash # Description: Verify that the directory creation and file writing operations are handled correctly. # Test: Search for usage of `writeFile` task in TypeScript files. Expect: Proper checks before file operations. rg 'writeFile' --glob '*.ts'Length of output: 767
documentation-website/cypress/e2e/accessibility.cy.ts (4)
1-8
: Imports forcypress-axe
and constants are correctly added.
10-28
: FunctionsetMode
is added to adjust UI mode based on input. Ensure it handles all possible UI modes correctly.
30-72
: FunctiontestPageAccessibility
is added to perform accessibility tests and log violations. Ensure it correctly logs and handles violations.Verification successful
Function
testPageAccessibility
is confirmed to log and handle accessibility violations as expected. The function is used within the same file where it is defined, and the implementation matches the provided code snippet.
- File:
documentation-website/cypress/e2e/accessibility.cy.ts
- Lines where function is defined and used: 1, 3, 4
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that accessibility violations are logged and handled correctly. # Test: Search for usage of `testPageAccessibility`. Expect: Proper logging and handling of violations. rg --type typescript $'testPageAccessibility'Length of output: 79
Script:
#!/bin/bash # Description: Verify that accessibility violations are logged and handled correctly. # Test: Search for usage of `testPageAccessibility`. Expect: Proper logging and handling of violations. rg 'testPageAccessibility'Length of output: 293
74-112
: Test suite runs accessibility tests in both dark and light modes for each page route. Ensure all routes are covered and tests are correctly isolated.Verification successful
CodeRabbit has assimilated the output from the executed script. The script was designed to verify that all routes are covered by accessibility tests in the codebase. The output indicates that various routes are indeed referenced in the Cypress end-to-end tests, including specific tests for accessibility.
The output lists numerous instances where different page routes are used in Cypress tests across various files, suggesting comprehensive coverage of routes for accessibility testing. Each route appears to be tested in both dark and light modes as per the original code snippet provided.
Based on the evidence provided by the script output, CodeRabbit concludes that the accessibility tests cover all the routes as expected. The initial review comment is consistent with the findings in the codebase.
Conclusion: All routes are covered by accessibility tests as required.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all routes are covered by accessibility tests. # Test: Search for usage of page routes in tests. Expect: Coverage of all routes. rg --type typescript $'page'Length of output: 62
Script:
#!/bin/bash # Description: Verify that all routes are covered by accessibility tests. # Test: Search for usage of page routes in tests. Expect: Coverage of all routes. rg --type ts $'page'Length of output: 12000
documentation-website/package.json (4)
58-58
: Dependency@napi-rs/image
is added for enhanced Node.js functionality.
61-61
: Dependency@types/node
is updated to support new Node.js features used in the tests.
67-67
: Dependenciesaxe-core
andcypress-axe
are added for conducting accessibility tests.
73-73
: Dependencycypress-axe
is added to enhance Cypress testing with accessibility checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
documentation-website/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (1)
- documentation-website/package.json (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- documentation-website/package.json
The Pull Request is ready
Overview
Add cypress tests to each of the page inside the constants file. The tests produce json files in the cypress/accessibility folder using node filesystem.
Documentation-Website
Notes
As mentioned in our chat, I don't think this is 100% useful