diff --git a/docs/index.html b/docs/index.html index 3233680..b0300d2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,8 +59,8 @@

AXE Accessibility Results for DEQUE project

- Page URL: + + Page URL: http://example.com/
Test Case: Full page analysis @@ -1013,536 +1013,535 @@
- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +
#Rule IDEnabled
#Rule IDEnabled
1object-alttrue
1object-alttrue
2role-img-alttrue
2role-img-alttrue
3input-image-alttrue
3input-image-alttrue
4image-alttrue
4image-alttrue
5svg-img-alttrue
5svg-img-alttrue
6area-alttrue
6area-alttrue
7audio-captiontrue
7audio-captiontrue
8video-captiontrue
8video-captiontrue
9definition-listtrue
9definition-listtrue
10dlitemtrue
10dlitemtrue
11listitemtrue
11listitemtrue
12listtrue
12listtrue
13th-has-data-cellstrue
13th-has-data-cellstrue
14td-headers-attrtrue
14td-headers-attrtrue
15td-has-headertrue
15td-has-headertrue
16p-as-headingtrue
16p-as-headingtrue
17aria-required-parenttrue
17aria-required-parenttrue
18aria-required-childrentrue
18aria-required-childrentrue
19table-fake-captiontrue
19table-fake-captiontrue
20css-orientation-lockfalse
20css-orientation-lockfalse
21autocomplete-validtrue
21autocomplete-validtrue
22link-in-text-blocktrue
22link-in-text-blocktrue
23no-autoplay-audiotrue
23no-autoplay-audiotrue
24color-contrasttrue
24color-contrasttrue
25meta-viewporttrue
25meta-viewporttrue
26avoid-inline-spacingtrue
26avoid-inline-spacingtrue
27server-side-image-maptrue
27server-side-image-maptrue
28meta-refreshtrue
28meta-refreshtrue
29blinktrue
29blinktrue
30marqueetrue
30marqueetrue
31bypasstrue
31bypasstrue
32frame-titletrue
32frame-titletrue
33document-titletrue
33document-titletrue
34scrollable-region-focusabletrue
34scrollable-region-focusabletrue
35identical-links-same-purposefalse
35identical-links-same-purposefalse
36label-content-name-mismatchtrue
36label-content-name-mismatchtrue
37html-has-langtrue
37html-has-langtrue
38html-lang-validtrue
38html-lang-validtrue
39html-xml-lang-mismatchtrue
39html-xml-lang-mismatchtrue
40valid-langtrue
40valid-langtrue
41form-field-multiple-labelstrue
41form-field-multiple-labelstrue
42duplicate-id-activetrue
42duplicate-id-activetrue
43duplicate-idtrue
43duplicate-idtrue
44duplicate-id-ariatrue
44duplicate-id-ariatrue
45aria-valid-attrtrue
45aria-valid-attrtrue
46aria-valid-attr-valuetrue
46aria-valid-attr-valuetrue
47aria-input-field-nametrue
47aria-input-field-nametrue
48aria-rolestrue
48aria-rolestrue
49aria-toggle-field-nametrue
49aria-toggle-field-nametrue
50aria-hidden-focustrue
50aria-hidden-focustrue
51aria-hidden-bodytrue
51aria-hidden-bodytrue
52button-nametrue
52button-nametrue
53aria-allowed-attrtrue
53aria-allowed-attrtrue
54input-button-nametrue
54input-button-nametrue
55aria-required-attrtrue
55aria-required-attrtrue
56aria-roledescriptiontrue
56aria-roledescriptiontrue
57link-nametrue
57link-nametrue
58labeltrue
58labeltrue
59accesskeystrue
59accesskeystrue
60regiontrue
60regiontrue
61aria-allowed-roletrue
61aria-allowed-roletrue
62landmark-banner-is-top-leveltrue
62landmark-banner-is-top-leveltrue
63landmark-complementary-is-top-leveltrue
63landmark-complementary-is-top-leveltrue
64landmark-contentinfo-is-top-leveltrue
64landmark-contentinfo-is-top-leveltrue
65focus-order-semanticstrue
65focus-order-semanticstrue
66tabindextrue
66tabindextrue
67landmark-no-duplicate-maintrue
67landmark-no-duplicate-maintrue
68label-title-onlytrue
68label-title-onlytrue
69frame-testedtrue
69frame-testedtrue
70frame-title-uniquetrue
70frame-title-uniquetrue
71heading-ordertrue
71heading-ordertrue
72empty-headingtrue
72empty-headingtrue
73hidden-contenttrue
73hidden-contenttrue
74landmark-uniquetrue
74landmark-uniquetrue
75landmark-main-is-top-leveltrue
75landmark-main-is-top-leveltrue
76page-has-heading-onetrue
76page-has-heading-onetrue
77landmark-one-maintrue
77landmark-one-maintrue
78landmark-no-duplicate-bannertrue
78landmark-no-duplicate-bannertrue
79landmark-no-duplicate-contentinfotrue
79landmark-no-duplicate-contentinfotrue
80scope-attr-validtrue
80scope-attr-validtrue
81image-redundant-alttrue
81image-redundant-alttrue
82table-duplicate-nametrue
82table-duplicate-nametrue
83skip-linktrue
83skip-linktrue
84meta-viewport-largetrue
84meta-viewport-largetrue
diff --git a/src/util/template/pageTemplate.html b/src/util/template/pageTemplate.html index 45f895b..7aa710a 100644 --- a/src/util/template/pageTemplate.html +++ b/src/util/template/pageTemplate.html @@ -58,17 +58,15 @@

AXE Accessibility Results{{#projectKey}} for {{projectKey}} project{{/projectKey}}

- {{#url}}
- Page URL: + + {{#url}}Page URL: {{url}} +
{{/url}} {{#customSummary}} -
{{{customSummary}}} {{/customSummary}}
- {{/url}}
{{{violationsSummary}}}
{{#violationDetails.length}} @@ -324,47 +322,45 @@
- {{/hasInapplicable}} - {{#hasAxeRawResults}} + {{/hasInapplicable}} {{#hasAxeRawResults}}
{{#rules.length}}
- - - - - + + + + + - {{#rules}} - - - - - + {{#rules}} + + + + + {{/rules}}
#Rule IDEnabled
#Rule IDEnabled
{{index}}{{rule}}{{enabled}}
{{index}}{{rule}}{{enabled}}
diff --git a/temp/tcPassesViolationsIncomplete.html b/temp/tcPassesViolationsIncomplete.html index 823834c..eb1475f 100644 --- a/temp/tcPassesViolationsIncomplete.html +++ b/temp/tcPassesViolationsIncomplete.html @@ -59,9 +59,10 @@

AXE Accessibility Results

- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
diff --git a/test/__snapshots__/index.test.ts.snap b/test/__snapshots__/index.test.ts.snap index e3ccf8a..b0cb366 100644 --- a/test/__snapshots__/index.test.ts.snap +++ b/test/__snapshots__/index.test.ts.snap @@ -62,8 +62,8 @@ exports[`createHtmlReport() test All optional parameters present 1`] = ` AXE Accessibility Results for DEQUE project
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/
Test Case: Full page analysis @@ -1935,8 +1935,8 @@ exports[`createHtmlReport() test AxeResults passed 1`] = ` AXE Accessibility Results for DEQUE project
- Page URL: + + Page URL: http://example.com/
Test Case: Full page analysis @@ -2889,536 +2889,535 @@ exports[`createHtmlReport() test AxeResults passed 1`] = `
- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +
#Rule IDEnabled
#Rule IDEnabled
1object-alttrue
1object-alttrue
2role-img-alttrue
2role-img-alttrue
3input-image-alttrue
3input-image-alttrue
4image-alttrue
4image-alttrue
5svg-img-alttrue
5svg-img-alttrue
6area-alttrue
6area-alttrue
7audio-captiontrue
7audio-captiontrue
8video-captiontrue
8video-captiontrue
9definition-listtrue
9definition-listtrue
10dlitemtrue
10dlitemtrue
11listitemtrue
11listitemtrue
12listtrue
12listtrue
13th-has-data-cellstrue
13th-has-data-cellstrue
14td-headers-attrtrue
14td-headers-attrtrue
15td-has-headertrue
15td-has-headertrue
16p-as-headingtrue
16p-as-headingtrue
17aria-required-parenttrue
17aria-required-parenttrue
18aria-required-childrentrue
18aria-required-childrentrue
19table-fake-captiontrue
19table-fake-captiontrue
20css-orientation-lockfalse
20css-orientation-lockfalse
21autocomplete-validtrue
21autocomplete-validtrue
22link-in-text-blocktrue
22link-in-text-blocktrue
23no-autoplay-audiotrue
23no-autoplay-audiotrue
24color-contrasttrue
24color-contrasttrue
25meta-viewporttrue
25meta-viewporttrue
26avoid-inline-spacingtrue
26avoid-inline-spacingtrue
27server-side-image-maptrue
27server-side-image-maptrue
28meta-refreshtrue
28meta-refreshtrue
29blinktrue
29blinktrue
30marqueetrue
30marqueetrue
31bypasstrue
31bypasstrue
32frame-titletrue
32frame-titletrue
33document-titletrue
33document-titletrue
34scrollable-region-focusabletrue
34scrollable-region-focusabletrue
35identical-links-same-purposefalse
35identical-links-same-purposefalse
36label-content-name-mismatchtrue
36label-content-name-mismatchtrue
37html-has-langtrue
37html-has-langtrue
38html-lang-validtrue
38html-lang-validtrue
39html-xml-lang-mismatchtrue
39html-xml-lang-mismatchtrue
40valid-langtrue
40valid-langtrue
41form-field-multiple-labelstrue
41form-field-multiple-labelstrue
42duplicate-id-activetrue
42duplicate-id-activetrue
43duplicate-idtrue
43duplicate-idtrue
44duplicate-id-ariatrue
44duplicate-id-ariatrue
45aria-valid-attrtrue
45aria-valid-attrtrue
46aria-valid-attr-valuetrue
46aria-valid-attr-valuetrue
47aria-input-field-nametrue
47aria-input-field-nametrue
48aria-rolestrue
48aria-rolestrue
49aria-toggle-field-nametrue
49aria-toggle-field-nametrue
50aria-hidden-focustrue
50aria-hidden-focustrue
51aria-hidden-bodytrue
51aria-hidden-bodytrue
52button-nametrue
52button-nametrue
53aria-allowed-attrtrue
53aria-allowed-attrtrue
54input-button-nametrue
54input-button-nametrue
55aria-required-attrtrue
55aria-required-attrtrue
56aria-roledescriptiontrue
56aria-roledescriptiontrue
57link-nametrue
57link-nametrue
58labeltrue
58labeltrue
59accesskeystrue
59accesskeystrue
60regiontrue
60regiontrue
61aria-allowed-roletrue
61aria-allowed-roletrue
62landmark-banner-is-top-leveltrue
62landmark-banner-is-top-leveltrue
63landmark-complementary-is-top-leveltrue
63landmark-complementary-is-top-leveltrue
64landmark-contentinfo-is-top-leveltrue
64landmark-contentinfo-is-top-leveltrue
65focus-order-semanticstrue
65focus-order-semanticstrue
66tabindextrue
66tabindextrue
67landmark-no-duplicate-maintrue
67landmark-no-duplicate-maintrue
68label-title-onlytrue
68label-title-onlytrue
69frame-testedtrue
69frame-testedtrue
70frame-title-uniquetrue
70frame-title-uniquetrue
71heading-ordertrue
71heading-ordertrue
72empty-headingtrue
72empty-headingtrue
73hidden-contenttrue
73hidden-contenttrue
74landmark-uniquetrue
74landmark-uniquetrue
75landmark-main-is-top-leveltrue
75landmark-main-is-top-leveltrue
76page-has-heading-onetrue
76page-has-heading-onetrue
77landmark-one-maintrue
77landmark-one-maintrue
78landmark-no-duplicate-bannertrue
78landmark-no-duplicate-bannertrue
79landmark-no-duplicate-contentinfotrue
79landmark-no-duplicate-contentinfotrue
80scope-attr-validtrue
80scope-attr-validtrue
81image-redundant-alttrue
81image-redundant-alttrue
82table-duplicate-nametrue
82table-duplicate-nametrue
83skip-linktrue
83skip-linktrue
84meta-viewport-largetrue
84meta-viewport-largetrue
@@ -3492,6 +3491,12 @@ exports[`createHtmlReport() test URL is not passed 1`] = `

AXE Accessibility Results

+
+ + + + +
axe-core found 85 violations
@@ -4612,6 +4617,88 @@ exports[`createHtmlReport() test URL is not passed 1`] = ` " `; +exports[`createHtmlReport() test Verify report is created even if no violations passed 1`] = ` +" + + + + + + + + + + + + + AXE Accessibility Results + + +
+

+ AXE Accessibility Results +

+
+ + + Test Case: Full page analysis +
Steps:
+
    +
  1. Open https://dequeuniversity.com/demo/mars/
  2. +
  3. Analyze full page with all rules enabled
  4. +
+
+
+
axe-core found 0 violations
+
+ +
+
+ + +" +`; + exports[`createHtmlReport() test Verify report is created only with violations because passes and incomplete are not passed 1`] = ` " @@ -4674,9 +4761,10 @@ exports[`createHtmlReport() test Verify report is created only with violations b AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -5862,8 +5950,8 @@ exports[`createHtmlReport() test Verify report is created with violations and cu AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/
Test Case: Full page analysis @@ -7056,9 +7144,10 @@ exports[`createHtmlReport() test Verify report is created with violations and pa AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -8588,9 +8677,10 @@ exports[`createHtmlReport() test Verify report is created with violations, passe AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -10204,9 +10294,10 @@ exports[`createHtmlReport() test Verify report is created with violations, passe AXE Accessibility Results for DEQUE project
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -11820,9 +11911,10 @@ exports[`createHtmlReport() test Verify report with no violations, no passes, no AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -12004,9 +12096,10 @@ exports[`createHtmlReport() test Verify report with no violations, passes and in AXE Accessibility Results for DEQUE project
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
@@ -12510,9 +12603,10 @@ exports[`createHtmlReport() test Verify report with no violations, passes and in AXE Accessibility Results
- Page URL: + + Page URL: https://dequeuniversity.com/demo/mars/ +
diff --git a/test/index.test.ts b/test/index.test.ts index e679453..ee291cf 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -39,6 +39,25 @@ describe('createHtmlReport() test', () => { }); expect(fs.readFileSync(getPathToCreatedReport(), { encoding: 'utf8' })).toMatchSnapshot(); }); + const customSummary = `Test Case: Full page analysis +
Steps:
+
    +
  1. Open https://dequeuniversity.com/demo/mars/
  2. +
  3. Analyze full page with all rules enabled
  4. +
`; + it('Verify report is created even if no violations passed', async () => { + const reportFileName = 'tcAllPassedOnlyViolations.html'; + createHtmlReport({ + results: { + violations: [], + }, + options: { customSummary, reportFileName }, + }); + expect( + fs.readFileSync(getPathToCreatedReport(reportFileName), { encoding: 'utf8' }) + ).toMatchSnapshot(); + }); + it('URL is not passed', async () => { const reportFileName = 'urlIsNotPassed.html'; createHtmlReport({ @@ -170,12 +189,6 @@ describe('createHtmlReport() test', () => { fs.readFileSync(getPathToCreatedReport(reportFileName), { encoding: 'utf8' }) ).toMatchSnapshot(); }); - const customSummary = `Test Case: Full page analysis -
Steps:
-
    -
  1. Open https://dequeuniversity.com/demo/mars/
  2. -
  3. Analyze full page with all rules enabled
  4. -
`; it('All optional parameters present', async () => { const reportFileName = 'tsAllOptionalParametersPresent.html'; createHtmlReport({