diff --git a/.github/workflows/regression-test-pa11y.yml b/.github/workflows/regression-test-pa11y.yml new file mode 100644 index 00000000..5f5b0192 --- /dev/null +++ b/.github/workflows/regression-test-pa11y.yml @@ -0,0 +1,32 @@ +name: "Regression Test - Accessibility (Pa11y) Test" +on: + push: + paths-ignore: + - '**.md' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + if: ${{ success() }} + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - name: Setup dependencies using pip + run: pip install -r requirements.txt + if: ${{ success() }} + - name: Setup node + uses: actions/setup-node@v2 + - name: Setup Pa11y CI npm package + run: npm install -g pa11y-ci + - name: Setup config (using SAMPLE-config.py as config.py) + run: python .github/workflows/verify_result.py -c false + if: ${{ success() }} + - name: Accessibility (Pa11y) + run: | + python default.py -t 18 -r -u https://webperf.se/ -o .github/workflows/testresult-18.json + python .github/workflows/verify_result.py -t 18 + if: ${{ success() }} \ No newline at end of file diff --git a/README.md b/README.md index a34ad682..27ce80ae 100644 --- a/README.md +++ b/README.md @@ -35,17 +35,18 @@ but you can run this project in many ways and what you choose depends on your ne Add a interesting ingress here. [Read more about our tests](./docs/tests/README.md) or go directly to a specific test below. -* [Accessibility](./docs/tests/google-lighthouse-a11y.md) -* [Website performance](./docs/tests/google-lighthouse-performance.md) -* [Best practice on Web](./docs/tests/google-lighthouse-best-practice.md) -* [Progressive web apps](./docs/tests/google-lighthouse-pwa.md) -* [SEO best practise](./docs/tests/google-lighthouse-seo.md) +* [Accessibility (Pa11y)](./docs/tests/pa11y.md) +* [Accessibility (Lighthouse)](./docs/tests/google-lighthouse-a11y.md) +* [Website performance (SiteSpeed)](./docs/tests/sitespeed.md) +* [Website performance (Lighthouse)](./docs/tests/google-lighthouse-performance.md) +* [Best practice on Web (Lighthouse)](./docs/tests/google-lighthouse-best-practice.md) +* [Progressive web apps (Lighthouse)](./docs/tests/google-lighthouse-pwa.md) +* [SEO best practise (Lighthouse)](./docs/tests/google-lighthouse-seo.md) * [Validate 404 page (by default checks for Swedish text, though)](./docs/tests/page-not-found.md) -* [Validate HTML](./docs/tests/html.md) -* [Validate CSS](./docs/tests/css.md) -* [Security, data-protecting & Integrity](./docs/tests/webbkoll.md) -* [Frontend quality](./docs/tests/yellowlab.md) -* [Website performance](./docs/tests/sitespeed.md) +* [Validate HTML (W3C)](./docs/tests/html.md) +* [Validate CSS (W3C)](./docs/tests/css.md) +* [Security, data-protecting & Integrity (Webbkoll)](./docs/tests/webbkoll.md) +* [Frontend quality (YellowLab Tools)](./docs/tests/yellowlab.md) * [Energy Efficiency](./docs/tests/energy-efficiency.md) * [Standard files](./docs/tests/standard.md) * [HTTP and Network](./docs/tests/http.md) diff --git a/default.py b/default.py index d0e55b28..d3fdbe5b 100644 --- a/default.py +++ b/default.py @@ -9,7 +9,7 @@ def validate_test_type(test_type): - if test_type != utils.TEST_HTML and test_type != utils.TEST_PAGE_NOT_FOUND and test_type != utils.TEST_CSS and test_type != utils.TEST_WEBBKOLL and test_type != utils.TEST_GOOGLE_LIGHTHOUSE and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_PWA and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_A11Y and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_SEO and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_BEST_PRACTICE and test_type != utils.TEST_STANDARD_FILES and test_type != utils.TEST_YELLOW_LAB_TOOLS and test_type != utils.TEST_HTTP and test_type != utils.TEST_ENERGY_EFFICIENCY and test_type != utils.TEST_TRACKING and test_type != utils.TEST_SITESPEED: + if test_type != utils.TEST_HTML and test_type != utils.TEST_PAGE_NOT_FOUND and test_type != utils.TEST_CSS and test_type != utils.TEST_WEBBKOLL and test_type != utils.TEST_GOOGLE_LIGHTHOUSE and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_PWA and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_A11Y and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_SEO and test_type != utils.TEST_GOOGLE_LIGHTHOUSE_BEST_PRACTICE and test_type != utils.TEST_STANDARD_FILES and test_type != utils.TEST_YELLOW_LAB_TOOLS and test_type != utils.TEST_PA11Y and test_type != utils.TEST_HTTP and test_type != utils.TEST_ENERGY_EFFICIENCY and test_type != utils.TEST_TRACKING and test_type != utils.TEST_SITESPEED: print(_('TEXT_TEST_VALID_ARGUMENTS')) print(_('TEXT_TEST_VALID_ARGUMENTS_GOOGLE_LIGHTHOUSE')) print(_('TEXT_TEST_VALID_ARGUMENTS_PAGE_NOT_FOUND')) @@ -22,6 +22,7 @@ def validate_test_type(test_type): print(_('TEXT_TEST_VALID_ARGUMENTS_GOOGLE_LIGHTHOUSE_A11Y')) print(_('TEXT_TEST_VALID_ARGUMENTS_SITESPEED')) print(_('TEXT_TEST_VALID_ARGUMENTS_YELLOW_LAB_TOOLS')) + print(_('TEXT_TEST_VALID_ARGUMENTS_PA11Y')) print(_('TEXT_TEST_VALID_ARGUMENTS_WEBBKOLL')) print(_('TEXT_TEST_VALID_ARGUMENTS_HTTP')) print(_('TEXT_TEST_VALID_ARGUMENTS_ENERGY_EFFICIENCY')) diff --git a/docs/tests/README.md b/docs/tests/README.md index 701fb7d8..d85687c2 100644 --- a/docs/tests/README.md +++ b/docs/tests/README.md @@ -3,21 +3,23 @@ Add a small ingress here ## List of Tests -* [Google Lighthouse accessibility with Axe](google-lighthouse-a11y.md) -* [Google Lighthouse performance](google-lighthouse-performance.md) -* [Google Lighthouse best practice](google-lighthouse-best-practice.md) -* [Google Lighthouse progressive web apps](google-lighthouse-pwa.md) -* [Google Lighthouse SEO](google-lighthouse-seo.md) -* [Testing the 404 page and status code (by default checks for Swedish text, though)](page-not-found.md) -* [Validating the HTML code against W3C](html.md) -* [Validating the CSS code against W3C](css.md) -* [Users’ integrity test against Webbkoll, provided by Dataskydd.net](webbkoll.md) -* [Frontend quality against Yellow Lab Tools](yellowlab.md) -* [Website performance with Sitespeed.io](sitespeed.md) -* [Energy efficiency](energy-efficiency.md) -* [Standard files (checks for robots.txt, security.txt and more)](standard.md) -* [HTTP and Network test (checks HTTP version, TLS version and more)](http.md) -* [Tracking & Integrity test (checks GDPR compliance, tracking and more)](tracking.md) +* [Accessibility (Pa11y)](pa11y.md) +* [Accessibility (Lighthouse)](google-lighthouse-a11y.md) +* [Website performance (SiteSpeed)](sitespeed.md) +* [Website performance (Lighthouse)](google-lighthouse-performance.md) +* [Best practice on Web (Lighthouse)](google-lighthouse-best-practice.md) +* [Progressive web apps (Lighthouse)](google-lighthouse-pwa.md) +* [SEO best practise (Lighthouse)](google-lighthouse-seo.md) +* [Validate 404 page (by default checks for Swedish text, though)](page-not-found.md) +* [Validate HTML (W3C)](html.md) +* [Validate CSS (W3C)](css.md) +* [Security, data-protecting & Integrity (Webbkoll)](webbkoll.md) +* [Frontend quality (YellowLab Tools)](yellowlab.md) +* [Energy Efficiency](energy-efficiency.md) +* [Standard files](standard.md) +* [HTTP and Network](http.md) +* [Tracking & Integrity](tracking.md) + ## Code Quality diff --git a/docs/tests/pa11y.md b/docs/tests/pa11y.md new file mode 100644 index 00000000..23eabea9 --- /dev/null +++ b/docs/tests/pa11y.md @@ -0,0 +1,47 @@ +# Accessibility (Pa11y) +[![Regression Test - Accessibility (Pa11y) Test](https://github.com/Webperf-se/webperf_core/actions/workflows/regression-test-pa11y.yml/badge.svg)](https://github.com/Webperf-se/webperf_core/actions/workflows/regression-test-pa11y.yml) + +Add small description of what this test is. + +## What is being tested? + +It test accessibility on the specified url. +Please note that automated accessibility test generally only find 20-30% of all errors. +Even if this test is not finding anything you should still do a manuall check once in a while. + +## How are rating being calculated? + +We are rating the url based on: +- If Pa11y finds 0 errors you get 5.0 in rating +- If Pa11y finds just 1 error you get 4.0 in rating +- If Pa11y finds 2-3 errors you get 3.0 in rating +- If Pa11y finds 4-7 errors you get 2.0 in rating +- Else you will get 1.0 in rating + +## Read more + +* https://github.com/pa11y/pa11y-ci +* https://github.com/pa11y/pa11y + +## How to setup? + +This section has not been written yet. + +### Prerequirements + +* Fork this repository + +### Setup with GitHub Actions + +Read more on the [general page for github actions](../getting-started-github-actions.md). + +### Setup Locally + +* Follow [general local setup steps for this repository](../getting-started-local.md) +* Download and install Node.js +* Install Pa11y CI npm package ( `npm install -g pa11y-ci` ) + +## FAQ + +No frequently asked questions yet :) + diff --git a/locales/en/LC_MESSAGES/a11y_pa11y.mo b/locales/en/LC_MESSAGES/a11y_pa11y.mo index eb1974c6..9b2eea5a 100644 Binary files a/locales/en/LC_MESSAGES/a11y_pa11y.mo and b/locales/en/LC_MESSAGES/a11y_pa11y.mo differ diff --git a/locales/en/LC_MESSAGES/a11y_pa11y.po b/locales/en/LC_MESSAGES/a11y_pa11y.po index ddcb6212..4c01b4d7 100644 --- a/locales/en/LC_MESSAGES/a11y_pa11y.po +++ b/locales/en/LC_MESSAGES/a11y_pa11y.po @@ -1,13 +1,13 @@ # English -# Copyright (C) 2020 WebPerf +# Copyright (C) 2022 WebPerf # FIRST AUTHOR , 2020. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2020-12-12 10:45+0200\n" -"PO-Revision-Date: 2021-06-21 17:15+0200\n" -"Last-Translator: Marcus \n" +"PO-Revision-Date: 2022-02-18 17:15+0200\n" +"Last-Translator: Mattias \n" "Language-Team: English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,19 +18,25 @@ msgid "TEXT_RUNNING_TEST" msgstr "## Test: 18 - Accessibility (Pa11y)\n" msgid "TEXT_REVIEW_A11Y_VERY_GOOD" -msgstr "- The website do not have any apparent issues with accessibility!!\n" +msgstr "- The website do not have any apparent issues with accessibility!!" msgid "TEXT_REVIEW_A11Y_IS_GOOD" -msgstr "- The website can be more accessible, but is rather good!\n" +msgstr "- The website can be more accessible, but is rather good!" msgid "TEXT_REVIEW_A11Y_IS_OK" -msgstr "- The accessibility is about average, but needs to get better.\n" +msgstr "- The accessibility is about average, but needs to get better." msgid "TEXT_REVIEW_A11Y_IS_BAD" -msgstr "- The website is quite bad at accessibility and sucks for disabled people!\n" +msgstr "- The website is quite bad at accessibility and sucks for disabled people!" msgid "TEXT_REVIEW_A11Y_IS_VERY_BAD" -msgstr "- The accessibility is apparently really bad! Probably both for disabled people and everyone of us when we need some accessibility!\n" +msgstr "- The accessibility is apparently really bad! Probably both for disabled people and everyone of us when we need some accessibility!" msgid "TEXT_REVIEW_A11Y_NUMBER_OF_PROBLEMS" -msgstr "- Number of problems with accessibility: {}\n" \ No newline at end of file +msgstr "- Number of problems with accessibility: {}" + +msgid "TEXT_REVIEW_A11Y_TOO_MANY_PROBLEMS" +msgstr "- Info: Too many unique problems to show them all.\n" + +msgid "TEXT_REVIEW_A11Y_PROBLEMS" +msgstr "\nProblems:\n" \ No newline at end of file diff --git a/locales/en/LC_MESSAGES/webperf-core.mo b/locales/en/LC_MESSAGES/webperf-core.mo index cb41b5d7..6380380b 100644 Binary files a/locales/en/LC_MESSAGES/webperf-core.mo and b/locales/en/LC_MESSAGES/webperf-core.mo differ diff --git a/locales/en/LC_MESSAGES/webperf-core.po b/locales/en/LC_MESSAGES/webperf-core.po index 8b98d9e2..d7abad52 100644 --- a/locales/en/LC_MESSAGES/webperf-core.po +++ b/locales/en/LC_MESSAGES/webperf-core.po @@ -81,6 +81,9 @@ msgstr "-t 5\t: Best Practice (Google Lighthouse)" msgid "TEXT_TEST_VALID_ARGUMENTS_YELLOW_LAB_TOOLS" msgstr "-t 17\t: Quality on frontend (Yellow Lab Tools)" +msgid "TEXT_TEST_VALID_ARGUMENTS_PA11Y" +msgstr "-t 18\t: Accessibility (Pa11y)" + #: default.py:133 msgid "TEXT_TEST_VALID_ARGUMENTS_PAGE_NOT_FOUND" msgstr "-t 2\t: 404 (Page not Found)" diff --git a/locales/sv/LC_MESSAGES/a11y_pa11y.mo b/locales/sv/LC_MESSAGES/a11y_pa11y.mo index 12397795..0bfedb8c 100644 Binary files a/locales/sv/LC_MESSAGES/a11y_pa11y.mo and b/locales/sv/LC_MESSAGES/a11y_pa11y.mo differ diff --git a/locales/sv/LC_MESSAGES/a11y_pa11y.po b/locales/sv/LC_MESSAGES/a11y_pa11y.po index 64c3bb58..0f6bd2af 100644 --- a/locales/sv/LC_MESSAGES/a11y_pa11y.po +++ b/locales/sv/LC_MESSAGES/a11y_pa11y.po @@ -1,13 +1,13 @@ # Swedish -# Copyright (C) 2020 WebPerf +# Copyright (C) 2022 WebPerf # FIRST AUTHOR , 2020. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2020-12-12 10:45+0200\n" -"PO-Revision-Date: 2021-06-21 17:15+0200\n" -"Last-Translator: Marcus \n" +"PO-Revision-Date: 2022-02-18 17:15+0200\n" +"Last-Translator: Mattias \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,19 +18,25 @@ msgid "TEXT_RUNNING_TEST" msgstr "## Test: 18 - Tillgänglighet (Pa11y)\n" msgid "TEXT_REVIEW_A11Y_VERY_GOOD" -msgstr "- Webbplatsen har inga uppenbara fel inom tillgänglighet! Bra, men gör manuella undersökningar för säkerhets skull!\n" +msgstr "- Webbplatsen har inga uppenbara fel inom tillgänglighet! Bra, men gör manuella undersökningar för säkerhets skull!" msgid "TEXT_REVIEW_A11Y_IS_GOOD" -msgstr "- Webbplatsen kan bli mer tillgänglig, men är ganska ok.\n" +msgstr "- Webbplatsen kan bli mer tillgänglig, men är ganska ok." msgid "TEXT_REVIEW_A11Y_IS_OK" -msgstr "- Genomsnittlig tillgänglighet men och bli bättre gentemot automatiska tester.\n" +msgstr "- Genomsnittlig tillgänglighet men och bli bättre gentemot automatiska tester." msgid "TEXT_REVIEW_A11Y_IS_BAD" -msgstr "- Webbplatsen är dålig på tillgänglighet för funktions­nedsatta personer.\n" +msgstr "- Webbplatsen är dålig på tillgänglighet för funktions­nedsatta personer." msgid "TEXT_REVIEW_A11Y_IS_VERY_BAD" -msgstr "- Väldigt dålig tillgänglighet!\n" +msgstr "- Väldigt dålig tillgänglighet!" msgid "TEXT_REVIEW_A11Y_NUMBER_OF_PROBLEMS" -msgstr "- Antal tillgänglighets­problem: {} st\n" \ No newline at end of file +msgstr "- Antal tillgänglighets­problem: {} st" + +msgid "TEXT_REVIEW_A11Y_TOO_MANY_PROBLEMS" +msgstr "- Info: För många unika problem för att lista alla.\n" + +msgid "TEXT_REVIEW_A11Y_PROBLEMS" +msgstr "\nProblem:\n" \ No newline at end of file diff --git a/locales/sv/LC_MESSAGES/webperf-core.mo b/locales/sv/LC_MESSAGES/webperf-core.mo index 6bc5fd18..875032d3 100644 Binary files a/locales/sv/LC_MESSAGES/webperf-core.mo and b/locales/sv/LC_MESSAGES/webperf-core.mo differ diff --git a/locales/sv/LC_MESSAGES/webperf-core.po b/locales/sv/LC_MESSAGES/webperf-core.po index 49be9bde..4120938b 100644 --- a/locales/sv/LC_MESSAGES/webperf-core.po +++ b/locales/sv/LC_MESSAGES/webperf-core.po @@ -72,6 +72,9 @@ msgstr "-t 5\t: God praxis (Google Lighthouse)" msgid "TEXT_TEST_VALID_ARGUMENTS_YELLOW_LAB_TOOLS" msgstr "-t 17\t: Kvalitet på frontend (Yellow Lab Tools)" +msgid "TEXT_TEST_VALID_ARGUMENTS_PA11Y" +msgstr "-t 18\t: Tillgänglighet (Pa11y)" + msgid "TEXT_TEST_VALID_ARGUMENTS_PAGE_NOT_FOUND" msgstr "-t 2\t: 404 (sida finns inte)" diff --git a/tests/a11y_pa11y.py b/tests/a11y_pa11y.py index 831ad136..a70ad6b4 100644 --- a/tests/a11y_pa11y.py +++ b/tests/a11y_pa11y.py @@ -1,75 +1,114 @@ # -*- coding: utf-8 -*- -#from urllib.parse import urlparse # https://docs.python.org/3/library/urllib.parse.html import subprocess +import datetime import json from models import Rating +import config +import gettext +_ = gettext.gettext + +review_show_improvements_only = config.review_show_improvements_only + def run_test(_, langCode, url): - """ - - """ - - print(langCode, url) - - result = subprocess.run(['pa11y', '--reporter', 'json', url[0][1]], stdout=subprocess.PIPE) - - mod_results = result.stdout.decode("utf-8") - result_list = json.loads(mod_results) - num_errors = len(result_list) - return_dict = {} - - points = 0 - review_overall = '' - review = '' - - if num_errors == 0: - points = 5 - review_overall = '* Webbplatsen har inga uppenbara fel kring tillgänglighet!\n' - elif num_errors == 1: - points = 4 - review_overall = '* Webbplatsen kan bli mer tillgänglig, men är helt ok.\n' - elif num_errors > 8: - points = 1 - review_overall = '* Väldigt dålig tillgänglighet!\n' - elif num_errors >= 4: - points = 2 - review_overall = '* Dålig tillgänglighet.\n' - elif num_errors >= 2: - points = 3 - review_overall = '* Genomsnittlig tillgänglighet men kan bli bättre.\n' - - review += '* Antal tillgänglighetsproblem: {} st\n'.format(num_errors) - return_dict['antal_problem'] = num_errors - - if num_errors > 0: - review += '\nProblem:\n' - - i = 1 - old_error = '' - - for error in result_list: - err_mess = error.get('message').replace('This', 'A') - if err_mess != old_error: - old_error = err_mess - review += '* {0}\n'.format(err_mess) - key = error.get('code') #'{0}-{1}'.format(error.get('code'), i) - return_dict.update( { key : err_mess } ) - - i += 1 - - if i > 10: - review += '* Info: För många unika problem för att lista alla\n' - break - - rating = Rating(_) - rating.set_overall(points, review_overall) - rating.set_a11y(points, review) - - print(points, review, return_dict) - return (rating, return_dict) + """ + + """ + + language = gettext.translation( + 'a11y_pa11y', localedir='locales', languages=[langCode]) + language.install() + _local = language.gettext + + print(_local('TEXT_RUNNING_TEST')) + + print(_('TEXT_TEST_START').format( + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) + + bashCommand = "pa11y-ci --reporter json {0}".format(url) + process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE) + output, error = process.communicate() + + json_result = json.loads(output) + + result_list = list() + if 'results' in json_result: + result_list = json_result['results'] + + num_errors = 0 + + if 'errors' in json_result: + num_errors = json_result['errors'] + + return_dict = {} + + points = 0 + review_overall = '' + review_a11y = '' + review = '' + + if num_errors == 0: + points = 5 + review_overall = _local('TEXT_REVIEW_A11Y_VERY_GOOD') + elif num_errors == 1: + points = 4 + review_overall = _local('TEXT_REVIEW_A11Y_IS_GOOD') + elif num_errors > 8: + points = 1 + review_overall = _local('TEXT_REVIEW_A11Y_IS_VERY_BAD') + elif num_errors >= 4: + points = 2 + review_overall = _local('TEXT_REVIEW_A11Y_IS_BAD') + elif num_errors >= 2: + points = 3 + review_overall = _local('TEXT_REVIEW_A11Y_IS_OK') + + review_a11y = _local( + 'TEXT_REVIEW_A11Y_NUMBER_OF_PROBLEMS').format(num_errors) + return_dict['antal_problem'] = num_errors + + unique_errors = set() + + errors = list() + if url in result_list: + errors = result_list[url] + + for error in errors: + if 'message' in error: + err_mess = error['message'].replace('This', 'A') + error_review = '- {0}\n'.format(err_mess) + unique_errors.add(error_review) + if 'code' in error: + # '{0}-{1}'.format(error.get('code'), i) + key = error['code'] + return_dict.update({key: err_mess}) + + i = 1 + + if len(unique_errors) > 0: + review += _local('TEXT_REVIEW_A11Y_PROBLEMS') + + for error in unique_errors: + review += error + i += 1 + if i > 10: + review += _local('TEXT_REVIEW_A11Y_TOO_MANY_PROBLEMS') + break + + rating = Rating(_, review_show_improvements_only) + rating.set_overall(points, review_overall) + rating.set_a11y(points, review_a11y) + + rating.a11y_review = rating.a11y_review + review + + print(_('TEXT_TEST_END').format( + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) + + return (rating, return_dict) + """ If file is executed on itself then call a definition, mostly for testing purposes """ if __name__ == '__main__': - print(run_test('sv', 'https://webperf.se')) \ No newline at end of file + print(run_test('sv', 'https://webperf.se')) diff --git a/utils.py b/utils.py index 4e9229f6..77a31e59 100644 --- a/utils.py +++ b/utils.py @@ -9,7 +9,7 @@ TEST_ALL = -1 (TEST_UNKNOWN_01, TEST_GOOGLE_LIGHTHOUSE, TEST_PAGE_NOT_FOUND, TEST_UNKNOWN_03, TEST_GOOGLE_LIGHTHOUSE_SEO, TEST_GOOGLE_LIGHTHOUSE_BEST_PRACTICE, TEST_HTML, TEST_CSS, TEST_GOOGLE_LIGHTHOUSE_PWA, TEST_STANDARD_FILES, - TEST_GOOGLE_LIGHTHOUSE_A11Y, TEST_UNKNOWN_11, TEST_UNKNOWN_12, TEST_UNKNOWN_13, TEST_UNKNOWN_14, TEST_SITESPEED, TEST_UNKNOWN_16, TEST_YELLOW_LAB_TOOLS, TEST_UNKNOWN_18, TEST_UNKNOWN_19, TEST_WEBBKOLL, TEST_HTTP, TEST_ENERGY_EFFICIENCY, TEST_TRACKING) = range(24) + TEST_GOOGLE_LIGHTHOUSE_A11Y, TEST_UNKNOWN_11, TEST_UNKNOWN_12, TEST_UNKNOWN_13, TEST_UNKNOWN_14, TEST_SITESPEED, TEST_UNKNOWN_16, TEST_YELLOW_LAB_TOOLS, TEST_PA11Y, TEST_UNKNOWN_19, TEST_WEBBKOLL, TEST_HTTP, TEST_ENERGY_EFFICIENCY, TEST_TRACKING) = range(24) def test(_, langCode, site, test_type=None, show_reviews=False,): @@ -47,6 +47,8 @@ def test(_, langCode, site, test_type=None, show_reviews=False,): from tests.performance_sitespeed_io import run_test elif test_type == TEST_YELLOW_LAB_TOOLS: from tests.frontend_quality_yellow_lab_tools import run_test + elif test_type == TEST_PA11Y: + from tests.a11y_pa11y import run_test elif test_type == TEST_HTTP: from tests.http_validator import run_test elif test_type == TEST_ENERGY_EFFICIENCY: @@ -128,6 +130,9 @@ def test_site(_, langCode, site, test_type=TEST_ALL, show_reviews=False): if (run_all_tests or test_type == TEST_YELLOW_LAB_TOOLS): tests.extend(test(_, langCode, site, test_type=TEST_YELLOW_LAB_TOOLS, show_reviews=show_reviews)) + if (run_all_tests or test_type == TEST_PA11Y): + tests.extend(test(_, + langCode, site, test_type=TEST_PA11Y, show_reviews=show_reviews)) if (run_all_tests or test_type == TEST_WEBBKOLL): tests.extend(test(_, langCode, site, test_type=TEST_WEBBKOLL, show_reviews=show_reviews))