-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Check Accessibility in Cypress with Axe #17152
Conversation
4d1a0ba
to
57853f6
Compare
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.
Seems OK to me, but I have two remarks.
-
It would have been better to rely on a popular library for color manipulation functions, but I did not find any library that would match our needs. Indeed, there are many color manipulation libraries, but I did not find any maintained and GPLv3 compatible library that just propose basic features like we have in the
Color
js class. Therefore, libraries I found are not as light as we could expect. For instance, the minified dist ofTinyColor
weights 15KB. -
As far as I understand, it will be necessary to call the
injectAndCheckA11y()
method manually in all of our tests cases, to check only specific elements. I guess it is preferable for many reasons (checking the whole page too often would probably be too long, there are many issues to fix before all of our pages could be validated, ...), but it means that we have to take care that, each test, will call this method when it is necessary. It is probable that we will miss this point often. I think that it could be usefull to provide a quick guide to explain the way our E2E tests should be made.
style="{% if user_thumbnail is not null %}background-image: url({{ user_thumbnail }}); background-color: inherit; {% else %} background-color: {{ bg_color }};{% endif %} | ||
color: {{ fg_color }}"> |
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.
The foreground color seems only necessary when the initials are displayed (when the thumbnail is null).
style="{% if user_thumbnail is not null %}background-image: url({{ user_thumbnail }}); background-color: inherit; {% else %} background-color: {{ bg_color }};{% endif %} | |
color: {{ fg_color }}"> | |
style="{% if user_thumbnail is not null %}background-image: url({{ user_thumbnail }}); background-color: inherit; {% else %} background-color: {{ bg_color }}; color: {{ fg_color }};{% endif %}"> |
It's nothing and the changes permit to:
So I'm pretty in favor
|
I did not find any smaller alternative that is as popular and maintained as TinyColor. Also, TinyColor has no dependencies, meaning that it will never be subject to issues like usage of an unmaintained/unsecure/incompatible dependency. So OK to use TinyColor. @cconard96 Do you prefer to do it in the current PR, or to do it in another PR ? |
For the color functions: For the subject of the PR:
It could be used to test an entire page, but the goal is to test specific things. Since we finally moved to Twig for most things and reuse components, there isn't really a need to test the entire page I think.
I agree for some documentation. In general, the goal was to add at least some accessibility checks, start making fixes as we find issues, and keep a list of outstanding issues we know about but haven't fixed yet. This, alongside using the selectors from |
Maybe it can be done using the |
c878471
to
9b6ad19
Compare
Testing using
cypress-axe
to automatically scan GLPI pages for accessibility issues.Example of accessibility issue report: