[Datatable] Fix filter cell flakiness (#96934) (#97078)

This commit is contained in:
Stratoula Kalafateli 2021-04-14 10:43:37 +03:00 committed by GitHub
parent 3f2a01ef4f
commit 5e6b35b86f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View file

@ -267,16 +267,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('should apply correct filter', async () => {
await retry.try(async () => {
await PageObjects.visChart.filterOnTableCell(1, 3);
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
const data = await PageObjects.visChart.getTableVisContent();
expect(data).to.be.eql([
['png', '1,373'],
['gif', '918'],
['Other', '445'],
]);
});
await PageObjects.visChart.filterOnTableCell(1, 3);
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
const data = await PageObjects.visChart.getTableVisContent();
expect(data).to.be.eql([
['png', '1,373'],
['gif', '918'],
['Other', '445'],
]);
});
});

View file

@ -419,12 +419,13 @@ export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrPr
public async filterOnTableCell(columnIndex: number, rowIndex: number) {
await retry.try(async () => {
const cell = await dataGrid.getCellElement(rowIndex, columnIndex);
await cell.focus();
await cell.click();
const filterBtn = await testSubjects.findDescendant(
'tbvChartCell__filterForCellValue',
cell
);
await filterBtn.click();
await common.sleep(2000);
filterBtn.click();
});
}