-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Datagrid/TreeList - Sticky Columns: Adaptation the column reordering …
…feature (#28040) Co-authored-by: Alyar <>
- Loading branch information
Showing
13 changed files
with
1,182 additions
and
13 deletions.
There are no files selected for viewing
Binary file added
BIN
+47 KB
.../stickyColumns/etalons/move_fixed_band_column_with_sticky_position_to_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.7 KB
...aGrid/stickyColumns/etalons/move_fixed_column_with_sticky_position_to_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.4 KB
...e/tests/dataGrid/stickyColumns/etalons/move_left_fixed_band_column_to_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.8 KB
...xtreme/tests/dataGrid/stickyColumns/etalons/move_left_fixed_column_to_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.5 KB
...e/tests/dataGrid/stickyColumns/etalons/move_right_fixed_band_column_to_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46.8 KB
...xtreme/tests/dataGrid/stickyColumns/etalons/move_right_fixed_column_to_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
201 changes: 201 additions & 0 deletions
201
e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/stickyColumnReordering.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import DataGrid from 'devextreme-testcafe-models/dataGrid'; | ||
import { safeSizeTest } from '../../../helpers/safeSizeTest'; | ||
import { createWidget } from '../../../helpers/createWidget'; | ||
import { getData } from '../helpers/generateDataSourceData'; | ||
import url from '../../../helpers/getPageUrl'; | ||
|
||
const DATA_GRID_SELECTOR = '#container'; | ||
|
||
fixture.disablePageReloads`Reorder columns` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
safeSizeTest('Move left fixed column to the right', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(0).element, 400, 0); | ||
|
||
await takeScreenshot('move_left_fixed_column_to_right.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns[5].fixed = true; | ||
columns[5].fixedPosition = 'left'; | ||
columns[6].fixed = true; | ||
columns[6].fixedPosition = 'left'; | ||
columns[7].fixed = true; | ||
columns[7].fixedPosition = 'left'; | ||
}, | ||
})); | ||
|
||
safeSizeTest('Move right fixed column to the left', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(24).element, -400, 0); | ||
|
||
await takeScreenshot('move_right_fixed_column_to_left.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns[5].fixed = true; | ||
columns[5].fixedPosition = 'right'; | ||
columns[6].fixed = true; | ||
columns[6].fixedPosition = 'right'; | ||
columns[7].fixed = true; | ||
columns[7].fixedPosition = 'right'; | ||
}, | ||
})); | ||
|
||
safeSizeTest('Move fixed column with fixedPosition = \'sticky\' to the right', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(5).element, 200, 0); | ||
|
||
await takeScreenshot('move_fixed_column_with_sticky_position_to_right.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns[5].fixed = true; | ||
columns[5].fixedPosition = 'left'; | ||
columns[6].fixed = true; | ||
columns[6].fixedPosition = 'left'; | ||
|
||
columns[3].fixed = true; | ||
columns[3].fixedPosition = 'sticky'; | ||
|
||
columns[15].fixed = true; | ||
columns[15].fixedPosition = 'right'; | ||
columns[17].fixed = true; | ||
columns[17].fixedPosition = 'right'; | ||
}, | ||
})); | ||
|
||
safeSizeTest('Move left fixed band column to the right', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(1).getHeaderCell(0).element, 500, 0); | ||
|
||
await takeScreenshot('move_left_fixed_band_column_to_right.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns.push({ | ||
caption: 'Band column 1', | ||
fixed: true, | ||
fixedPosition: 'left', | ||
columns: ['field_1', 'field_2'], | ||
}, { | ||
caption: 'Band column 2', | ||
fixed: true, | ||
fixedPosition: 'left', | ||
columns: ['field_3', 'field_4'], | ||
}); | ||
}, | ||
})); | ||
|
||
safeSizeTest('Move right fixed band column to the left', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(1).getHeaderCell(3).element, -500, 0); | ||
|
||
await takeScreenshot('move_right_fixed_band_column_to_left.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns.push({ | ||
caption: 'Band column 1', | ||
fixed: true, | ||
fixedPosition: 'right', | ||
columns: ['field_1', 'field_2'], | ||
}, { | ||
caption: 'Band column 2', | ||
fixed: true, | ||
fixedPosition: 'right', | ||
columns: ['field_3', 'field_4'], | ||
}); | ||
}, | ||
})); | ||
|
||
safeSizeTest('Move fixed band column with fixedPosition=\'sticky\' to the right', async (t) => { | ||
// arrange | ||
const dataGrid = new DataGrid(DATA_GRID_SELECTOR); | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
// act | ||
await t.drag(dataGrid.getHeaders().getHeaderRow(1).getHeaderCell(0).element, 400, 0); | ||
|
||
await takeScreenshot('move_fixed_band_column_with_sticky_position_to_right.png', dataGrid.element); | ||
|
||
// assert | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}, [1000, 800]).before(async () => createWidget('dxDataGrid', { | ||
dataSource: getData(5, 25), | ||
columnAutoWidth: true, | ||
allowColumnReordering: true, | ||
columnWidth: 100, | ||
customizeColumns: (columns) => { | ||
columns.splice(3, 0, { | ||
caption: 'Band column 1', | ||
fixed: true, | ||
fixedPosition: 'sticky', | ||
columns: ['field_1', 'field_2'], | ||
}); | ||
}, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.