source: frontend/node_modules/axe-core/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 10.2 KB
Line 
1# axe-core
2
3[![License](https://img.shields.io/npm/l/axe-core.svg?color=c41)](LICENSE)
4[![Version](https://img.shields.io/npm/v/axe-core.svg)](https://www.npmjs.com/package/axe-core)
5[![NPM downloads](https://img.shields.io/npm/dw/axe-core.svg?color=080)![](https://img.shields.io/npm/dy/axe-core.svg?color=080&label=)](https://npm-stat.com/charts.html?package=axe-core&from=2017-01-01)
6[![Commits](https://img.shields.io/github/commit-activity/y/dequelabs/axe-core.svg)](https://github.com/dequelabs/axe-core/commits/develop)
7[![GitHub contributors](https://img.shields.io/github/contributors/dequelabs/axe-core.svg?color=080)](https://github.com/dequelabs/axe-core/graphs/contributors)
8[![Join our Slack chat](https://img.shields.io/badge/slack-chat-purple.svg?logo=slack)](https://accessibility.deque.com/axe-community)
9[![Package Quality](https://npm.packagequality.com/shield/axe-core.svg)](https://packagequality.com/#?package=axe-core)
10
11Axe is an accessibility testing engine for websites and other HTML-based user interfaces. It's fast, secure, lightweight, and was built to seamlessly integrate with any existing test environment so you can automate accessibility testing alongside your regular functional testing.
12
13[Sign up for axe news](https://hubs.ly/H0fsN0b0) to get the latest on axe features, future releases, and events.
14
15## The Accessibility Rules
16
17Axe-core has different types of rules, for WCAG 2.0, 2.1, 2.2 on level A, AA and AAA as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored. The complete list of rules, grouped WCAG level and best practice, can be found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
18
19With axe-core, you can find **on average 57% of WCAG issues automatically**. Additionally, axe-core will return elements as "incomplete" where axe-core could not be certain, and manual review is needed.
20
21To catch bugs earlier in the development cycle we recommend using the [axe-linter vscode extension](https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter). To improve test coverage even further we recommend the [intelligent guided tests](https://www.youtube.com/watch?v=AtsX0dPCG_4&feature=youtu.be&ab_channel=DequeSystems) in the [axe Extension](https://www.deque.com/axe/browser-extensions/).
22
23## Getting started
24
25First download the package:
26
27```console
28npm install axe-core --save-dev
29```
30
31Now include the javascript file in each of your iframes in your fixtures or test systems:
32
33```html
34<script src="node_modules/axe-core/axe.min.js"></script>
35```
36
37Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:
38
39```js
40axe
41 .run()
42 .then(results => {
43 if (results.violations.length) {
44 throw new Error('Accessibility issues found');
45 }
46 })
47 .catch(err => {
48 console.error('Something bad happened:', err.message);
49 });
50```
51
52## Philosophy
53
54The web can only become an accessible, inclusive space if developers are empowered to take responsibility for accessibility testing and accessible coding practices.
55
56Automated accessibility testing is a huge timesaver, it doesn't require special expertise, and it allows teams to focus expert resources on the accessibility issues that really need them. Unfortunately, most accessibility tools are meant to be run on sites and applications that have reached the end of the development process and often don't give clear or consistent results, causing frustration and delays just when you thought your product was ready to ship.
57
58Axe was built to reflect how web development actually works. It works with all modern browsers, tools, and testing environments a dev team might use. With axe, accessibility testing can be performed as part of your unit testing, integration testing, browser testing, and any other functional testing your team already performs on a day-to-day basis. Building accessibility testing into the early development process saves time, resources, and all kinds of frustration.
59
60## About axe - our Manifesto
61
62- Axe is open source.
63- It returns zero false positives (bugs notwithstanding).
64- It's designed to work on all modern browsers and with whatever tools, frameworks, libraries and environments you use today.
65- It's actively supported by [Deque Systems](https://www.deque.com), a major accessibility vendor.
66- It integrates with your existing functional/acceptance automated tests.
67- It automatically determines which rules to run based on the evaluation context.
68- Axe supports in-memory fixtures, static fixtures, integration tests, and iframes of infinite depth.
69- Axe is highly configurable.
70
71## Supported Browsers
72
73The [axe-core API](doc/API.md) fully supports the following browsers:
74
75- Microsoft Edge v40 and above
76- Google Chrome v42 and above
77- Mozilla Firefox v38 and above
78- Apple Safari v7 and above
79- Internet Explorer v11 (DEPRECATED)
80
81Support means that we will fix bugs and attempt to test each browser regularly. Only Chrome and Firefox are currently tested on every pull request.
82
83There is limited support for JSDOM. We will attempt to make all rules compatible with JSDOM but where this is not possible, we recommend turning those rules off. Currently the `color-contrast` rule is known not to work with JSDOM.
84
85We can only support environments where features are either natively supported or polyfilled correctly. We do not support the deprecated v0 Shadow DOM implementation.
86
87## Contents of the API Package
88
89The [axe-core API](doc/API.md) package consists of:
90
91- `axe.js` - the JavaScript file that should be included in your web site under test (API)
92- `axe.min.js` - a minified version of the above file
93
94## Localization
95
96Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:
97
98`grunt build --lang=nl`
99
100or equivalently:
101
102`npm run build -- --lang=nl`
103
104This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
105
106To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
107
108To update an existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
109
110Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:
111
112```js
113axe.configure({
114 locale: {
115 lang: 'de',
116 rules: {
117 accesskeys: {
118 help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
119 }
120 // ...
121 },
122 checks: {
123 abstractrole: {
124 fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
125 },
126 'aria-errormessage': {
127 // Note: doT (https://github.com/olado/dot) templates are supported here.
128 fail: 'Der Wert der aria-errormessage ${data.values}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
129 }
130 // ...
131 }
132 }
133});
134```
135
136### Supported Locales
137
138Axe-core supports the following locales. Do note that since locales are contributed by our community, they are not guaranteed to include all translations needed in a release.
139
140- Basque
141- Chinese (Simplified)
142- Chinese (Traditional)
143- Danish
144- Dutch
145- French
146- German
147- Greek
148- Hebrew
149- Italian
150- Japanese
151- Korean
152- Norwegian (Bokmål)
153- Polish
154- Portuguese (Brazilian)
155- Spanish
156
157## Updates & Security
158
159Axe-core has a new minor release every 3 to 5 months, which usually introduces new rules and features. We recommend scheduling time to upgrade to these versions. Security updates will be made available for minor version lines up to **18 months old**.
160
161- See [release and support](doc/release-and-support.md) for details on the frequency of releases, long-term support and recommendations on upgrading axe-core.
162- See [backward compatibility](doc/backwards-compatibility-doc.md) for details on the types of changes different releases may introduce.
163
164## Deque Trademarks Policy
165
166DEQUE, DEQUELABS, AXE®, and AXE-CORE® are trademarks of Deque Systems, Inc. Use of the Deque trademarks must be in accordance with [Deque's trademark policy](https://www.deque.com/legal/trademarks/).
167
168## Supported ARIA Roles and Attributes.
169
170Refer [axe-core ARIA support](./doc/aria-supported.md) for a complete list of ARIA supported roles and attributes by axe.
171
172## Contributing
173
174Read the [Proposing Axe-core Rules guide](./doc/rule-proposal.md)
175
176Read the [documentation on the architecture](./doc/developer-guide.md)
177
178Read the [documentation on contributing](CONTRIBUTING.md)
179
180## Projects using axe-core
181
182[List of projects using axe-core](doc/projects.md)
183
184## Acknowledgements
185
186Thanks to Marat Dulin for his [css-selector-parser](https://www.npmjs.com/package/css-selector-parser) implementation which is included for shadow DOM support. Another thank you to the [Slick Parser](https://github.com/mootools/slick/blob/master/Source/Slick.Parser.js) implementers for their contribution, we have used some of their algorithms in our shadow DOM support code. Thanks to Lea Verou and Chris Lilley for their [colorjs.io](https://colorjs.io/) library which we have used for converting between color formats.
187
188## Licenses
189
190Axe-core is distributed under the [Mozilla Public License, version 2.0](LICENSE). It comes bundled with several dependencies which are distributed under their own terms. (See [LICENSE-3RD-PARTY.txt](LICENSE-3RD-PARTY.txt))
Note: See TracBrowser for help on using the repository browser.