-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffe7893
commit d6d6edc
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
e2e/testcafe-devextreme/tests/dataGrid/accessibility/contrast.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,46 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import DataGrid from 'devextreme-testcafe-models/dataGrid'; | ||
import url from '../../../helpers/getPageUrl'; | ||
import { createWidget } from '../../../helpers/createWidget'; | ||
import { getData } from '../helpers/generateDataSourceData'; | ||
import { Themes } from '../../../helpers/themes'; | ||
import { changeTheme } from '../../../helpers/changeTheme'; | ||
|
||
fixture.disablePageReloads`DataGrid - contrast` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
// T1257970 | ||
[ | ||
Themes.genericLight, | ||
Themes.fluentBlue, | ||
Themes.materialBlue, | ||
].forEach((theme) => { | ||
test('DataGrid - Contrast between icons in the Filter Row menu and their background doesn\'t comply with WCAG accessibility standards', async (t) => { | ||
const dataGrid = new DataGrid('#container'); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
await t | ||
.expect(dataGrid.isReady()) | ||
.ok(); | ||
|
||
await t | ||
.expect(await takeScreenshot(`T1257970-datagrid-menu-icon-contrast-${theme}`, dataGrid.element)) | ||
.ok() | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before( | ||
async () => { | ||
await changeTheme(theme); | ||
await createWidget('dxDataGrid', { | ||
dataSource: getData(5, 5), | ||
filterRow: { | ||
visible: true, | ||
}, | ||
}); | ||
}, | ||
).after( | ||
async () => { | ||
await changeTheme(Themes.genericLight); | ||
}, | ||
); | ||
}); |