mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
Fixes https://github.com/elastic/kibana/issues/25892 This should address the flakiness observed in this issue by retrying if there is a stale element in the complex `PageObjects.visualize.filterOnTableCell()` method, and using `testSubjects.getVisibleText()` rather than calling `getVisibleText()` directly on the element without retrying.
This commit is contained in:
parent
3b7cca2e2a
commit
a24dc1543b
1 changed files with 26 additions and 23 deletions
|
@ -942,8 +942,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
||||||
* If you are writing new tests, you should rather look into getTableVisContent method instead.
|
* If you are writing new tests, you should rather look into getTableVisContent method instead.
|
||||||
*/
|
*/
|
||||||
async getTableVisData() {
|
async getTableVisData() {
|
||||||
const dataTable = await testSubjects.find('paginated-table-body');
|
return await testSubjects.getVisibleText('paginated-table-body');
|
||||||
return await dataTable.getVisibleText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -952,6 +951,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
||||||
* cell values into arrays. Please use this function for newer tests.
|
* cell values into arrays. Please use this function for newer tests.
|
||||||
*/
|
*/
|
||||||
async getTableVisContent({ stripEmptyRows = true } = { }) {
|
async getTableVisContent({ stripEmptyRows = true } = { }) {
|
||||||
|
return await retry.try(async () => {
|
||||||
const container = await testSubjects.find('tableVis');
|
const container = await testSubjects.find('tableVis');
|
||||||
const allTables = await testSubjects.findAllDescendant('paginated-table-body', container);
|
const allTables = await testSubjects.findAllDescendant('paginated-table-body', container);
|
||||||
|
|
||||||
|
@ -975,6 +975,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return allData;
|
return allData;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getInspectorTableData() {
|
async getInspectorTableData() {
|
||||||
|
@ -1144,11 +1145,13 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async filterOnTableCell(column, row) {
|
async filterOnTableCell(column, row) {
|
||||||
|
await retry.try(async () => {
|
||||||
const table = await testSubjects.find('tableVis');
|
const table = await testSubjects.find('tableVis');
|
||||||
const cell = await table.findByCssSelector(`tbody tr:nth-child(${row}) td:nth-child(${column})`);
|
const cell = await table.findByCssSelector(`tbody tr:nth-child(${row}) td:nth-child(${column})`);
|
||||||
await remote.moveMouseTo(cell);
|
await remote.moveMouseTo(cell);
|
||||||
const filterBtn = await testSubjects.findDescendant('filterForCellValue', cell);
|
const filterBtn = await testSubjects.findDescendant('filterForCellValue', cell);
|
||||||
await filterBtn.click();
|
await filterBtn.click();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleLegend(show = true) {
|
async toggleLegend(show = true) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue