Skip to content

Commit

Permalink
CI: make testcafe tests stable (DevExpress#28707)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeniyKiyashko committed Jan 15, 2025
1 parent abdd30e commit 8aaa01e
Show file tree
Hide file tree
Showing 51 changed files with 402 additions and 331 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ jobs:
{ componentFolder: "scheduler/timezones", name: "scheduler (America/Los_Angeles)", timezone: "America/Los_Angeles" },
{ componentFolder: "form", name: "form (1/2)", indices: "1/2" },
{ componentFolder: "form", name: "form (2/2)", indices: "2/2" },
{ componentFolder: "form", name: "form - material (1/2)", theme: 'material.blue.light', indices: "1/2" },
{ componentFolder: "form", name: "form - material (2/2)", theme: 'material.blue.light', indices: "2/2" },
{ componentFolder: "form", name: "form - material (1/4)", theme: 'material.blue.light', indices: "1/4" },
{ componentFolder: "form", name: "form - material (2/4)", theme: 'material.blue.light', indices: "2/4" },
{ componentFolder: "form", name: "form - material (3/4)", theme: 'material.blue.light', indices: "3/4" },
{ componentFolder: "form", name: "form - material (4/4)", theme: 'material.blue.light', indices: "4/4" },
{ componentFolder: "form", name: "form - fluent (1/2)", theme: 'fluent.blue.light', indices: "1/2" },
{ componentFolder: "form", name: "form - fluent (2/2)", theme: 'fluent.blue.light', indices: "2/2" },
{ componentFolder: "editors", name: "editors (1/2)", indices: "1/2" },
Expand Down
23 changes: 22 additions & 1 deletion apps/demos/testing/common.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ const SKIPPED_TESTS = {
],
VectorMap: [
{ demo: 'Palette', themes: [THEME.material] },
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'PieMarkers', themes: [THEME.material] },
{ demo: 'AreaWithLabelsAndTwoLegends', themes: [THEME.material] },
{ demo: 'CustomAnnotations', themes: [THEME.material] },
{ demo: 'CustomProjection', themes: [THEME.material] },
{ demo: 'MultipleLayers', themes: [THEME.material] },
Expand All @@ -131,9 +134,12 @@ const SKIPPED_TESTS = {
Charts: [
{ demo: 'PiesWithEqualSize', themes: [THEME.material] },
{ demo: 'CustomAnnotations', themes: [THEME.material] },
{ demo: 'ServerSideDataProcessing', themes: [THEME.material] },
{ demo: 'SubvalueIndicatorTextFormatting', themes: [THEME.material] },
],
DataGrid: [
{ demo: 'SignalRService', themes: [THEME.material, THEME.fluent] },
{ demo: 'EditStateManagement', themes: [THEME.material] },
{ demo: 'MultipleRecordSelectionModes', themes: [THEME.fluent] },
{ demo: 'ToolbarCustomization', themes: [THEME.fluent, THEME.material] },
{ demo: 'MultipleRecordSelectionAPI', themes: [THEME.material] },
Expand All @@ -148,6 +154,7 @@ const SKIPPED_TESTS = {
{ demo: 'ItemDragging', themes: [THEME.fluent, THEME.material] },
],
VectorMap: [
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'PieMarkers', themes: [THEME.material] },
{ demo: 'CustomMapData', themes: [THEME.material] },
{ demo: 'CustomProjection', themes: [THEME.material] },
Expand All @@ -164,6 +171,8 @@ const SKIPPED_TESTS = {
{ demo: 'LayoutCustomization', themes: [THEME.material] },
],
Gauges: [
{ demo: 'SubvalueIndicatorTextFormatting', themes: [THEME.material] },
{ demo: 'VariableNumberOfSubvalueIndicators', themes: [THEME.material] },
{ demo: 'DifferentValueIndicatorTypesLinearGauge', themes: [THEME.material] },
{ demo: 'ScaleLabelFormatting', themes: [THEME.material] },
],
Expand All @@ -173,9 +182,12 @@ const SKIPPED_TESTS = {
{ demo: 'TilingAlgorithms', themes: [THEME.material] },
{ demo: 'ExportAndPrintingAPI', themes: [THEME.material] },
{ demo: 'DiscreteAxisZoomingAndScrolling', themes: [THEME.material] },
{ demo: 'Line', themes: [THEME.material] },
{ demo: 'Spline', themes: [THEME.material] },
{ demo: 'Colorization', themes: [THEME.material] },
{ demo: 'SignalRService', themes: [THEME.material] },
{ demo: 'PointsAggregation', themes: [THEME.material] },
{ demo: 'SubvalueIndicatorTextFormatting', themes: [THEME.material] },
{ demo: 'AxisLabelsOverlapping', themes: [THEME.material] },
{ demo: 'ServerSideDataProcessing', themes: [THEME.material] },
{ demo: 'PiesWithEqualSize', themes: [THEME.material] },
Expand All @@ -186,6 +198,7 @@ const SKIPPED_TESTS = {
],
DataGrid: [
{ demo: 'SignalRService', themes: [THEME.fluent, THEME.material] },
{ demo: 'EditStateManagement', themes: [THEME.material] },
{ demo: 'ToolbarCustomization', themes: [THEME.fluent, THEME.material] },
{ demo: 'MultipleRecordSelectionModes', themes: [THEME.fluent] },
{ demo: 'FilteringAPI', themes: [THEME.material] },
Expand All @@ -202,7 +215,9 @@ const SKIPPED_TESTS = {
],
Gauges: [
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'VariableNumberOfSubvalueIndicators', themes: [THEME.material] },
{ demo: 'ScaleLabelFormatting', themes: [THEME.material] },
{ demo: 'SubvalueIndicatorTextFormatting', themes: [THEME.material] },
{ demo: 'DifferentValueIndicatorTypes', themes: [THEME.material] },
{ demo: 'DifferentValueIndicatorTypesLinearGauge', themes: [THEME.material] },
],
Expand All @@ -215,6 +230,10 @@ const SKIPPED_TESTS = {
{ demo: 'LayoutCustomization', themes: [THEME.material] },
],
VectorMap: [
{ demo: 'CustomProjection', themes: [THEME.material] },
{ demo: 'Spline', themes: [THEME.material] },
{ demo: 'CustomAnnotations', themes: [THEME.material] },
{ demo: 'Palette', themes: [THEME.material] },
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'PieMarkers', themes: [THEME.material] },
{ demo: 'TooltipHTMLSupport', themes: [THEME.material] },
Expand All @@ -223,7 +242,9 @@ const SKIPPED_TESTS = {
{ demo: 'AreaWithLabelsAndTwoLegends', themes: [THEME.material] },
],
Gantt: [
{ demo: 'Validation', themes: [THEME.material] },
{ demo: 'ContextMenu', themes: [THEME.material] },
{ demo: 'Validation', themes: [THEME.generic, THEME.material, THEME.fluent] },
{ demo: 'TaskTemplate', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
},
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/demos/utils/visual-tests/matrix-test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const SKIPPED_TESTS = {
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'ZoomingAndScrollingAPI', themes: [THEME.material] },
{ demo: 'ZoomingOnAreaSelection', themes: [THEME.material] },
{ demo: 'CustomLegendMarkers', themes: [THEME.material] },
{ demo: 'DialogsAndNotificationsOverview', themes: [THEME.material] },
],
VectorMap: [
Expand All @@ -245,6 +246,9 @@ const SKIPPED_TESTS = {
Charts: [
{ demo: 'Overview', themes: [THEME.material] },
{ demo: 'ZoomingAndScrollingAPI', themes: [THEME.material] },
{ demo: 'Crosshair', themes: [THEME.material] },
{ demo: 'CustomAnnotations', themes: [THEME.material] },
{ demo: 'CustomLegendMarkers', themes: [THEME.material] },
],
DataGrid: [
{ demo: 'BatchEditing', themes: [THEME.fluent] },
Expand Down
4 changes: 3 additions & 1 deletion e2e/testcafe-devextreme/helpers/themeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ export async function testScreenshot(
.ok();
}

await changeTheme(process.env.theme ?? defaultThemeName);
if (isString(theme) || shouldTestInCompact) {
await changeTheme(process.env.theme ?? defaultThemeName);
}
}
36 changes: 18 additions & 18 deletions e2e/testcafe-devextreme/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ createTestCafe({
fs.rmSync('./screenshots', { recursive: true });
}

const browsers = args.browsers.split(' ').map(expandBrowserAlias);
const browsers = args.browsers
.split(' ')
.map((browser) => expandBrowserAlias(browser, args.componentFolder.trim()));
// eslint-disable-next-line no-console
console.log('Browsers:', browsers);

Expand Down Expand Up @@ -113,24 +115,22 @@ createTestCafe({
quarantineMode: { successThreshold: 1, attemptLimit: 5 },
};

if(args.componentFolder.trim() !== 'renovation') {
runOptions.hooks = {
test: {
before: async() => {
if(args.shadowDom) {
await addShadowRootTree();
}

if(args.theme) {
await changeTheme(args.theme);
}
},
after: async() => {
await testPageUtils.clearTestPage();
runOptions.hooks = {
test: {
before: async() => {
if(args.shadowDom) {
await addShadowRootTree();
}

if(args.theme) {
await changeTheme(args.theme);
}
},
};
}
after: async() => {
await testPageUtils.clearTestPage();
}
},
};

if(args.browsers === 'chrome:docker') {
runOptions.disableScreenshots = true;
Expand All @@ -155,7 +155,7 @@ function setShadowDom(args) {
process.env.shadowDom = args.shadowDom;
}

function expandBrowserAlias(browser) {
function expandBrowserAlias(browser, componentFolder) {
switch(browser) {
case 'chrome:devextreme-shr2':
return 'chrome:headless --disable-gpu --window-size=1200,800';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ safeSizeTest('Geometry is good', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dateBox = new DateBox('#container');

await dateBox.option('opened', true);

await testScreenshot(t, takeScreenshot, 'Datebox with calendar.png');

await dateBox.option('opened', false);
await dateBox.option('type', 'datetime');
await dateBox.option('opened', true);

await testScreenshot(t, takeScreenshot, 'Datebox with datetime.png');

Expand All @@ -40,7 +44,6 @@ safeSizeTest('Geometry is good', async (t) => {
await waitFont();

return createWidget('dxDateBox', {
opened: true,
pickerType: 'calendar',
width: 200,
value: new Date(1.5e12),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8aaa01e

Please sign in to comment.