Skip to content

Commit 02c880d

Browse files
r-farkhutdinovRuslan Farkhutdinov
andauthored
Fix flaky Chat & SelectBox tests & skip Chart & DataGrid tests (#29101)
Co-authored-by: Ruslan Farkhutdinov <[email protected]>
1 parent 49e0f88 commit 02c880d

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

apps/demos/testing/widgets/accordion/Accordion.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fixture('Accordion.Overview')
1212
ctx.initialWindowSize = [900, 600];
1313
});
1414

15-
runManualTest('Accordion', 'Overview', ['jQuery', 'React', 'Vue', 'Angular'], (test) => {
15+
runManualTest('Accordion', 'Overview', ['jQuery', 'React', 'Angular', 'Vue'], (test) => {
1616
test('Custom Overview Appearance', async (t) => {
1717
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1818

apps/demos/testing/widgets/chat/Customization.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ runManualTest('Chat', 'Customization', ['jQuery', 'React', 'Vue', 'Angular'], (t
1818
test('Customization', async (t) => {
1919
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
2020

21+
await t.wait(500);
22+
2123
await t
2224
.click(Selector(`.${SELECTBOX_CLASS}`).nth(0))
2325
.click(Selector(`.${LIST_ITEM_CLASS}`).nth(2))

apps/demos/testing/widgets/selectbox/GroupedItems.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ runManualTest('SelectBox', 'GroupedItems', ['jQuery', 'React', 'Vue', 'Angular']
1414
const SELECT_BOX_CLASS = 'dx-selectbox';
1515
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1616

17+
await t.wait(500);
18+
1719
await t
1820
.click($(`.${SELECT_BOX_CLASS}`).nth(0))
1921
.wait(200);

apps/demos/utils/visual-tests/matrix-test-helper.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function shouldRunFramework(currentFramework) {
166166

167167
export function shouldRunTestAtIndex(testIndex) {
168168
return (settings.current === settings.total ? 0 : settings.current)
169-
=== ((testIndex % settings.total) || 0);
169+
=== ((testIndex % settings.total) || 0);
170170
}
171171

172172
const SKIPPED_TESTS = {
@@ -205,7 +205,7 @@ const SKIPPED_TESTS = {
205205
{ demo: 'CustomAnnotations', themes: [THEME.generic, THEME.material, THEME.fluent] },
206206
{ demo: 'LoadDataOnDemand', themes: [THEME.generic, THEME.material, THEME.fluent] },
207207
{ demo: 'CustomLegendMarkers', themes: [THEME.generic, THEME.material, THEME.fluent] },
208-
{ demo: 'PieWithResolvedLabelOverlapping', themes: [THEME.generic, THEME.material] },
208+
{ demo: 'PieWithResolvedLabelOverlapping', themes: [THEME.generic, THEME.material, THEME.fluent] },
209209
{ demo: 'ZoomingAndScrollingAPI', themes: [THEME.generic, THEME.material, THEME.fluent] },
210210
{ demo: 'ZoomingOnAreaSelection', themes: [THEME.generic, THEME.material, THEME.fluent] },
211211
{ demo: 'TooltipHTMLSupport', themes: [THEME.material] },
@@ -232,7 +232,7 @@ const SKIPPED_TESTS = {
232232
{ demo: 'Appearance', themes: [THEME.generic, THEME.material, THEME.fluent] },
233233
{ demo: 'AdvancedMasterDetailView', themes: [THEME.generic, THEME.material, THEME.fluent] },
234234
{ demo: 'BatchEditing', themes: [THEME.generic, THEME.material, THEME.fluent] },
235-
{ demo: 'AjaxRequest', themes: [THEME.generic, THEME.material, THEME.fluent ] },
235+
{ demo: 'AjaxRequest', themes: [THEME.generic, THEME.material, THEME.fluent] },
236236
{ demo: 'InfiniteScrolling', themes: [THEME.generic, THEME.material, THEME.fluent] },
237237
{ demo: 'MasterDetailView', themes: [THEME.generic, THEME.material, THEME.fluent] },
238238
{ demo: 'SimpleArray', themes: [THEME.generic, THEME.material, THEME.fluent] },
@@ -243,7 +243,7 @@ const SKIPPED_TESTS = {
243243
{ demo: 'CustomNewRecordPosition', themes: [THEME.generic, THEME.material, THEME.fluent] },
244244
{ demo: 'Filtering', themes: [THEME.generic, THEME.material, THEME.fluent] },
245245
{ demo: 'FilteringAPI', themes: [THEME.generic, THEME.material, THEME.fluent] },
246-
{ demo: 'GroupSummaries', themes: [THEME.generic, THEME.material, THEME.fluent ] },
246+
{ demo: 'GroupSummaries', themes: [THEME.generic, THEME.material, THEME.fluent] },
247247
{ demo: 'RecordPaging', themes: [THEME.generic, THEME.material, THEME.fluent] },
248248
{ demo: 'RowSelection', themes: [THEME.generic, THEME.material, THEME.fluent] },
249249
{ demo: 'MultipleSelection', themes: [THEME.material, THEME.fluent] },
@@ -283,6 +283,8 @@ const SKIPPED_TESTS = {
283283
{ demo: 'ZoomingOnAreaSelection', themes: [THEME.material] },
284284
{ demo: 'CustomLegendMarkers', themes: [THEME.material] },
285285
{ demo: 'DialogsAndNotificationsOverview', themes: [THEME.material] },
286+
{ demo: 'Crosshair', themes: [THEME.material] },
287+
286288
],
287289
VectorMap: [
288290
{ demo: 'TooltipHTMLSupport', themes: [THEME.material] },
@@ -296,14 +298,18 @@ const SKIPPED_TESTS = {
296298
{ demo: 'RowEditingAndEditingEvents', themes: [THEME.generic, THEME.fluent, THEME.material] },
297299
{ demo: 'EditStateManagement', themes: [THEME.generic, THEME.fluent, THEME.material] },
298300
{ demo: 'FilteringAPI', themes: [THEME.material] },
301+
{ demo: 'PopupEditing', themes: [THEME.generic] },
299302
'StatePersistence',
300303
],
301304
Drawer: [
302305
{ demo: 'TopOrBottomPosition', themes: [THEME.material] },
303306
],
304307
Toolbar: [
305308
{ demo: 'Adaptability', themes: [THEME.generic, THEME.material, THEME.fluent] },
306-
]
309+
],
310+
Accordion: [
311+
{ demo: 'Overview', themes: [THEME.generic, THEME.material, THEME.fluent] },
312+
],
307313
},
308314
React: {
309315
Charts: [
@@ -347,7 +353,7 @@ export function shouldSkipDemo(framework, component, demoName, skippedTests) {
347353
if (typeof test === 'string' && test === demoName) {
348354
return true;
349355
} if (test.demo === demoName
350-
&& test.themes.includes(process.env.THEME || THEME.generic)) {
356+
&& test.themes.includes(process.env.THEME || THEME.generic)) {
351357
return true;
352358
}
353359
}
@@ -381,7 +387,7 @@ export function runTestAtPage(test, demoUrl, shouldSkipJsError) {
381387
if (shouldSkipJsError) {
382388
test.skipJsErrors();
383389
}
384-
390+
385391
if (settings.explicitTests) {
386392
executor = shouldRunTestExplicitly(demoUrl) ? test.only : executor = test.skip;
387393
}
@@ -394,7 +400,7 @@ export function runManualTestCore(testObject, widget, demo, framework, callback)
394400

395401
const index = settings.manualTestIndex;
396402
settings.manualTestIndex += 1;
397-
403+
398404
if (!shouldRunTest(framework, index, widget, demo, SKIPPED_TESTS)) {
399405
return;
400406
}
@@ -411,14 +417,14 @@ export function runManualTestCore(testObject, widget, demo, framework, callback)
411417
const theme = process.env.THEME.replace('generic.', '');
412418
testURL = `http://localhost:8080/Demos/${widget}/${demo}/${framework}/?theme=dx.${theme}`;
413419
} else {
414-
420+
415421
changeTheme(__dirname, `../../Demos/${widget}/${demo}/${framework}/index.html`, process.env.THEME);
416422
testURL = `http://localhost:8080/apps/demos/Demos/${widget}/${demo}/${framework}/`;
417423
}
418424
const test = testObject.clientScripts([
419-
{ module: 'mockdate' },
420-
...clientScriptSource
421-
])
425+
{ module: 'mockdate' },
426+
...clientScriptSource
427+
])
422428
.page(testURL);
423429

424430
test.before?.(async (t) => {

0 commit comments

Comments
 (0)