Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Functional tests - stabilize anomaly explorer tests #122247

Merged
merged 3 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
22 changes: 15 additions & 7 deletions x-pack/test/functional/services/ml/anomaly_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down