GithubHelp home page GithubHelp logo

aweary / axe-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dequelabs/axe-core

1.0 2.0 0.0 5.44 MB

Accessibility engine for automated Web UI testing

Home Page: https://www.deque.com/axe/

License: Mozilla Public License 2.0

Shell 0.02% JavaScript 90.50% HTML 9.31% CSS 0.02% TypeScript 0.16%

axe-core's Introduction

axe-core

Greenkeeper badge

License Version Total npm downloads Commits GitHub contributors Join the chat at https://gitter.im/dequelabs/axe-core Package Quality

Axe Logo

Axe 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.

Sign up for axe news to get the latest on axe features, future releases, and events.

Philosophy

The web can only become an accessible, inclusive space if developers are empowered to take responsibility for accessibility testing and accessible coding practices.

Automated 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.

Axe 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.

About axe - our Manifesto

  • Axe is open source.
  • It returns zero false positives (bugs notwithstanding).
  • It's designed to work on all modern browsers and with whatever tools, frameworks, libraries and environments you use today.
  • It's actively supported by Deque Systems, a major accessibility vendor.
  • It integrates with your existing functional/acceptance automated tests.
  • It automatically determines which rules to run based on the evaluation context.
  • Axe supports in-memory fixtures, static fixtures, integration tests and iframes of infinite depth.
  • Axe is highly configurable.

Getting started

First download the package:

npm install axe-core --save-dev

Now include the javascript file in each of your iframes in your fixtures or test systems:

<script src="node_modules/axe-core/axe.min.js"></script>

Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:

axe.run(function (err, results) {
  if (err) throw err;
    ok(results.violations.length === 0, 'Should be no accessibility issues');
    // complete the async call
    ...
});

Supported Browsers

The axe-core API fully supports the following browsers:

  • Microsoft Edge v40 and above
  • Google Chrome v42 and above
  • Mozilla Firefox v38 and above
  • Apple Safari v7 and above
  • Internet Explorer v9, 10, 11

Support means that we will fix bugs and attempt to test each browser regularly. Only Firefox and Chrome are currently tested on every pull request.

There 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.

We can only support environments where features are either natively supported or polyfilled correctly.

The Accessibility Rules

The complete list of rules run by axe-core can be found in doc/rule-descriptions.md.

Contents of the API Package

The axe-core API package consists of:

  • axe.js - the JavaScript file that should be included in your web site under test (API)
  • axe.min.js - a minified version of the above file

Localization

Axe can be built using your local language. To do so, a localization file must be added to the ./locales directory. This file must have 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:

grunt build --lang=nl

This will create a new build for axe, called axe.<lang>.js and axe.<lang>.min.js. If you want to build localized versions, simply pass in --all-lang instead.

To create a new translation for axe, start by running grunt translate --lang=<langcode>. This will create a json file fin the ./locales directory, with the default English text in it for you to translate. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below.

To update 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.

Additionally, 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:

axe.configure({
	locale: {
		lang: 'de',
		rules: {
			accesskeys: {
				help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
			}
			// ...
		},
		checks: {
			abstractrole: {
				fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
			},
			'aria-errormessage': {
				// Note: doT (https://github.com/olado/dot) templates are supported here.
				fail:
					'Der Wert der aria-errormessage {{~it.data:value}} `{{=value}}{{~}}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
			}
			// ...
		}
	}
});

Supported ARIA Roles and Attributes.

Refer axe-core ARIA support for a complete list of ARIA supported roles and attributes by axe.

Contributing

Read the Proposing Axe-core Rules guide

Read the documentation on the architecture

Read the documentation on contributing

Projects using axe-core

List of projects using axe-core

Acknowledgements

Thanks to Dulin Marat for his css-selector-parser implementation which is included for shadow DOM support.

Thanks to the Slick Parser implementers for their contribution, we have used some of their algorithms in our shadow DOM support code.

axe-core's People

Contributors

0ddfell0w avatar badtant avatar christoffer-dropbox avatar deque-andrew avatar dmfay avatar dsturley avatar dylanb avatar felixzapata avatar greenkeeper[bot] avatar iandotkelly avatar isner avatar jaimeiniesta avatar jasonkarns avatar jeeyyy avatar jessebeach avatar jkva avatar keith-rhodes-0723 avatar kittygiraudel avatar marcysutton avatar mfairchild365 avatar nschonni avatar paulirish avatar rdeltour avatar scurker avatar stephenmathieson avatar straker avatar sulsanaul avatar wilcofiers avatar yzen avatar zkf avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.