ks-integration allows integration tests to be run with Mocha and Selenium.
Make sure that Firefox is installed and on the path. Currently does not work with any version of Firefox above 31.
- grunt test
- In
test/integration/rules
create a full HTML page with your test cases (e.g.,test.html
) - In that same directory, create a JSON file with the same basename (e.g.
test.json
) with the following properties:description
- Test namerule
- The id of the rule you're testingviolations
- An array of selector arrays in the same format that is returned by a11ycheck, for those nodes that are expected to give violationspasses
- The same array of arrays, for those nodes that are expected to pass
- NodeJS
- Bower (after installing Node and NPM run
npm install -g bower
)
- Clone this repo
- Open a Terminal or Command Prompt and run
npm install && bower install
grunt build
to build distributables
Fixtures are generated by templates, so that we do not have to manually manage references to tests and source files. Due to Cross-Origin restrictions, you must run a fixture server before running the tests.
There are a couple options for running tests and the fixture server:
grunt server
- This will generate the fixtures and start a server at http://localhost:9876/grunt connect watch
- This will start the server and also re-generate fixtures and distributables any time a source file or test is changed.