Grids - Stabilize tests (Part 3)#34221
Conversation
| await t.expect(draggingElement.exists).notOk(); | ||
| } | ||
|
|
||
| await triggerDragEnd(columnElement); |
There was a problem hiding this comment.
This test was stable, but page reloads are disabled in this fixture, so to prevent any leakage between tests I have added this.
| { dataField: 'Column 1', visible: false }, | ||
| { dataField: 'Column 2' }, | ||
| { dataField: 'Column 3' }, | ||
| { dataField: 'Column 4' }, |
There was a problem hiding this comment.
This matrix tests iterates through [0, 1, 2] for gapIndex. With 4 columns, testcases for gapIndex==1 and gapIndex==2 basically test the same thing: drag from column chooser to the middle of header panel.
With 3 columns, gapIndex==2 now checks the case when column is dragged to the end of header panel
| .ok(); | ||
|
|
||
| await treeList.apiShowErrorToast(); | ||
| await treeList.apiShowErrorToast({ displayTime: 100000 }); |
There was a problem hiding this comment.
toast could disappear before the screenshot is taken, which can lead to instability. So I have added more display time
| await t | ||
| .expect(dataGrid.getLoadPanel().isVisible()) | ||
| .ok(); |
There was a problem hiding this comment.
race condition: load panel can hide before this check runs. The test name doesn't suggest that load panel has to be checked, so I have removed this expect
| [1], | ||
| ]; | ||
|
|
||
| await t.expect(dataGrid.getDataRow(1).element).ok(); |
There was a problem hiding this comment.
wait for the row to appear before checking callback results
| await t | ||
| .pressKey('pagedown'); | ||
| .pressKey('pagedown') | ||
| .expect(dataGrid.isReady()).ok(); |
There was a problem hiding this comment.
pagedown/pageup cause dataSource load, so it's needed to wait for it to finish
|
|
||
| await t.click(dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(19).element); | ||
|
|
||
| await dataGrid.scrollBy(t, { left: 0 }); |
There was a problem hiding this comment.
scrollBy accepts displacement and not the exact position. The ticket suggests that dataGrid has to be scrolled to left, but .scrollBy(t, { left: 0 }); has no effect
| // eslint-disable-next-line no-underscore-dangle | ||
| dataGrid._getTemplate = () => ({ | ||
| render(options) { | ||
| setTimeout(() => { |
There was a problem hiding this comment.
timeouts can affect other tests, since page reloads are disabled
| height: 1500, | ||
| })); | ||
|
|
||
| test('edit => scroll => command, should not result in grid scrolling back to edit', async (t) => { |
There was a problem hiding this comment.
this test written strangely + this behavior won't reproduce in modern browsers, cuz when element is focused, the browser automatically scrolls to it
| await t.wait(100); | ||
| await t | ||
| .pressKey('ctrl+end') | ||
| .expect(dataGrid.isReady()).ok(); |
There was a problem hiding this comment.
ctrl+end causes datasource load, so need to wait for it
No description provided.