Skip to content

Commit

Permalink
Feature/S1288-a11y-tests (#7222)
Browse files Browse the repository at this point in the history
* Work for surveyjs/service#1288 - fixed initial a11y tests

* Work for surveyjs/service#1288 - fixed initial a11y tests for react, angular and vue2+3

* Work for surveyjs/service#1288 - fixed angular build

* Work for surveyjs/service#1288 - fixed markup tests

* Work for surveyjs/service#1288 - fixed f-test

* Override axe-testcafe dependency

* Work for surveyjs/service#1288 - fixed keyboard nav in radio group f-test

* Work for surveyjs/service#1288 - fixed vue2 markup tests

* Work for surveyjs/service#1288 - fixed Vue3 a11y tests

* Work for surveyjs/service#1288 - refactored a11y tests

---------

Co-authored-by: tsv2013 <tsv2013@noreply.github.com>
  • Loading branch information
tsv2013 and tsv2013 committed Oct 26, 2023
1 parent 0418e0a commit 77cf48a
Show file tree
Hide file tree
Showing 112 changed files with 837 additions and 803 deletions.
30 changes: 28 additions & 2 deletions accessibilityTests/helper.js → accessibilityTests/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const applyTheme = ClientFunction((theme) => {
});

export const initSurvey = ClientFunction(
(framework, json, events, isDesignMode, props) => {
(framework, json, events?, isDesignMode?, props?) => {
// eslint-disable-next-line no-console
console.error = (msg) => {
throw new Error(msg);
Expand Down Expand Up @@ -72,11 +72,37 @@ export const initSurvey = ClientFunction(
data: { survey: model },
});
} else if (framework === "angular" || framework == "vue3") {
window.setSurvey(model);
(window as any).setSurvey(model);
}
window["survey"] = model;
}
);

// https://www.deque.com/axe/core-documentation/api-documentation/#overview
export const axeTags = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "best-practice", "section508", "wcag412"];

export const axeContext = { include: [[".sv_p_root"]] };
export const axeOptions = {
runOnly: {
type: "tag",
values: axeTags
},
rules: {
//https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md
"color-contrast": {
enabled: false
},
"document-title": {
enabled: false
},
"landmark-one-main": {
enabled: false
},
"page-has-heading-one": {
enabled: false
},
"region": {
enabled: false
}
}
};

0 comments on commit 77cf48a

Please sign in to comment.