diff --git a/e2e/testcafe-devextreme/tests/cardView/columnChooser/functional.ts b/e2e/testcafe-devextreme/tests/cardView/columnChooser/functional.ts index aebcc8529d41..f8c7ed7e9361 100644 --- a/e2e/testcafe-devextreme/tests/cardView/columnChooser/functional.ts +++ b/e2e/testcafe-devextreme/tests/cardView/columnChooser/functional.ts @@ -56,8 +56,9 @@ function testsFactory(testModel: { assertFirstColumnHidden: (t: TestController, cardView: CardView) => Promise; config: any; // TODO: add typing }) { - test.meta({ unstable: true })(`column chooser in ${testModel.name} mode should work after multiple hide/show actions`, async (t) => { + test(`column chooser in ${testModel.name} mode should work after multiple hide/show actions`, async (t) => { const cardView = new CardView('#container'); + await t.expect(cardView.isReady()).ok(); await cardView.apiShowColumnChooser(); @@ -65,7 +66,6 @@ function testsFactory(testModel: { await testModel.assertFirstColumnHidden(t, cardView); await testModel.showFirstColumn(t, cardView); - await testModel.assertFirstColumnVisible(t, cardView); await testModel.hideFirstColumn(t, cardView); @@ -97,12 +97,14 @@ testsFactory({ async hideFirstColumn(t: TestController, cardView: CardView) { await t.click( cardView.getColumnChooser().getCheckbox(0), + { offsetX: 5, offsetY: 5 }, ); await t.expect(cardView.isReady()).ok(); }, async showFirstColumn(t: TestController, cardView: CardView) { await t.click( cardView.getColumnChooser().getCheckbox(0), + { offsetX: 5, offsetY: 5 }, ); await t.expect(cardView.isReady()).ok(); }, diff --git a/e2e/testcafe-devextreme/tests/cardView/columnSortable/functional.ts b/e2e/testcafe-devextreme/tests/cardView/columnSortable/functional.ts index 67cc6c0e00c9..9ee77dbd93b8 100644 --- a/e2e/testcafe-devextreme/tests/cardView/columnSortable/functional.ts +++ b/e2e/testcafe-devextreme/tests/cardView/columnSortable/functional.ts @@ -11,6 +11,7 @@ import { expectColumns, getColumnItem, triggerDragStart, + triggerDragEnd, SELECTORS, } from './utils'; @@ -36,6 +37,8 @@ fixture.disablePageReloads`CardView - ColumnSortable.Functional` } else { await t.expect(draggingElement.exists).notOk(); } + + await triggerDragEnd(columnElement); }).before(async () => createWidget('dxCardView', { allowColumnReordering, columns: [{ @@ -66,6 +69,8 @@ fixture.disablePageReloads`CardView - ColumnSortable.Functional` } else { await t.expect(draggingElement.exists).notOk(); } + + await triggerDragEnd(columnElement); }).before(async () => createWidget('dxCardView', { allowColumnReordering: true, columns: [{ @@ -102,7 +107,7 @@ fixture.disablePageReloads`CardView - ColumnSortable.Functional` [0, 1].forEach((columnIndex) => { [0, 1, 2].forEach((gapIndex) => { - test.meta({ unstable: true })(`drag from columnChooser to headerPanel: from index ${columnIndex} to index ${gapIndex}`, async (t) => { + test(`drag from columnChooser to headerPanel: from index ${columnIndex} to index ${gapIndex}`, async (t) => { const cardView = new CardView('#container'); await cardView.apiShowColumnChooser(); @@ -110,10 +115,10 @@ fixture.disablePageReloads`CardView - ColumnSortable.Functional` await dragToHeaderPanel(t, cardView, columnElement, gapIndex); - const headerPanelColumns = [2, 3, 4]; + const headerPanelColumns = [2, 3]; headerPanelColumns.splice(gapIndex, 0, columnIndex); - const chooserColumns = [0, 1, 2, 3, 4].filter((c) => !headerPanelColumns.includes(c)); + const chooserColumns = [0, 1].filter((c) => c !== columnIndex); await expectColumns(t, cardView, headerPanelColumns); await expectColumns(t, cardView, chooserColumns, 'columnChooser'); @@ -124,7 +129,6 @@ fixture.disablePageReloads`CardView - ColumnSortable.Functional` { dataField: 'Column 1', visible: false }, { dataField: 'Column 2' }, { dataField: 'Column 3' }, - { dataField: 'Column 4' }, ], })); }); diff --git a/e2e/testcafe-devextreme/tests/common/treeList/toast.ts b/e2e/testcafe-devextreme/tests/common/treeList/toast.ts index 93e47076e37a..1ac20be34678 100644 --- a/e2e/testcafe-devextreme/tests/common/treeList/toast.ts +++ b/e2e/testcafe-devextreme/tests/common/treeList/toast.ts @@ -7,14 +7,14 @@ import { testScreenshot } from '../../../helpers/themeUtils'; fixture.disablePageReloads`Toasts in TreeList` .page(url(__dirname, '../../container.html')); -test('Toast should be visible after calling and should be not visible after default display time', async (t) => { +test('Toast should be visible after calling', async (t) => { const treeList = new TreeList('#container'); const { takeScreenshot, compareResults } = createScreenshotsComparer(t); await t .expect(treeList.isReady()) .ok(); - await treeList.apiShowErrorToast(); + await treeList.apiShowErrorToast({ displayTime: 100000 }); await t.expect(treeList.getToast().exists).ok(); await testScreenshot(t, takeScreenshot, 'ai-column__toast__at-the-right-position.png', { element: treeList.element }); @@ -22,7 +22,24 @@ test('Toast should be visible after calling and should be not visible after defa await t .expect(compareResults.isValid()) .ok(compareResults.errorMessages()); - await t.expect(treeList.getToast().exists).notOk(); +}).before(async () => { + await createWidget('dxTreeList', {}); +}); + +test('Toast should hide after the display time', async (t) => { + const treeList = new TreeList('#container'); + + await t + .expect(treeList.isReady()) + .ok(); + + await treeList.apiShowErrorToast({ displayTime: 1000 }); + await t + .expect(treeList.getToast().exists).ok(); + + await t + .wait(1000) + .expect(treeList.getToast().exists).notOk(); }).before(async () => { await createWidget('dxTreeList', {}); }); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/aiColumn/virtualScrolling.functional.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/aiColumn/virtualScrolling.functional.ts index 08bb56bdc7fe..3bcc7a9a5635 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/aiColumn/virtualScrolling.functional.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/aiColumn/virtualScrolling.functional.ts @@ -24,6 +24,8 @@ const checkAIColumnTexts = async ( } }; +const isAIRequestPending = ClientFunction(() => !!(window as any).aiResolve); + const resolveAIRequest = ClientFunction((): void => { const { aiResponseData } = (window as any); const { aiResolve } = (window as any); @@ -41,16 +43,12 @@ const deleteGlobalVariables = ClientFunction((): void => { delete (window as any).aiResolve; }); -test.meta({ unstable: true })('DataGrid should send an AI request for rendered rows after scrolling without changing the page index', async (t) => { +test('DataGrid should send an AI request for rendered rows after scrolling without changing the page index', async (t) => { // arrange const dataGrid = new DataGrid(DATA_GRID_SELECTOR); - // assert - await t - .expect(dataGrid.getLoadPanel().isVisible()) - .ok(); - // act + await t.expect(isAIRequestPending()).ok(); await resolveAIRequest(); // assert @@ -76,6 +74,7 @@ test.meta({ unstable: true })('DataGrid should send an AI request for rendered r .ok(); // act + await t.expect(isAIRequestPending()).ok(); await resolveAIRequest(); // assert @@ -144,16 +143,12 @@ test.meta({ unstable: true })('DataGrid should send an AI request for rendered r await deleteGlobalVariables(); }); -test.meta({ unstable: true })('DataGrid should send an AI request for rendered rows after scrolling with changing the page index', async (t) => { +test('DataGrid should send an AI request for rendered rows after scrolling with changing the page index', async (t) => { // arrange const dataGrid = new DataGrid(DATA_GRID_SELECTOR); - // assert - await t - .expect(dataGrid.getLoadPanel().isVisible()) - .ok(); - // act + await t.expect(isAIRequestPending()).ok(); await resolveAIRequest(); // assert @@ -179,6 +174,7 @@ test.meta({ unstable: true })('DataGrid should send an AI request for rendered r .ok(); // act + await t.expect(isAIRequestPending()).ok(); await resolveAIRequest(); // assert diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/focus/focusEvents/newRows_T1162227.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/focus/focusEvents/newRows_T1162227.ts index 6fc3e42e929b..4c07828aef26 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/focus/focusEvents/newRows_T1162227.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/focus/focusEvents/newRows_T1162227.ts @@ -245,11 +245,15 @@ test('It should not fire row events if focusedRowEnabled: false', async (t) => { await clearCallbackTesting(); }); -test.meta({ unstable: true })('It should fire rowChanged event on initialization if focusedRowKey options is set', async (t) => { +test('It should fire rowChanged event on initialization if focusedRowKey options is set', async (t) => { + const dataGrid = new DataGrid(GRID_SELECTOR); + const expectedRowFocusChanged: FocusRowChangedData[] = [ [1], ]; + await t.expect(dataGrid.getDataRow(1).element).ok(); + const [ , , diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/headerPanel.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/headerPanel.ts index 6155fc792a9c..bdfb50852195 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/headerPanel.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/headerPanel.ts @@ -87,9 +87,10 @@ test('Drop-down window should be positioned correctly after resizing the toolbar // visual: fluent.blue.light // visual: fluent.blue.dark -test.meta({ unstable: true })('Disabled toolbar buttons are not grayed out in Material themes (T1217416)', async (t) => { +test('Disabled toolbar buttons should be grayed out in Material themes (T1217416)', async (t) => { const { takeScreenshot, compareResults } = createScreenshotsComparer(t); const dataGrid = new DataGrid('#container'); + await t.expect(dataGrid.isReady()).ok(); await testScreenshot(t, takeScreenshot, 'disabled-toolbar-buttons.png', { element: dataGrid.element }); await t diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts index 099752eb961e..885b1405635d 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts @@ -27,7 +27,7 @@ const getOnKeyDownCallCount = ClientFunction(() => (window as any).onKeyDownCall fixture.disablePageReloads`Keyboard Navigation - common` .page(url(__dirname, '../../../container.html')); -test.meta({ unstable: true })('Changing keyboardNavigation options should not invalidate the entire content (T1197829)', async (t) => { +test('Changing keyboardNavigation options should not invalidate the entire content (T1197829)', async (t) => { const dataGrid = new DataGrid('#container'); await t .expect(dataGrid.isReady()) @@ -167,9 +167,7 @@ test('Navigation via the Tab key should work when cellRender/cellComponent is us // eslint-disable-next-line no-underscore-dangle dataGrid._getTemplate = () => ({ render(options) { - setTimeout(() => { - options.deferred?.resolve(); - }, 100); + Promise.resolve().then(() => options.deferred?.resolve()); }, }); @@ -1870,7 +1868,7 @@ test('The expand cell should not lose focus on expanding a master row (T892203)' columns: ['a', 'b'], })); - test.meta({ unstable: true })(`${editMode} mode - Shift+Tab from the first editable cell should move focus to the last header (T1329750)`, async (t) => { + test(`${editMode} mode - Shift+Tab from the first editable cell should move focus to the last header (T1329750)`, async (t) => { const dataGrid = new DataGrid('#container') as any; const cell00 = dataGrid.getDataCell(0, 0); const editor00 = cell00.getEditor(); @@ -1880,7 +1878,6 @@ test('The expand cell should not lose focus on expanding a master row (T892203)' await t .click(cell00.element) - .expect(cell00.isFocused).ok() .expect(editor00.element.focused) .ok() @@ -2970,7 +2967,8 @@ test('New mode. A cell should be focused when the PageDow/Up key is pressed (T89 // act await t - .pressKey('pagedown'); + .pressKey('pagedown') + .expect(dataGrid.isReady()).ok(); // assert const focusedRowIndex = await dataGrid.option('focusedRowIndex'); @@ -2984,7 +2982,8 @@ test('New mode. A cell should be focused when the PageDow/Up key is pressed (T89 // act await t - .pressKey('pageup'); + .pressKey('pageup') + .expect(dataGrid.isReady()).ok(); // assert await t @@ -3066,7 +3065,7 @@ test('New mode. A cell should be focused when the PageDow/Up key is pressed (T89 }); }); -test.meta({ unstable: true })('Cells should be focused after saving data when filter is applied and cell mode is used (T1029906)', async (t) => { +test('Cells should be focused after saving data when filter is applied and cell mode is used (T1029906)', async (t) => { const dataGrid = new DataGrid('#container'); await t .expect(dataGrid.isReady()) @@ -3108,6 +3107,8 @@ test.meta({ unstable: true })('Cells should be focused after saving data when fi .pressKey('d') .pressKey('enter'); + await t.expect(dataGrid.isReady()).ok(); + const visibleRows = await dataGrid.apiGetVisibleRows(); // assert @@ -3147,7 +3148,6 @@ test.meta({ unstable: true })('Cells should be focused after saving data when fi enterKeyDirection: 'column', editOnKeyPress: true, }, - editing: { mode: 'cell', allowUpdating: true, @@ -3691,70 +3691,6 @@ test('Window should not be scrolled after clicking on freespace row (T1104035)', height: 1500, })); -test('edit => scroll => command, should not result in grid scrolling back to edit', async (t) => { - const dataGrid = new DataGrid('#container'); - await t - .expect(dataGrid.isReady()) - .ok(); - - await t.wait(100); - await ClientFunction(() => { - const grid = ($('#container') as any).dxDataGrid('instance'); - setTimeout(() => { - grid.getCellElement(1, 1).trigger('dxclick'); - setTimeout(() => { - grid.getScrollable().scrollTo({ x: 10000 }); - setTimeout( - () => { $('.dx-link-delete').first().trigger('focusin'); }, - 100, - ); - }, 100); - }, 500); - })(); - - await t.wait(100) - .expect(dataGrid.getScrollLeft()) - .notEql(0); -}).before(async () => createWidget('dxDataGrid', { - editing: { - mode: 'cell', - allowUpdating: true, - allowDeleting: true, - }, - width: 900, - scrolling: { - useNative: false, - }, - dataSource: [ - { - ID: 1, Prefix: '1', FirstName: '1', LastName: '1', StateID: '1', BirthDate: '1', - }, { - ID: 2, Prefix: '2', FirstName: '2', LastName: '2', StateID: '2', BirthDate: '2', - }, - ], - columns: [ - { - dataField: 'Prefix', - caption: 'Title', - width: 200, - }, - { dataField: 'FirstName', width: 200 }, - { dataField: 'LastName', width: 200 }, { - dataField: 'Position', - width: 200, - }, { - dataField: 'StateID', - caption: 'State', - width: 200, - - }, { - dataField: 'BirthDate', - dataType: 'date', - width: 200, - }, - ], -})); - test('Navigation shouldn\'t get stuck on cell templates with links in them when navigating from outside the grid (T1123129)', async (t) => { const dataGrid = new DataGrid('#container'); await t @@ -6112,7 +6048,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t @@ -6189,7 +6127,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t @@ -6243,7 +6183,7 @@ test('The last cell should be focused after changing the page size (T1063530)', })(); }); - test.meta({ unstable: true })(`Focus events should be called when pressing the Ctrl + End key when virtual scrolling and columns are enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { + test(`Focus events should be called when pressing the Ctrl + End key when virtual scrolling and columns are enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { // arrange const dataGrid = new DataGrid('#container'); @@ -6267,8 +6207,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); - await t.wait(100); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t @@ -6323,7 +6264,7 @@ test('The last cell should be focused after changing the page size (T1063530)', })(); }); - test.meta({ unstable: true })(`Focus events should be called when pressing the Ctrl + End key when rowRenderingMode is 'virtual' (scrolling.useNative = ${useNativeScrolling})`, async (t) => { + test(`Focus events should be called when pressing the Ctrl + End key when rowRenderingMode is 'virtual' (scrolling.useNative = ${useNativeScrolling})`, async (t) => { // arrange const dataGrid = new DataGrid('#container'); @@ -6349,7 +6290,7 @@ test('The last cell should be focused after changing the page size (T1063530)', // act await t .pressKey('ctrl+end') - .wait(100); + .wait(500); // assert await t @@ -6403,7 +6344,7 @@ test('The last cell should be focused after changing the page size (T1063530)', })(); }); - test.meta({ unstable: true })(`Focus events should be called when pressing the Ctrl + End key when infinite scrolling is enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { + test(`Focus events should be called when pressing the Ctrl + End key when infinite scrolling is enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { // arrange const dataGrid = new DataGrid('#container'); @@ -6430,7 +6371,7 @@ test('The last cell should be focused after changing the page size (T1063530)', // act await t .pressKey('ctrl+end') - .wait(100); + .wait(500); // assert await t @@ -6508,7 +6449,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t @@ -6596,7 +6539,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t @@ -6661,7 +6606,7 @@ test('The last cell should be focused after changing the page size (T1063530)', })(); }); - test.meta({ unstable: true })(`Focus events should be called when pressing the Ctrl + End key when virtual columns, virtual scrolling and focusedRowEnabled are enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { + test(`Focus events should be called when pressing the Ctrl + End key when virtual columns, virtual scrolling and focusedRowEnabled are enabled (scrolling.useNative = ${useNativeScrolling})`, async (t) => { // arrange const dataGrid = new DataGrid('#container'); @@ -6685,8 +6630,9 @@ test('The last cell should be focused after changing the page size (T1063530)', await resetFocusedEventsTestData(); // act - await t.pressKey('ctrl+end'); - await t.wait(1000); + await t + .pressKey('ctrl+end') + .wait(500); // assert await t diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.visual.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.visual.ts index 29f837bd4ad7..efce971515c0 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.visual.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.visual.ts @@ -720,7 +720,7 @@ test('Navigate to first cell in the first row when virtual scrolling and columns }, })); - test(`${useNative ? 'Native' : 'Simulated'} scrolling: Focus should be on the last focusable cell when pressing the Ctrl + Home key when row dragging, virtual scrolling and columns are enabled`, async (t) => { + test(`${useNative ? 'Native' : 'Simulated'} scrolling: Focus should be on the last focusable cell when pressing the Ctrl + End key when row dragging, virtual scrolling and columns are enabled`, async (t) => { // arrange const dataGrid = new DataGrid('#container'); const { takeScreenshot, compareResults } = createScreenshotsComparer(t); @@ -732,7 +732,7 @@ test('Navigate to first cell in the first row when virtual scrolling and columns await t .click(dataGrid.getDataCell(0, 0).element) .pressKey('ctrl+end') - .wait(1000); + .wait(2000); await testScreenshot(t, takeScreenshot, `${useNative ? 'native' : 'simulated'}_scrolling_-_navigate_to_last_cell_row_dragging__virtual_scrolling__virtual_columns.png`, { element: dataGrid.element }); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/markup/T838734_alternateRowSizes.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/markup/T838734_alternateRowSizes.ts index 274b3c2e6e96..27caf1ffdb84 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/markup/T838734_alternateRowSizes.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/markup/T838734_alternateRowSizes.ts @@ -15,9 +15,10 @@ const generateData = (rowCount) => new Array(rowCount).fill(null).map((_, idx) = C: `C_${idx}`, })); -test.meta({ unstable: true })('Alternate rows should be the same size', async (t) => { +test('Alternate rows should be the same size', async (t) => { const { takeScreenshot, compareResults } = createScreenshotsComparer(t); const dataGrid = new DataGrid(GRID_SELECTOR); + await t.expect(dataGrid.isReady()).ok(); await testScreenshot(t, takeScreenshot, 'T838734_alternate-rows-same-size.png', { element: dataGrid.element }); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/rowDragging/functional.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/rowDragging/functional.ts index 51aca76648cf..b60b5623bf5c 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/rowDragging/functional.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/rowDragging/functional.ts @@ -794,11 +794,15 @@ test('toIndex should not be corrected when source item gets removed from DOM', a }); // T1139685 -test.meta({ unstable: true })('Item should appear in a correct spot when dragging to a different page with scrolling.mode: "virtual"', async (t) => { +test('Item should appear in a correct spot when dragging to a different page with scrolling.mode: "virtual"', async (t) => { const dataGrid = new DataGrid('#container'); await t.expect(dataGrid.isReady()).ok(); - await t.drag(dataGrid.getDataRow(2).getDragCommand(), 0, 32, { speed: 0.95 }); + + await t.dragToElement( + dataGrid.getDataRow(2).getDragCommand(), + dataGrid.getDataRow(4).element, + ); const visibleRows = await dataGrid.apiGetVisibleRows(); const visibleRowKeys = visibleRows.map((row) => row.key); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts index f3865c4088a3..70d87706ce3b 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts @@ -1044,7 +1044,7 @@ test.meta({ browserSize: [800, 800] })('Rows are rendered properly when window c })()); // T1129252 -test.meta({ unstable: true })('The data should display correctly after changing the dataSource and focusedRowIndex options when scroll position is at the end', async (t) => { +test('The data should display correctly after changing the dataSource and focusedRowIndex options when scroll position is at the end', async (t) => { // arrange const dataGrid = new DataGrid('#container'); const { takeScreenshot, compareResults } = createScreenshotsComparer(t); @@ -1067,6 +1067,7 @@ test.meta({ unstable: true })('The data should display correctly after changing .expect(dataGrid.isReady()) .ok(); + await t.expect(dataGrid.apiGetTopVisibleRowData()).eql({ id: 96, text: 'item 96' }); await testScreenshot(t, takeScreenshot, 'grid-virtual-scrolling-T1129252.png', { element: '#container' }); await t .expect(compareResults.isValid()) @@ -1705,7 +1706,7 @@ test.meta({ browserSize: [800, 200] })('Editing buttons should rerender correctl }); // T1181439 -test.meta({ unstable: true })('Restoring focus on re-rendering should be done without unexpected scrolling to the focused element', async (t) => { +test('Restoring focus on re-rendering should be done without unexpected scrolling to the focused element', async (t) => { const dataGrid = new DataGrid('#container'); await t.expect(dataGrid.isReady()).ok(); @@ -1714,7 +1715,7 @@ test.meta({ unstable: true })('Restoring focus on re-rendering should be done wi await t.click(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(19).element); - await dataGrid.scrollBy(t, { left: 0 }); + await dataGrid.scrollBy(t, { left: -1000 }); await dataGrid.scrollBy(t, { top: 50 }); await t.expect(dataGrid.getScrollLeft()).eql(0); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/selection.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/selection.ts index 2c2ce3d0dba7..e0389b27dc63 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/selection.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/selection.ts @@ -248,8 +248,9 @@ test('Sensitivity option change should be correctly handled during runtime chang // --- -test.meta({ unstable: true })('"Select All" checkbox should not react when not visible', async (t) => { +test('"Select All" checkbox should not react when not visible', async (t) => { const dataGrid = new DataGrid('#container'); + await t.expect(dataGrid.isReady()).ok(); const selectAllCheckBox = new CheckBox( dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(0).getEditor().element, diff --git a/e2e/testcafe-devextreme/tests/dataGrid/common/toast.ts b/e2e/testcafe-devextreme/tests/dataGrid/common/toast.ts index e283e0516ace..2ab51400f401 100644 --- a/e2e/testcafe-devextreme/tests/dataGrid/common/toast.ts +++ b/e2e/testcafe-devextreme/tests/dataGrid/common/toast.ts @@ -8,20 +8,39 @@ fixture.disablePageReloads`Toasts in DataGrid`.page( url(__dirname, '../../container.html'), ); -test.meta({ unstable: true })('Toast should be visible after calling and should be not visible after default display time', async (t) => { +test('Toast should be visible after calling and should be not visible after default display time', async (t) => { const dataGrid = new DataGrid('#container'); const { takeScreenshot, compareResults } = createScreenshotsComparer(t); await t .expect(dataGrid.isReady()) .ok(); - await dataGrid.apiShowErrorToast(); + await dataGrid.apiShowErrorToast({ displayTime: 100000 }); + await t.expect(dataGrid.getToast().exists).ok(); await testScreenshot(t, takeScreenshot, 'ai-column__toast__at-the-right-position.png', { element: dataGrid.element }); + await t .expect(compareResults.isValid()) .ok(compareResults.errorMessages()); - await t.expect(dataGrid.getToast().exists).notOk(); +}).before(async () => { + await createWidget('dxDataGrid', {}); +}); + +test('Toast should hide after the display time', async (t) => { + const dataGrid = new DataGrid('#container'); + + await t + .expect(dataGrid.isReady()) + .ok(); + + await dataGrid.apiShowErrorToast({ displayTime: 1000 }); + await t + .expect(dataGrid.getToast().exists).ok(); + + await t + .wait(1000) + .expect(dataGrid.getToast().exists).notOk(); }).before(async () => { await createWidget('dxDataGrid', {}); }); diff --git a/packages/devextreme/js/__internal/grids/grid_core/error_handling/m_error_handling.ts b/packages/devextreme/js/__internal/grids/grid_core/error_handling/m_error_handling.ts index 0445b1edb0e2..b4fa1b0aee6d 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/error_handling/m_error_handling.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/error_handling/m_error_handling.ts @@ -4,6 +4,7 @@ import eventsEngine from '@js/common/core/events/core/events_engine'; import messageLocalization from '@js/common/core/localization/message'; import $ from '@js/core/renderer'; import { each } from '@js/core/utils/iterator'; +import type { Properties as ToastProperties } from '@js/ui/toast'; import type { ColumnsController } from '@ts/grids/grid_core/columns_controller/m_columns_controller'; import type { ResizingController } from '@ts/grids/grid_core/views/m_grid_view'; @@ -158,8 +159,8 @@ export class ErrorHandlingController extends modules.ViewController { } } - public showToastError(message: string) { - this._toastViewController.showToast(message, { type: 'error' }); + public showToastError(message: string, options?: ToastProperties) { + this._toastViewController.showToast(message, { ...options, type: 'error' }); } } diff --git a/packages/testcafe-models/dataGrid/index.ts b/packages/testcafe-models/dataGrid/index.ts index 4a9ce0e9f039..82ce1ec8116c 100644 --- a/packages/testcafe-models/dataGrid/index.ts +++ b/packages/testcafe-models/dataGrid/index.ts @@ -1,6 +1,7 @@ import { ClientFunction, Selector } from 'testcafe'; import DataGridInstance from 'devextreme/ui/data_grid'; import type { SelectionSensitivity } from 'devextreme/ui/data_grid'; +import type { Properties as ToastProperties } from 'devextreme/ui/toast'; import Toolbar from '../toolbar'; import DataRow from './data/row'; import GroupRow from './groupRow'; @@ -1051,13 +1052,13 @@ export default class DataGrid extends GridCore { )(); } - apiShowErrorToast(): Promise { + apiShowErrorToast(options?: ToastProperties): Promise { const { getInstance } = this; return ClientFunction(() => { const gridInstance = getInstance() as any; - gridInstance.getController('errorHandling').showToastError('Error'); + gridInstance.getController('errorHandling').showToastError('Error', options); }, - { dependencies: { getInstance } }, + { dependencies: { getInstance, options } }, )(); }