From d4e60b39a606ab96a393a119f9a83325f9e5d5aa Mon Sep 17 00:00:00 2001 From: Tom Brunet Date: Tue, 29 Mar 2022 15:47:56 -0500 Subject: [PATCH] Build ACT earlResult into engine archives (#772) * Flatten rule folder * Generate the rule index * Fix dependency that's not for aria_semantics rules * Publish ACT results with engine * Test update Co-authored-by: eirckr <62436670+eirckr@users.noreply.github.com> --- .github/workflows/publish.yml | 8 ++++++++ .../src/v4/rules/Rpt_Aria_ValidRole.ts | 8 ++++---- .../InValidRoleSpecifiedMultiple.html | 2 +- .../test-act/earlResult.json | 20 +++++++++---------- gitactions/publish/achecker-engine.sh | 1 + 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b29a070b8..a2f131c79 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,14 @@ jobs: working-directory: rule-server - run: npm run build working-directory: rule-server + - run: node main.js & + working-directory: rule-server/dist + - run: sleep 10 + working-directory: rule-server/dist + - run: npm install + working-directory: accessibility-checker + - run: npm test + working-directory: accessibility-checker/test-act - run: gitactions/publish/achecker-engine.sh env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/accessibility-checker-engine/src/v4/rules/Rpt_Aria_ValidRole.ts b/accessibility-checker-engine/src/v4/rules/Rpt_Aria_ValidRole.ts index 4e6f969e3..71a31a21f 100644 --- a/accessibility-checker-engine/src/v4/rules/Rpt_Aria_ValidRole.ts +++ b/accessibility-checker-engine/src/v4/rules/Rpt_Aria_ValidRole.ts @@ -22,8 +22,8 @@ export let Rpt_Aria_ValidRole: Rule = { "en-US": { "group": `Rpt_Aria_ValidRole.html`, "Pass_0": `Rpt_Aria_ValidRole.html`, - "Fail_1": `Rpt_Aria_ValidRole.html`, - "Fail_2": `Rpt_Aria_ValidRole.html` + "Fail_2": `Rpt_Aria_ValidRole.html`, + "Potential_1": `Rpt_Aria_ValidRole.html` } }, messages: { @@ -31,7 +31,7 @@ export let Rpt_Aria_ValidRole: Rule = { "group": "Elements must have a valid 'role' per ARIA specification", "Pass_0": "Rule Passed", "Fail_2": "The role '{0}' defined on the element is not valid per ARIA specification", - "Fail_1": "Some of the roles, '{0}', defined on the element are not valid per ARIA specification" + "Potential_1": "Some of the roles, '{0}', defined on the element are not valid per ARIA specification" } }, rulesets: [{ @@ -65,7 +65,7 @@ export let Rpt_Aria_ValidRole: Rule = { if (invalidRoles.length === roles.length) { return RuleFail("Fail_2", [invalidRoles.join(",")]); } else if (invalidRoles.length > 0) { - return RulePotential("Fail_1", [invalidRoles.join(",")]); + return RulePotential("Potential_1", [invalidRoles.join(",")]); } else { return RulePass("Pass_0"); } diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/HAAC_Aria_Native_Host_Semantics_ruleunit/InValidRoleSpecifiedMultiple.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/HAAC_Aria_Native_Host_Semantics_ruleunit/InValidRoleSpecifiedMultiple.html index 05d770404..fc6498663 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/HAAC_Aria_Native_Host_Semantics_ruleunit/InValidRoleSpecifiedMultiple.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/HAAC_Aria_Native_Host_Semantics_ruleunit/InValidRoleSpecifiedMultiple.html @@ -280,7 +280,7 @@

Button 1 Label

"dom": "/html[1]/body[1]", "aria": "/status[1]/separator[1]" }, - "reasonId": "Fail_1", + "reasonId": "Potential_1", "message": "Some of the roles, 'test', defined on the element are not valid per ARIA specification", "messageArgs": [ "test" diff --git a/accessibility-checker/test-act/earlResult.json b/accessibility-checker/test-act/earlResult.json index 9bc50aa68..032e0e71a 100644 --- a/accessibility-checker/test-act/earlResult.json +++ b/accessibility-checker/test-act/earlResult.json @@ -5168,7 +5168,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:passed" @@ -5183,7 +5183,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:passed" @@ -5198,7 +5198,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:cantTell" @@ -5213,7 +5213,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:failed" @@ -5228,7 +5228,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:failed" @@ -5243,7 +5243,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:inapplicable" @@ -5258,7 +5258,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:inapplicable" @@ -5273,7 +5273,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:inapplicable" @@ -5288,7 +5288,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:inapplicable" @@ -5303,7 +5303,7 @@ { "@type": "Assertion", "test": { - "title": "Rpt_Aria_ValidRole:Pass_0,Fail_1,Fail_2" + "title": "Rpt_Aria_ValidRole:Pass_0,Fail_2,Fail_1" }, "result": { "outcome": "earl:inapplicable" diff --git a/gitactions/publish/achecker-engine.sh b/gitactions/publish/achecker-engine.sh index 52c75ce71..f737dbdba 100755 --- a/gitactions/publish/achecker-engine.sh +++ b/gitactions/publish/achecker-engine.sh @@ -1,6 +1,7 @@ if [ -n "${GITHUB_REF:10}" ]; then cd ./accessibility-checker-engine/dist cp ../../rule-server/dist/static/archives.json ./ + cp ../../accessibility-checker/test-act/earlResult.json ./ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >.npmrc; NPM_VERSION="${GITHUB_REF:10}"; echo "Deploy accessibility-checker-engine version ${NPM_VERSION}...";