From 95d12b1876a0192f3349e1182e376398d6ddc918 Mon Sep 17 00:00:00 2001 From: Liliia Pelypenko Date: Wed, 14 Oct 2020 18:44:12 +0900 Subject: [PATCH] Add axe-result-pretty-print --- README.md | 94 ++++++++++++++++++++++++++++++- package-lock.json | 60 ++++++++++++++++++++ package.json | 3 +- testcafe/testNoTypeScript.js | 7 +++ testcafe/testTypeScriptExample.ts | 7 +++ 5 files changed, 168 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cd1a6b2..1fa5937 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,113 @@ TestCafe framework specific wrapper: Helper to create HTML report from aXe violations, passes, incomplete and incompatible results: [axe-html-reporter](https://www.npmjs.com/package/axe-html-reporter) +Helper to provide prity console output for the axe results: +[axe-result-pretty-print](https://www.npmjs.com/package/axe-result-pretty-print) + # How to use Install packages and run the tests `npm install && npm test` ```shell script -$ npx testcafe +$ npm run test + +> axe-testcafe-demo@1.0.0 test /gitlab/axe-testcafe-demo +> testcafe chrome:headless testcafe/** && open ./artifacts/accessibilityReport.html + +The "src", "browsers" options from the configuration file will be ignored. Running tests in: - - Chrome xxx.xx.xxx / Linix + - Chrome xx.xx / OS xxx TestCafe tests with Axe +Axe core library found 9 violations for the www.example.com +┌─────────┬───────────────────────────────────────────────────────────────────┬─────────────────────┬────────────────────┬────────────┬───────┐ +│ (index) │ description │ id │ wcag │ impact │ nodes │ +├─────────┼───────────────────────────────────────────────────────────────────┼─────────────────────┼────────────────────┼────────────┼───────┤ +│ 0 │ 'Ensures role attribute has an appropriate value for the element' │ 'aria-allowed-role' │ 'Best practice' │ 'minor' │ 1 │ +│ 1 │ 'Ensures the order of headings is semantically correct' │ 'heading-order' │ 'Best practice' │ 'moderate' │ 1 │ +│ 2 │ 'Ensures every form element has a label' │ 'label' │ 'WCAG 2.0 Level A' │ 'critical' │ 1 │ +│ 3 │ 'Ensures all page content is contained by landmarks' │ 'region' │ 'Best practice' │ 'moderate' │ 6 │ +└─────────┴───────────────────────────────────────────────────────────────────┴─────────────────────┴────────────────────┴────────────┴───────┘ +1. id: 'aria-allowed-role' learn more: https://dequeuniversity.com/rules/axe/3.5/aria-allowed-role?application=axeAPI + name: ARIA role must be appropriate for the element + description: Ensures role attribute has an appropriate value for the element + WCAG: 'Best practice' + Affected elements: + Selector: "#toggle" Source code: + +2. id: 'heading-order' learn more: https://dequeuniversity.com/rules/axe/3.5/heading-order?application=axeAPI + name: Heading levels should only increase by one + description: Ensures the order of headings is semantically correct + WCAG: 'Best practice' + Affected elements: + Selector: "h4" Source code:

Latest from the Blog

+ +3. id: 'label' learn more: https://dequeuniversity.com/rules/axe/3.5/label?application=axeAPI + name: Form elements must have labels + description: Ensures every form element has a label + WCAG: 'WCAG 2.0 Level A' + Affected elements: + Selector: "#toggle" Source code: + +4. id: 'region' learn more: https://dequeuniversity.com/rules/axe/3.5/region?application=axeAPI + name: All page content must be contained by landmarks + description: Ensures all page content is contained by landmarks + WCAG: 'Best practice' + Affected elements: + Selector: ".marketing-bar-text" Source code:
Create your website at WordPress.com
+ Selector: ".marketing-bar-button" Source code: Get started + Selector: ".widget" Source code: