{"id":18376962,"url":"https://github.com/bbc/a11y-tests-web","last_synced_at":"2025-04-06T20:31:54.296Z","repository":{"id":42432784,"uuid":"80220016","full_name":"bbc/a11y-tests-web","owner":"bbc","description":"Runs automated accessibility tests against configurable lists of webpages","archived":false,"fork":false,"pushed_at":"2025-02-19T14:47:13.000Z","size":1035,"stargazers_count":32,"open_issues_count":5,"forks_count":8,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-03-22T06:51:17.850Z","etag":null,"topics":["accessibility","automated-testing","bbc","iplayer-web","lighthouse"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-27T15:39:31.000Z","updated_at":"2025-02-16T09:08:47.000Z","dependencies_parsed_at":"2024-11-06T00:27:51.656Z","dependency_job_id":"5545d8e7-19a6-487e-8381-e70fe4dd3603","html_url":"https://github.com/bbc/a11y-tests-web","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fa11y-tests-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fa11y-tests-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fa11y-tests-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fa11y-tests-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/a11y-tests-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547734,"owners_count":20956607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility","automated-testing","bbc","iplayer-web","lighthouse"],"created_at":"2024-11-06T00:25:42.558Z","updated_at":"2025-04-06T20:31:53.939Z","avatar_url":"https://github.com/bbc.png","language":"JavaScript","readme":"# a11y-tests-web\n\n![Build Status](https://github.com/bbc/a11y-tests-web/workflows/Node.js%20CI/badge.svg)\n\nUses [bbc-a11y](https://github.com/bbc/bbc-a11y) and [Google Lighthouse](https://developers.google.com/web/tools/lighthouse/) to run a suite of automated tests to test accessibility across a set of webpages, defined in a config file.\n\n## Requirements\n- Node v10 or above\n- libgconf-2-4\n- Docker (if using the `ci` option) - NB The docker image is not always necessary to use bbc-a11y for continuous integration. For example, in TravisCI one option available is to prepend the run script with xvfb-run - [relevant TravisCI documentation](https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI). Furthermore, an alternative to using the docker image in Jenkins might be to use the [xvfb plugin](https://wiki.jenkins.io/display/JENKINS/Xvfb+Plugin) - though this is untested.\n\n## Running anywhere from the command-line\nThis package can be run anywhere from the command-line, making it easy to integrate with your existing projects. Here's how:\n\n1. Install the package globally: `npm install @bbc/a11y-tests-web --global`\n2. Run the command anywhere from your command-line, e.g. `A11Y_CONFIG=iplayer-web/all a11y-tests-web lighthouse -m junit-headless`\n\nYou could also make it part of your application's scripts. Here's how:\n1. Add the package to your application's dev dependencies: `npm install @bbc/a11y-tests-web --save-dev`\n2. Add a line to your application's scripts e.g. `\"test:a11y\": \"A11Y_CONFIG=iplayer-web/app-playback-test a11y-tests-web bbc-a11y -m interactive\"`\n\nYou can find out more about using the CLI option by running `a11y-tests-web --help`.\n\n## Usage as an independent package\n\n### Installation of dependencies\n\n```\nnpm install\n```\n\n### Run bbc-a11y using a config, e.g. iplayer-web/all\n\nTo run bbc-a11y in interactive mode:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:bbc-a11y\n```\n\nThis will generate the commands for bbc-a11y and then run the tests against the pages listed in the iplayer-web/all config file in the config directory.\n\n### Run bbc-a11y in headless mode\n\nTo run bbc-a11y in headless mode:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:bbc-a11y:headless\n```\n\n### Run bbc-a11y and generate a JUnit report\n\nTo generate a JUnit report, you can tell bbc-a11y to use the JUnit reporter:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:bbc-a11y:junit\n```\n\n### Run bbc-a11y and generate a JUnit report in headless mode\n\nTo generate a JUnit report in headless mode:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:bbc-a11y:junit-headless\n```\n\n### Run bbc-a11y and generate a JUnit report using Docker\n\nIf you don't have all the necessary libraries on your system required to run Electron, for example if you want to run this on a CI server, or if you want the process to always exit successfully, you can run this command to run them inside a Docker container and exit with success:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:bbc-a11y:ci\n```\n\nNote that Docker obviously needs to be running and you can ignore any messages about XLib and libudev.\n\n### Run Google Lighthouse and generate a JUnit report using a config, e.g. iplayer-web/all\n\nTo run Google Lighthouse and generate a JUnit report:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:lighthouse:junit\n```\n\nThis will run the Google Lighthouse accessibility audit against the URLs defined in the iplayer-web/all config file, and generate a JUnit report called lighthouse-report.xml.\n\nIf you'd like a more human readable report, you can simply use Google Chrome to run the audit, by opening dev tools and going to Audits.\n\n### Run Google Lighthouse in headless mode and generate a JUnit report\n\nTo run Google Lighthouse in headless mode and generate a JUnit report:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:lighthouse:junit-headless\n```\n\n### Run Google Lighthouse in headless mode and print results to console\n\nTo run Google Lighthouse in headless mode and generate human-readable output to console:\n\n```\nA11Y_CONFIG=iplayer-web/all npm run start:lighthouse:headless\n```\n\n### Run Google Lighthouse with verbose logging enabled\n\nTo run Google Lighthouse in headless mode and enable verbose logging to console for Lighthouse:\n\n```\nA11Y_CONFIG=iplayer-web/all A11Y_LOGGING_LEVEL=verbose npm run start:lighthouse:headless\n```\n\n## Running on Jenkins\n\nIf you'd like to run this on your Jenkins server, ensure your Jenkins meets the requirements above and has a [JUnit plugin](https://plugins.jenkins.io/junit) installed and then:\n- Create a Jenkins job\n- Add this repo to the Jenkins job\n- Get the job to run `npm i --production`\n- Get the job to run the `start:bbc-a11y:ci` command for bbc-a11y or `start:lighthouse:junit-headless` for Lighthouse, with your `A11Y_CONFIG`\n- Add a post-build action to \"Publish JUnit test results report\" (or such like). The bbc-a11y XML file is called \"bbc-a11y-report.xml\" and the Lighthouse XML file is called \"lighthouse-report.xml\".\n\n## Creating a config\n\nIf your product/team does not already have a folder, create one in `config`.\nYou then need to create a new file in this folder which should either be a JSON file or a JS file that exports an object.\n\nThe data should include:\n- `options` - Object - Options as defined by bbc-a11y, e.g. hide, skip and visit. Note that skip and visit are currently **ignored** by Google Lighthouse, but hide is used.\n- `baseUrl` - String - The domain to run the tests against, e.g. \"https://www.bbc.co.uk\"\n- `paths` - Array - The paths on that domain to run the tests against\n- `signedInPaths` - Array - An optional list of paths to run the tests against, after signing in to BBC ID.\n\nNote that if you have a list of `signedInPaths`, the username and password to use when logging in to BBC ID should be specified using the environment variables A11Y_USERNAME and A11Y_PASSWORD.\n\n## Contributing\nSee [CONTRIBUTING.md](https://github.com/bbc/a11y-tests-web/blob/master/CONTRIBUTING.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fa11y-tests-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fa11y-tests-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fa11y-tests-web/lists"}