mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This PR stabilizes the anomaly explorer tests for adding a swim lane to a dashboard by validating the dashboard table row count after filtering. Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
This commit is contained in:
parent
1c87eee95c
commit
4b2c69ef50
3 changed files with 19 additions and 9 deletions
|
@ -86,6 +86,9 @@ export const AddToDashboardControl: FC<AddToDashboardControlProps> = ({
|
|||
pagination={true}
|
||||
sorting={true}
|
||||
data-test-subj={`mlDashboardSelectionTable${isLoading ? ' loading' : ' loaded'}`}
|
||||
rowProps={(item) => ({
|
||||
'data-test-subj': `mlDashboardSelectionTableRow row-${item.id}`,
|
||||
})}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiModalBody>
|
||||
|
|
|
@ -63,8 +63,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const ml = getService('ml');
|
||||
const elasticChart = getService('elasticChart');
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/118584
|
||||
describe.skip('anomaly explorer', function () {
|
||||
describe('anomaly explorer', function () {
|
||||
this.tags(['mlqa']);
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
|
||||
|
|
|
@ -121,13 +121,21 @@ export function MachineLearningAnomalyExplorerProvider({
|
|||
});
|
||||
},
|
||||
|
||||
async filterDashboardSearchWithSearchString(filter: string) {
|
||||
await this.waitForDashboardsToLoad();
|
||||
const searchBarInput = await testSubjects.find('mlDashboardsSearchBox');
|
||||
await searchBarInput.clearValueWithKeyboard();
|
||||
await searchBarInput.type(filter);
|
||||
await this.assertDashboardSearchInputValue(filter);
|
||||
await this.waitForDashboardsToLoad();
|
||||
async filterDashboardSearchWithSearchString(filter: string, expectedRowCount: number = 1) {
|
||||
await retry.tryForTime(20 * 1000, async () => {
|
||||
await this.waitForDashboardsToLoad();
|
||||
const searchBarInput = await testSubjects.find('mlDashboardsSearchBox');
|
||||
await searchBarInput.clearValueWithKeyboard();
|
||||
await searchBarInput.type(filter);
|
||||
await this.assertDashboardSearchInputValue(filter);
|
||||
await this.waitForDashboardsToLoad();
|
||||
|
||||
const dashboardRows = await testSubjects.findAll('~mlDashboardSelectionTableRow', 2000);
|
||||
expect(dashboardRows.length).to.eql(
|
||||
expectedRowCount,
|
||||
`Dashboard table should have ${expectedRowCount} rows, got ${dashboardRows.length}`
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
async assertDashboardSearchInputValue(expectedSearchValue: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue