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] Make navigation in tests more stable #50132

Merged
merged 3 commits into from
Nov 12, 2019
Merged
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
26 changes: 12 additions & 14 deletions x-pack/test/functional/services/machine_learning/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ export function MachineLearningNavigationProvider({
},

async navigateToArea(linkSubject: string, pageSubject: string) {
await retry.tryForTime(2 * 60 * 1000, async () => {
if ((await testSubjects.exists(`${linkSubject} selected`)) === false) {
await testSubjects.click(linkSubject);
await testSubjects.existOrFail(`${linkSubject} selected`, { timeout: 30 * 1000 });
await testSubjects.existOrFail(pageSubject, { timeout: 30 * 1000 });
}
await testSubjects.click(linkSubject);
await retry.tryForTime(60 * 1000, async () => {
await testSubjects.existOrFail(`${linkSubject} & ~selected`);
await testSubjects.existOrFail(pageSubject);
});
},

Expand All @@ -51,11 +49,11 @@ export function MachineLearningNavigationProvider({
},

async navigateToOverview() {
await this.navigateToArea('mlMainTab overview', 'mlPageOverview');
await this.navigateToArea('~mlMainTab & ~overview', 'mlPageOverview');
},

async navigateToAnomalyDetection() {
await this.navigateToArea('mlMainTab anomalyDetection', 'mlPageJobManagement');
await this.navigateToArea('~mlMainTab & ~anomalyDetection', 'mlPageJobManagement');
await this.assertTabsExist('mlSubTab', [
'jobManagement',
'anomalyExplorer',
Expand All @@ -65,33 +63,33 @@ export function MachineLearningNavigationProvider({
},

async navigateToDataFrameAnalytics() {
await this.navigateToArea('mlMainTab dataFrameAnalytics', 'mlPageDataFrameAnalytics');
await this.navigateToArea('~mlMainTab & ~dataFrameAnalytics', 'mlPageDataFrameAnalytics');
await this.assertTabsExist('mlSubTab', []);
},

async navigateToDataVisualizer() {
await this.navigateToArea('mlMainTab dataVisualizer', 'mlPageDataVisualizerSelector');
await this.navigateToArea('~mlMainTab & ~dataVisualizer', 'mlPageDataVisualizerSelector');
await this.assertTabsExist('mlSubTab', []);
},

async navigateToJobManagement() {
await this.navigateToAnomalyDetection();
await this.navigateToArea('mlSubTab jobManagement', 'mlPageJobManagement');
await this.navigateToArea('~mlSubTab & ~jobManagement', 'mlPageJobManagement');
},

async navigateToAnomalyExplorer() {
await this.navigateToAnomalyDetection();
await this.navigateToArea('mlSubTab anomalyExplorer', 'mlPageAnomalyExplorer');
await this.navigateToArea('~mlSubTab & ~anomalyExplorer', 'mlPageAnomalyExplorer');
},

async navigateToSingleMetricViewer() {
await this.navigateToAnomalyDetection();
await this.navigateToArea('mlSubTab singleMetricViewer', 'mlPageSingleMetricViewer');
await this.navigateToArea('~mlSubTab & ~singleMetricViewer', 'mlPageSingleMetricViewer');
},

async navigateToSettings() {
await this.navigateToAnomalyDetection();
await this.navigateToArea('mlSubTab settings', 'mlPageSettings');
await this.navigateToArea('~mlSubTab & ~settings', 'mlPageSettings');
},
};
}