Before you can work on the bbc-a11y code you'll need to install a couple of things on your system:
You'll also need a Github account
Once you are signed into Github you can fork and clone the bbc-a11y repository.
Now that you have a copy of the code on your system you'll need to install the development dependencies. Node.js ships with a package manager called npm which you can use from a command line to install these:
npm install
Once that's finished you should then run all the tests to verify everything is working as expected:
npm test
You should see red if anything fails. If all tests pass, you are ready to start hacking! If not, please get in touch and we'll help you figure it out.
Before working on changes you should briefly review the issues that have already been raised via Github and the cucumber features as there may be similar scenarios that are already implemented. Then you can change the features, or add scenarios to cover new edge cases, or create new feature files.
Before spending time implementing code changes, we recommend that you raise an issue letting us know what you intend to do, just to ensure your effort is not wasted.
When it's time to implement your changes, you'll need to write JavaScript code.
There are high-level cucumber features and low-level specs, both implemented in JavaScript. The cucumber features are generally broad in scope and the low-level tests cover finer details like individual modules and classes. Please try to add scenarios and/or tests for any changes that you make, and don't be afraid to ask for help.
You can run individual features
(via cucumber-electron) by
running ./cucumber
from the root of the project. For example:
./cucumber features/setting_cookies.feature
A similar script for running the low-level mocha tests also exists:
./mocha test/xpathSpec.js
Please stick to JavaScript standard style. An npm task is available to check your code conforms:
npm run standard
...and another task will automatically fix any minor issues with your code:
npm run standard-fix
When all your tests pass, push the changes up to your fork and make a comment on your pull request and the bbc-a11y team will review your work before merging it into the project.
Happy hacking!