2018-09-30 04:05:50 +00:00
|
|
|
// https://github.com/DevExpress/testcafe
|
|
|
|
// https://devexpress.github.io/testcafe/documentation/test-api/
|
|
|
|
// https://github.com/helen-dikareva/axe-testcafe
|
2019-06-27 04:21:55 +00:00
|
|
|
import {axeCheck, createReport} from 'axe-testcafe';
|
2018-09-30 04:05:50 +00:00
|
|
|
|
2019-04-05 14:59:41 +00:00
|
|
|
/**
|
|
|
|
* @external AxeResult
|
|
|
|
*/
|
2019-04-03 04:49:48 +00:00
|
|
|
/**
|
|
|
|
* @external TestcafeTest
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @param {external.TestcafeTest} t
|
2019-04-05 14:59:41 +00:00
|
|
|
* @returns {Promise<external:AxeResult>}
|
2019-04-03 04:49:48 +00:00
|
|
|
*/
|
2019-06-27 04:21:55 +00:00
|
|
|
async function axeCheckWithConfig (t) {
|
|
|
|
const /* error, */ {violations} = await axeCheck(
|
2019-04-03 04:49:48 +00:00
|
|
|
t,
|
|
|
|
// context: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#context-parameter
|
|
|
|
undefined,
|
|
|
|
// https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
|
|
|
{
|
|
|
|
rules: {
|
|
|
|
'meta-viewport': {enabled: false}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// , (err, results) {} // https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#results-object
|
|
|
|
);
|
2019-06-27 04:21:55 +00:00
|
|
|
await t.expect(violations.length === 0).ok(createReport(violations));
|
2019-04-03 04:49:48 +00:00
|
|
|
}
|
|
|
|
|
2018-09-30 04:05:50 +00:00
|
|
|
fixture`TestCafe Axe accessibility tests (Editor - no parameters)`
|
|
|
|
.page`http://localhost:8000/editor/svg-editor.html`;
|
|
|
|
|
2018-11-07 06:51:50 +00:00
|
|
|
test('Editor - no parameters', async (t) => {
|
2019-04-03 04:49:48 +00:00
|
|
|
await axeCheckWithConfig(t); // , axeContent, axeOptions: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axerun
|
2018-09-30 04:05:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
fixture`TestCafe Axe accessibility tests (Editor - with all extensions)`
|
|
|
|
.page`http://localhost:8000/editor/svg-editor.html?extensions=ext-arrows.js,ext-closepath.js,ext-foreignobject.js,ext-helloworld.js,ext-mathjax.js,ext-php_savefile.js,ext-server_moinsave.js,ext-server_opensave.js,ext-webappfind.js,ext-xdomain-messaging.js`;
|
|
|
|
|
2019-04-03 04:49:48 +00:00
|
|
|
test('Editor - with all extensions', async (t) => {
|
|
|
|
await axeCheckWithConfig(t); // , axeContent, axeOptions: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axerun
|
2018-09-30 04:05:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/* eslint-disable qunit/no-commented-tests */
|
|
|
|
// Waiting for https://github.com/DevExpress/testcafe-hammerhead/issues/1725 (also https://github.com/DevExpress/testcafe/issues/2734 )
|
|
|
|
/**
|
|
|
|
fixture`TestCafe Axe accessibility tests (Editor ES - no parameters)`
|
|
|
|
.page`http://localhost:8000/editor/svg-editor-es.html`;
|
|
|
|
|
|
|
|
test('Editor ES - no parameters', async t => {
|
2019-04-03 04:49:48 +00:00
|
|
|
await axeCheckWithConfig(t); // , axeContent, axeOptions: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axerun
|
2018-09-30 04:05:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
fixture`TestCafe Axe accessibility tests (Editor ES - with all extensions)`
|
|
|
|
.page`http://localhost:8000/editor/svg-editor-es.html?extensions=ext-arrows.js,ext-closepath.js,ext-foreignobject.js,ext-helloworld.js,ext-mathjax.js,ext-php_savefile.js,ext-server_moinsave.js,ext-server_opensave.js,ext-webappfind.js,ext-xdomain-messaging.js`;
|
|
|
|
|
|
|
|
test('Editor ES - with all extensions', async t => {
|
2019-04-03 04:49:48 +00:00
|
|
|
await axeCheckWithConfig(t); // , axeContent, axeOptions: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axerun
|
2018-09-30 04:05:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
fixture`TestCafe Axe accessibility tests (Embedded - no parameters)`
|
|
|
|
.page`http://localhost:8000/editor/embedapi.html`;
|
|
|
|
|
|
|
|
test('Embedded - no parameters', async t => {
|
2019-04-03 04:49:48 +00:00
|
|
|
await axeCheckWithConfig(t); // , axeContent, axeOptions: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axerun
|
2018-09-30 04:05:50 +00:00
|
|
|
});
|
|
|
|
*/
|
2019-02-21 11:41:09 +00:00
|
|
|
/* eslint-enable qunit/no-commented-tests */
|