Skip to content

Commit e518f42

Browse files
authored
Fix unstable tests (#32978)
1 parent 6e473f4 commit e518f42

8 files changed

Lines changed: 294 additions & 6 deletions

File tree

e2e/testcafe-devextreme/tests/dataGrid/common/aiColumn/adaptivity.functional.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ test('The AI column should not be hidden when there is a second AI column with a
150150

151151
test('The AI column should have value in the adaptive detail row', async (t) => {
152152
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
153+
await t.expect(dataGrid.isReady()).ok();
153154

154155
// act
155156
await resolveAIRequest();
156157

157158
// assert
158-
await t.expect(dataGrid.isReady()).ok();
159159

160160
const adaptiveButton = dataGrid.getAdaptiveButton();
161161

e2e/testcafe-devextreme/tests/dataGrid/common/columnReordering/functional.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ fixture.disablePageReloads`Column reordering`
2424
// T975549
2525
test('The column reordering should work correctly when there is a fixed column with zero width', async (t) => {
2626
const dataGrid = new DataGrid('#container');
27+
await t.expect(dataGrid.isReady()).ok();
28+
2729
const headers = dataGrid.getHeaders();
2830
const headerRow = headers.getHeaderRow(0);
2931

@@ -72,6 +74,7 @@ test('The column reordering should work correctly when there is a fixed column w
7274
// T1038094
7375
test('The separator should display correctly when dragging column', async (t) => {
7476
const dataGrid = new DataGrid('#container');
77+
await t.expect(dataGrid.isReady()).ok();
7578

7679
await dataGrid.moveHeader(0, 200, 5, true);
7780

e2e/testcafe-devextreme/tests/dataGrid/common/columnReordering/visual.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ fixture.disablePageReloads`Column reordering.Visual`
1111
test('column separator should work properly with expand columns', async (t) => {
1212
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1313
const dataGrid = new DataGrid('#container');
14+
15+
await t.expect(dataGrid.isReady()).ok();
1416
await MouseUpEvents.disable(MouseAction.dragToOffset);
1517

1618
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30);
@@ -53,6 +55,8 @@ test('column separator should work properly with expand columns', async (t) => {
5355
test('HeaderRow should be highlighted when dragging column with allowColumnReordering=false', async (t) => {
5456
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
5557
const dataGrid = new DataGrid('#container');
58+
await t.expect(dataGrid.isReady()).ok();
59+
5660
await MouseUpEvents.disable(MouseAction.dragToOffset);
5761

5862
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30);
@@ -96,6 +100,8 @@ test('The group separator should not appear when dragging a grouped column to th
96100
const dataGrid = new DataGrid('#container');
97101
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
98102

103+
await t.expect(dataGrid.isReady()).ok();
104+
99105
await t.drag(dataGrid.getGroupPanel().getHeader(0).element, -25, 20);
100106

101107
await testScreenshot(t, takeScreenshot, 'dragging_grouped_column_to_same_position.png', { element: dataGrid.element });

e2e/testcafe-devextreme/tests/dataGrid/common/editing/functional.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,12 @@ fixture`Editing - ShowEditorAlways`
22482248
test('Cells should be focused correctly on click when cell editing mode is used with enabled showEditorAlways (T1037019)', async (t) => {
22492249
const dataGrid = new DataGrid('#container');
22502250

2251+
const getStoredName = ClientFunction((id: number) => (window as any).myStore
2252+
.byKey(id)
2253+
.then((item) => item.Name));
2254+
2255+
await t.expect(dataGrid.isReady()).ok();
2256+
22512257
// act
22522258
await t
22532259
.click(dataGrid.getDataCell(0, 0).getEditor().element);
@@ -2262,9 +2268,10 @@ test('Cells should be focused correctly on click when cell editing mode is used
22622268
// act
22632269
await t
22642270
.typeText(dataGrid.getDataCell(0, 0).getEditor().element, '1')
2265-
.wait(50)
22662271
.click(dataGrid.getDataCell(1, 0).getEditor().element);
22672272

2273+
await t.expect(getStoredName(1)).eql('Name 11');
2274+
22682275
// assert
22692276
await t
22702277
.expect(dataGrid.apiGetCellValue(0, 0))
@@ -2277,9 +2284,10 @@ test('Cells should be focused correctly on click when cell editing mode is used
22772284
// act
22782285
await t
22792286
.typeText(dataGrid.getDataCell(1, 0).getEditor().element, '2')
2280-
.wait(50)
22812287
.click(dataGrid.getDataCell(2, 0).getEditor().element);
22822288

2289+
await t.expect(getStoredName(2)).eql('Name 22');
2290+
22832291
// assert
22842292
await t
22852293
.expect(dataGrid.apiGetCellValue(1, 0))
@@ -2292,9 +2300,10 @@ test('Cells should be focused correctly on click when cell editing mode is used
22922300
// act
22932301
await t
22942302
.typeText(dataGrid.getDataCell(2, 0).getEditor().element, '3')
2295-
.wait(50)
22962303
.click(dataGrid.getDataCell(1, 0).getEditor().element);
22972304

2305+
await t.expect(getStoredName(3)).eql('Name 33');
2306+
22982307
// assert
22992308
await t
23002309
.expect(dataGrid.apiGetCellValue(2, 0))
@@ -2307,9 +2316,10 @@ test('Cells should be focused correctly on click when cell editing mode is used
23072316
// act
23082317
await t
23092318
.typeText(dataGrid.getDataCell(1, 0).getEditor().element, '2')
2310-
.wait(50)
23112319
.click(dataGrid.getDataCell(0, 0).getEditor().element);
23122320

2321+
await t.expect(getStoredName(2)).eql('Name 222');
2322+
23132323
// assert
23142324
await t
23152325
.expect(dataGrid.apiGetCellValue(1, 0))

0 commit comments

Comments
 (0)