Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tongsonbarbs committed Dec 9, 2024
1 parent ffe7893 commit d6d6edc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/accessibility/contrast.ts
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);
},
);
});

0 comments on commit d6d6edc

Please sign in to comment.