GithubHelp home page GithubHelp logo

csmcallister / fed-a11y Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 135 KB

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

Dockerfile 0.75% Python 22.94% JavaScript 23.59% CSS 6.53% HTML 46.15% Procfile 0.03%

fed-a11y's Introduction

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.

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.