-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overlays: Add configurations for accessibility testing (#27327)
- Loading branch information
1 parent
20703c5
commit 3e775d9
Showing
6 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
e2e/testcafe-devextreme/tests/accessibility/floatingActionButton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Properties } from 'devextreme/ui/speed_dial_action.d'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { testAccessibility, Configuration } from '../../helpers/accessibility/test'; | ||
import { Options } from '../../helpers/generateOptionMatrix'; | ||
|
||
fixture.disablePageReloads`Accessibility` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const options: Options<Properties> = { | ||
label: ['', 'label'], | ||
hint: [undefined, 'hint'], | ||
icon: [undefined, 'save'], | ||
}; | ||
|
||
const a11yCheckConfig = { | ||
// NOTE: color-contrast issues | ||
rules: { 'color-contrast': { enabled: false } }, | ||
}; | ||
|
||
const configuration: Configuration = { | ||
component: 'dxSpeedDialAction', | ||
a11yCheckConfig, | ||
options, | ||
}; | ||
|
||
testAccessibility(configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Properties } from 'devextreme/ui/load_panel.d'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { testAccessibility, Configuration } from '../../helpers/accessibility/test'; | ||
import { Options } from '../../helpers/generateOptionMatrix'; | ||
|
||
fixture.disablePageReloads`Accessibility` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const options: Options<Properties> = { | ||
visible: [true], | ||
showIndicator: [true, false], | ||
showPane: [true, false], | ||
message: [undefined, 'message'], | ||
hint: [undefined, 'hint'], | ||
delay: [undefined, 3000], | ||
}; | ||
|
||
const a11yCheckConfig = { | ||
// NOTE: color-contrast issues | ||
rules: { 'color-contrast': { enabled: false } }, | ||
}; | ||
|
||
const configuration: Configuration = { | ||
component: 'dxLoadPanel', | ||
a11yCheckConfig, | ||
options, | ||
}; | ||
|
||
testAccessibility(configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Properties } from 'devextreme/ui/popover.d'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { defaultSelector, testAccessibility, Configuration } from '../../helpers/accessibility/test'; | ||
import { Options } from '../../helpers/generateOptionMatrix'; | ||
import { isMaterial, isMaterialBased } from '../../helpers/themeUtils'; | ||
|
||
fixture.disablePageReloads`Accessibility` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const options: Options<Properties> = { | ||
visible: [true], | ||
target: [defaultSelector], | ||
width: [300], | ||
height: [280], | ||
showTitle: [true, false], | ||
title: [undefined, 'title'], | ||
showCloseButton: [true, false], | ||
toolbarItems: [ | ||
undefined, | ||
[ | ||
{ | ||
location: 'before', | ||
widget: 'dxButton', | ||
options: { | ||
icon: 'back', | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
|
||
const a11yCheckConfig = isMaterialBased() ? { | ||
// NOTE: color-contrast issues in Material | ||
runOnly: isMaterial() ? '' : 'color-contrast', | ||
rules: { 'color-contrast': { enabled: !isMaterial() } }, | ||
} : {}; | ||
|
||
const configuration: Configuration = { | ||
component: 'dxPopover', | ||
a11yCheckConfig, | ||
options, | ||
}; | ||
|
||
testAccessibility(configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Properties } from 'devextreme/ui/toast.d'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { testAccessibility, Configuration } from '../../helpers/accessibility/test'; | ||
import { Options } from '../../helpers/generateOptionMatrix'; | ||
|
||
fixture.disablePageReloads`Accessibility` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const options: Options<Properties> = { | ||
visible: [true], | ||
message: [undefined, 'message'], | ||
hint: [undefined, 'hint'], | ||
displayTime: [undefined, 3000], | ||
type: ['custom', 'error', 'info', 'success', 'warning'], | ||
}; | ||
|
||
const a11yCheckConfig = { | ||
// NOTE: color-contrast issues | ||
rules: { 'color-contrast': { enabled: false } }, | ||
}; | ||
|
||
const configuration: Configuration = { | ||
component: 'dxToast', | ||
a11yCheckConfig, | ||
options, | ||
}; | ||
|
||
testAccessibility(configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Properties } from 'devextreme/ui/tooltip.d'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { testAccessibility, Configuration } from '../../helpers/accessibility/test'; | ||
import { Options } from '../../helpers/generateOptionMatrix'; | ||
|
||
fixture.disablePageReloads`Accessibility` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const options: Options<Properties> = { | ||
visible: [true], | ||
target: ['#container'], | ||
width: [50], | ||
height: [25], | ||
disabled: [true, false], | ||
hint: [undefined, 'hint'], | ||
}; | ||
|
||
const a11yCheckConfig = { | ||
// NOTE: color-contrast issues | ||
rules: { 'color-contrast': { enabled: false } }, | ||
}; | ||
|
||
const configuration: Configuration = { | ||
component: 'dxTooltip', | ||
a11yCheckConfig, | ||
options, | ||
}; | ||
|
||
testAccessibility(configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters