Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

csmcallister/fed-a11y

Repository files navigation

License: GPL v3 CircleCI Maintainability Test Coverage

Fed A11y

Automated accessibility testing of most U.S. Federal Government websites.

Getting Started

If you're wanting to develop against this project, follow these steps to get started.

Install Python

This project uses Python 3.11, although other versions should be fine. You can install Python from here, although using another utility (e.g. pyenv or homebrew, for OSX) is fine as well.

Next, activate your python virtual environment:

python -m venv env
source env/bin/activate
pip install -r requirements.txt

Get the Data

Download a snapshot of the data as JSON and place it at feda11y/static/data.json:

wget -O feda11y/static/data.json https://www.feda11y.com/data

Now make a dummy file for the historical data called feda11y/static/hist.json and put something minimal like this in it:

[{"2020-03-09": 0.2}, {"2020-03-16": 0.3}, {"2020-03-23": 0.4}, {"2020-03-30": 0.5}]

These files are normally pulled from cloud storage with each deploy, so it's imperative you recreate them locally before continuing.

Run the Tests

This will verify that everything is working as expected:

coverage run -m pytest

It will also let you see the test coverage with:

coverage report

Start the App

To start the app in development mode, set the following environment variables or create a .env file with the following contents:

FLASK_APP=main.py
FLASK_ENV=development
FLASK_DEBUG=1
SECRET_KEY="somethingsupersecret"

Now you can start the app with:

flask --app main.py run

Alternatively, you can use a gunicorn with gunicorn main:app

Go to http://127.0.0.1:5000/ and check it out (use port 8000 if you used gunicorn).

Deploy

We use Heroku, which makes it as simple as:

git push -f https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master

where you've made a Heroku account and set the HEROKU_API_KEY and HEROKU_APP_NAME environment variables beforehand.

You can test things out locally with:

heroku local web

Accessibility

Just like the backend to this site, we use pa11y to smoke test our site's accessibility. You can run these tests yourself downloading the pa11y or pa11y-ci tools and then starting the app with flask run to give yourself a live endpoint to test. Our configuration file for the a11y tests is located at .pa11yci.

If you notice any issues that aren't caught by these automated tests, please let us know by opening an issue.

Contributing

If you'd like to contribute, hop on over to our contributing docs.

If you've got questions, open an issue.

LICENSE

GNU General Public License. See it here.

About

Automated accessibility testing of U.S. Federal Government websites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published