From c0f2e4b9d1cae32c937a86b29e4702d3ac835af0 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Thu, 3 Feb 2022 13:26:27 +0100
Subject: [PATCH 01/10] update side nav tests for full ml access
---
.../components/ml_page/side_nav.tsx | 5 ++--
.../apps/ml/permissions/full_ml_access.ts | 24 +++++++++++++------
.../test/functional/services/ml/navigation.ts | 24 +++++++++++++++++++
3 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/x-pack/plugins/ml/public/application/components/ml_page/side_nav.tsx b/x-pack/plugins/ml/public/application/components/ml_page/side_nav.tsx
index 872337f71fe82..39672b14bf836 100644
--- a/x-pack/plugins/ml/public/application/components/ml_page/side_nav.tsx
+++ b/x-pack/plugins/ml/public/application/components/ml_page/side_nav.tsx
@@ -111,6 +111,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
}),
pathId: ML_PAGES.SINGLE_METRIC_VIEWER,
disabled: disableLinks,
+ testSubj: 'mlMainTab singleMetricViewer',
},
{
id: 'settings',
@@ -185,7 +186,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
defaultMessage: 'File',
}),
disabled: false,
- testSubj: 'mlMainTab dataVisualizer fileDatavisualizer',
+ testSubj: 'mlMainTab fileDataVisualizer',
},
{
id: 'data_view_datavisualizer',
@@ -194,7 +195,7 @@ export function useSideNavItems(activeRoute: MlRoute | undefined) {
defaultMessage: 'Data View',
}),
disabled: false,
- testSubj: 'mlMainTab dataVisualizer dataViewDatavisualizer',
+ testSubj: 'mlMainTab indexDataVisualizer',
},
],
},
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index 71c0d101943b9..1c20240bbba18 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -44,7 +44,7 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.assertKibanaNavMLEntryExists();
});
- it('should display tabs in the ML app correctly', async () => {
+ it('should display side nav in the ML app correctly', async () => {
await ml.testExecution.logTestStep('should load the ML app');
await ml.navigation.navigateToMl();
@@ -52,20 +52,30 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.assertOverviewTabEnabled(true);
await ml.testExecution.logTestStep(
- 'should display the enabled "Anomaly Detection" tab'
+ 'should display the enabled "Anomaly Detection" section correctly'
);
await ml.navigation.assertAnomalyDetectionTabEnabled(true);
+ await ml.navigation.assertAnomalyExplorerNavItemEnabled(true);
+ await ml.navigation.assertSingleMetricViewerNavItemEnabled(true);
+ await ml.navigation.assertSettingsTabEnabled(true);
await ml.testExecution.logTestStep(
- 'should display the enabled "Data Frame Analytics" tab'
+ 'should display the enabled "Data Frame Analytics" section'
);
await ml.navigation.assertDataFrameAnalyticsTabEnabled(true);
- await ml.testExecution.logTestStep('should display the enabled "Data Visualizer" tab');
- await ml.navigation.assertDataVisualizerTabEnabled(true);
+ await ml.testExecution.logTestStep(
+ 'should display the enabled "Model Management" section'
+ );
+ await ml.navigation.assertTrainedModelsNavItemEnabled(true);
+ await ml.navigation.assertNodesNavItemEnabled(true);
- await ml.testExecution.logTestStep('should display the enabled "Settings" tab');
- await ml.navigation.assertSettingsTabEnabled(true);
+ await ml.testExecution.logTestStep(
+ 'should display the enabled "Data Visualizer" section'
+ );
+ await ml.navigation.assertDataVisualizerTabEnabled(true);
+ await ml.navigation.assertFileDataVisualizerNavItemEnabled(true);
+ await ml.navigation.assertIndexDataVisualizerNavItemEnabled(true);
});
it('should display elements on ML Overview page correctly', async () => {
diff --git a/x-pack/test/functional/services/ml/navigation.ts b/x-pack/test/functional/services/ml/navigation.ts
index c11721453d10f..6bf753926c72a 100644
--- a/x-pack/test/functional/services/ml/navigation.ts
+++ b/x-pack/test/functional/services/ml/navigation.ts
@@ -106,14 +106,38 @@ export function MachineLearningNavigationProvider({
await this.assertTabEnabled('~mlMainTab & ~anomalyDetection', expectedValue);
},
+ async assertAnomalyExplorerNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~anomalyExplorer', expectedValue);
+ },
+
+ async assertSingleMetricViewerNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~singleMetricViewer', expectedValue);
+ },
+
async assertDataFrameAnalyticsTabEnabled(expectedValue: boolean) {
await this.assertTabEnabled('~mlMainTab & ~dataFrameAnalytics', expectedValue);
},
+ async assertTrainedModelsNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~trainedModels', expectedValue);
+ },
+
+ async assertNodesNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~nodesOverview', expectedValue);
+ },
+
async assertDataVisualizerTabEnabled(expectedValue: boolean) {
await this.assertTabEnabled('~mlMainTab & ~dataVisualizer', expectedValue);
},
+ async assertFileDataVisualizerNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~fileDataVisualizer', expectedValue);
+ },
+
+ async assertIndexDataVisualizerNavItemEnabled(expectedValue: boolean) {
+ await this.assertTabEnabled('~mlMainTab & ~indexDataVisualizer', expectedValue);
+ },
+
async assertSettingsTabEnabled(expectedValue: boolean) {
await this.assertTabEnabled('~mlMainTab & ~settings', expectedValue);
},
From 91aa88067c6be1ace5fdfac427a2f457478b2a05 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Fri, 4 Feb 2022 17:04:17 +0100
Subject: [PATCH 02/10] ML nodes tests
---
.../application/components/stats_bar/stat.tsx | 4 +-
.../nodes_overview/nodes_list.tsx | 5 ++-
.../apps/ml/permissions/full_ml_access.ts | 9 ++++-
x-pack/test/functional/services/ml/index.ts | 3 ++
.../functional/services/ml/ml_nodes_list.ts | 37 +++++++++++++++++++
5 files changed, 53 insertions(+), 5 deletions(-)
create mode 100644 x-pack/test/functional/services/ml/ml_nodes_list.ts
diff --git a/x-pack/plugins/ml/public/application/components/stats_bar/stat.tsx b/x-pack/plugins/ml/public/application/components/stats_bar/stat.tsx
index e08e75143447c..ae04a7a3b2448 100644
--- a/x-pack/plugins/ml/public/application/components/stats_bar/stat.tsx
+++ b/x-pack/plugins/ml/public/application/components/stats_bar/stat.tsx
@@ -11,6 +11,7 @@ export interface StatsBarStat {
label: string;
value: number;
show?: boolean;
+ 'data-test-subj'?: string;
}
interface StatProps {
stat: StatsBarStat;
@@ -19,7 +20,8 @@ interface StatProps {
export const Stat: FC = ({ stat }) => {
return (
- {stat.label}: {stat.value}
+ {stat.label}:{' '}
+ {stat.value}
);
};
diff --git a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/nodes_list.tsx b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/nodes_list.tsx
index 573dd6b3af2d3..bf29dffc5b852 100644
--- a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/nodes_list.tsx
+++ b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/nodes_list.tsx
@@ -157,6 +157,7 @@ export const NodesList: FC = ({ compactView = false }) => {
label: i18n.translate('xpack.ml.trainedModels.nodesList.totalAmountLabel', {
defaultMessage: 'Total machine learning nodes',
}),
+ 'data-test-subj': 'mlTotalNodesCount',
},
};
}, [items]);
@@ -189,7 +190,7 @@ export const NodesList: FC = ({ compactView = false }) => {
}
return (
- <>
+
{nodesStats && (
@@ -218,6 +219,6 @@ export const NodesList: FC = ({ compactView = false }) => {
data-test-subj={isLoading ? 'mlNodesTable loading' : 'mlNodesTable loaded'}
/>
- >
+
);
};
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index 1c20240bbba18..4702e96bae0c2 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -82,11 +82,16 @@ export default function ({ getService }: FtrProviderContext) {
await ml.testExecution.logTestStep('should load the ML overview page');
await ml.navigation.navigateToOverview();
- await ml.testExecution.logTestStep('should display enabled AD create job button');
+ await ml.testExecution.logTestStep('should display a welcome callout');
+
+ await ml.testExecution.logTestStep('should display ML Nodes panel');
+ await ml.mlNodesPanel.assertNodeOverviewPanel();
+
+ await ml.testExecution.logTestStep('should display Anomaly Detection empty state');
await ml.overviewPage.assertADCreateJobButtonExists();
await ml.overviewPage.assertADCreateJobButtonEnabled(true);
- await ml.testExecution.logTestStep('should display enabled DFA create job button');
+ await ml.testExecution.logTestStep('should display DFA empty state');
await ml.overviewPage.assertDFACreateJobButtonExists();
await ml.overviewPage.assertDFACreateJobButtonEnabled(true);
});
diff --git a/x-pack/test/functional/services/ml/index.ts b/x-pack/test/functional/services/ml/index.ts
index 4b48e4c0269eb..f7fd5efefda33 100644
--- a/x-pack/test/functional/services/ml/index.ts
+++ b/x-pack/test/functional/services/ml/index.ts
@@ -54,6 +54,7 @@ import { MachineLearningDashboardEmbeddablesProvider } from './dashboard_embedda
import { TrainedModelsProvider } from './trained_models';
import { TrainedModelsTableProvider } from './trained_models_table';
import { MachineLearningJobAnnotationsProvider } from './job_annotations_table';
+import { MlNodesPanelProvider } from './ml_nodes_list';
export function MachineLearningProvider(context: FtrProviderContext) {
const commonAPI = MachineLearningCommonAPIProvider(context);
@@ -124,6 +125,7 @@ export function MachineLearningProvider(context: FtrProviderContext) {
const swimLane = SwimLaneProvider(context);
const trainedModels = TrainedModelsProvider(context, api, commonUI);
const trainedModelsTable = TrainedModelsTableProvider(context);
+ const mlNodesPanel = MlNodesPanelProvider(context);
return {
anomaliesTable,
@@ -173,5 +175,6 @@ export function MachineLearningProvider(context: FtrProviderContext) {
testResources,
trainedModels,
trainedModelsTable,
+ mlNodesPanel,
};
}
diff --git a/x-pack/test/functional/services/ml/ml_nodes_list.ts b/x-pack/test/functional/services/ml/ml_nodes_list.ts
new file mode 100644
index 0000000000000..3b94a60f1be35
--- /dev/null
+++ b/x-pack/test/functional/services/ml/ml_nodes_list.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import expect from '@kbn/expect';
+import { FtrProviderContext } from '../../ftr_provider_context';
+
+export function MlNodesPanelProvider({ getService }: FtrProviderContext) {
+ const testSubjects = getService('testSubjects');
+
+ return {
+ async assertNodesOverviewPanelExists() {
+ await testSubjects.existOrFail('mlNodesOverviewPanel');
+ },
+
+ async assertNodesListLoaded() {
+ await testSubjects.existOrFail('mlNodesTable loaded', { timeout: 5000 });
+ },
+
+ async assertMlNodesCount(expectedCount: number = 1) {
+ const actualCount = parseInt(await testSubjects.getVisibleText('mlTotalNodesCount'), 10);
+ expect(actualCount).to.not.be.lessThan(
+ expectedCount,
+ `Total ML nodes count should be at least '${expectedCount}' (got '${actualCount}')`
+ );
+ },
+
+ async assertNodeOverviewPanel() {
+ await this.assertNodesOverviewPanelExists();
+ await this.assertNodesListLoaded();
+ await this.assertMlNodesCount();
+ },
+ };
+}
From 64ddf2ff6a96b240906d280f53bc1c46b10ec074 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 10:28:57 +0100
Subject: [PATCH 03/10] assert empty states
---
.../test/functional/apps/ml/permissions/full_ml_access.ts | 2 ++
x-pack/test/functional/services/ml/overview_page.ts | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index 4702e96bae0c2..92e653a7868f0 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -88,10 +88,12 @@ export default function ({ getService }: FtrProviderContext) {
await ml.mlNodesPanel.assertNodeOverviewPanel();
await ml.testExecution.logTestStep('should display Anomaly Detection empty state');
+ await ml.overviewPage.assertADEmptyStateExists();
await ml.overviewPage.assertADCreateJobButtonExists();
await ml.overviewPage.assertADCreateJobButtonEnabled(true);
await ml.testExecution.logTestStep('should display DFA empty state');
+ await ml.overviewPage.assertDFAEmptyStateExists();
await ml.overviewPage.assertDFACreateJobButtonExists();
await ml.overviewPage.assertDFACreateJobButtonEnabled(true);
});
diff --git a/x-pack/test/functional/services/ml/overview_page.ts b/x-pack/test/functional/services/ml/overview_page.ts
index 8fc04dfa29b18..0f525b538d316 100644
--- a/x-pack/test/functional/services/ml/overview_page.ts
+++ b/x-pack/test/functional/services/ml/overview_page.ts
@@ -13,6 +13,10 @@ export function MachineLearningOverviewPageProvider({ getService }: FtrProviderC
const testSubjects = getService('testSubjects');
return {
+ async assertADEmptyStateExists() {
+ await testSubjects.existOrFail('mlAnomalyDetectionEmptyState');
+ },
+
async assertADCreateJobButtonExists() {
await testSubjects.existOrFail('mlCreateNewJobButton');
},
@@ -27,6 +31,10 @@ export function MachineLearningOverviewPageProvider({ getService }: FtrProviderC
);
},
+ async assertDFAEmptyStateExists() {
+ await testSubjects.existOrFail('mlNoDataFrameAnalyticsFound');
+ },
+
async assertDFACreateJobButtonExists() {
await testSubjects.existOrFail('mlAnalyticsCreateFirstButton');
},
From 8465cf385fe8241a7b4750c6a50e5199aafeb01a Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 10:41:21 +0100
Subject: [PATCH 04/10] assert getting started callout
---
.../components/getting_started_callout.tsx | 7 ++++++-
.../apps/ml/permissions/full_ml_access.ts | 9 +++++++++
.../test/functional/services/ml/overview_page.ts | 14 ++++++++++++++
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/x-pack/plugins/ml/public/application/overview/components/getting_started_callout.tsx b/x-pack/plugins/ml/public/application/overview/components/getting_started_callout.tsx
index f9d734f7b84d5..457bca80ee2c0 100644
--- a/x-pack/plugins/ml/public/application/overview/components/getting_started_callout.tsx
+++ b/x-pack/plugins/ml/public/application/overview/components/getting_started_callout.tsx
@@ -31,6 +31,7 @@ export const GettingStartedCallout: FC = () => {
return (
<>
{
/>
-
+
Date: Mon, 7 Feb 2022 11:55:07 +0100
Subject: [PATCH 05/10] assert panels with data
---
.../apps/ml/permissions/full_ml_access.ts | 14 ++++++++++++++
.../test/functional/services/ml/overview_page.ts | 8 ++++++++
2 files changed, 22 insertions(+)
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index 27acdea83ce0a..d5e31150b9921 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -190,6 +190,20 @@ export default function ({ getService }: FtrProviderContext) {
await ml.securityUI.logout();
});
+ it('should display elements on ML Overview page correctly', async () => {
+ await ml.testExecution.logTestStep('should load the Overview page');
+ await ml.navigation.navigateToOverview();
+
+ await ml.testExecution.logTestStep('should display ML Nodes panel');
+ await ml.mlNodesPanel.assertNodeOverviewPanel();
+
+ await ml.testExecution.logTestStep('should display Anomaly Detection panel');
+ await ml.overviewPage.assertAdJobsOverviewPanelExist();
+
+ await ml.testExecution.logTestStep('should display DFA panel');
+ await ml.overviewPage.assertDFAJobsOverviewPanelExist();
+ });
+
it('should display elements on Anomaly Detection page correctly', async () => {
await ml.testExecution.logTestStep('should load the AD job management page');
await ml.navigation.navigateToMl();
diff --git a/x-pack/test/functional/services/ml/overview_page.ts b/x-pack/test/functional/services/ml/overview_page.ts
index ca2dada67f0f8..5f02edde0f310 100644
--- a/x-pack/test/functional/services/ml/overview_page.ts
+++ b/x-pack/test/functional/services/ml/overview_page.ts
@@ -45,6 +45,10 @@ export function MachineLearningOverviewPageProvider({ getService }: FtrProviderC
);
},
+ async assertAdJobsOverviewPanelExist() {
+ await testSubjects.existOrFail('mlOverviewTableAnomalyDetection');
+ },
+
async assertDFAEmptyStateExists() {
await testSubjects.existOrFail('mlNoDataFrameAnalyticsFound');
},
@@ -63,6 +67,10 @@ export function MachineLearningOverviewPageProvider({ getService }: FtrProviderC
);
},
+ async assertDFAJobsOverviewPanelExist() {
+ await testSubjects.existOrFail('mlOverviewTableAnalytics');
+ },
+
async assertJobSyncRequiredWarningExists() {
await testSubjects.existOrFail('mlJobSyncRequiredWarning', { timeout: 5000 });
},
From dfb8ba3b77330cd9649d759eb344f765bd4f6365 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 12:10:35 +0100
Subject: [PATCH 06/10] assert read ml access
---
.../apps/ml/permissions/read_ml_access.ts | 31 +++++++++++++++----
.../functional/services/ml/ml_nodes_list.ts | 8 +++--
2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
index 9abb30548b0eb..a056a16785684 100644
--- a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
@@ -52,20 +52,30 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.assertOverviewTabEnabled(true);
await ml.testExecution.logTestStep(
- 'should display the enabled "Anomaly Detection" tab'
+ 'should display the enabled "Anomaly Detection" section correctly'
);
await ml.navigation.assertAnomalyDetectionTabEnabled(true);
+ await ml.navigation.assertAnomalyExplorerNavItemEnabled(true);
+ await ml.navigation.assertSingleMetricViewerNavItemEnabled(true);
+ await ml.navigation.assertSettingsTabEnabled(true);
await ml.testExecution.logTestStep(
- 'should display the enabled "Data Frame Analytics" tab'
+ 'should display the enabled "Data Frame Analytics" section'
);
await ml.navigation.assertDataFrameAnalyticsTabEnabled(true);
- await ml.testExecution.logTestStep('should display the enabled "Data Visualizer" tab');
- await ml.navigation.assertDataVisualizerTabEnabled(true);
+ await ml.testExecution.logTestStep(
+ 'should display the enabled "Model Management" section'
+ );
+ await ml.navigation.assertTrainedModelsNavItemEnabled(true);
+ await ml.navigation.assertNodesNavItemEnabled(false);
- await ml.testExecution.logTestStep('should display the enabled "Settings" tab');
- await ml.navigation.assertSettingsTabEnabled(true);
+ await ml.testExecution.logTestStep(
+ 'should display the enabled "Data Visualizer" section'
+ );
+ await ml.navigation.assertDataVisualizerTabEnabled(true);
+ await ml.navigation.assertFileDataVisualizerNavItemEnabled(true);
+ await ml.navigation.assertIndexDataVisualizerNavItemEnabled(true);
});
it('should display elements on ML Overview page correctly', async () => {
@@ -73,11 +83,20 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.navigateToMl();
await ml.navigation.navigateToOverview();
+ await ml.testExecution.logTestStep('should display a welcome callout');
+ await ml.overviewPage.assertGettingStartedCalloutVisible(true);
+ await ml.overviewPage.dismissGettingStartedCallout();
+
+ await ml.testExecution.logTestStep('should not display ML Nodes panel');
+ await ml.mlNodesPanel.assertNodesOverviewPanelExists(false);
+
await ml.testExecution.logTestStep('should display disabled AD create job button');
+ await ml.overviewPage.assertADEmptyStateExists();
await ml.overviewPage.assertADCreateJobButtonExists();
await ml.overviewPage.assertADCreateJobButtonEnabled(false);
await ml.testExecution.logTestStep('should display disabled DFA create job button');
+ await ml.overviewPage.assertDFAEmptyStateExists();
await ml.overviewPage.assertDFACreateJobButtonExists();
await ml.overviewPage.assertDFACreateJobButtonEnabled(false);
});
diff --git a/x-pack/test/functional/services/ml/ml_nodes_list.ts b/x-pack/test/functional/services/ml/ml_nodes_list.ts
index 3b94a60f1be35..02727290d6c2b 100644
--- a/x-pack/test/functional/services/ml/ml_nodes_list.ts
+++ b/x-pack/test/functional/services/ml/ml_nodes_list.ts
@@ -12,8 +12,12 @@ export function MlNodesPanelProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
return {
- async assertNodesOverviewPanelExists() {
- await testSubjects.existOrFail('mlNodesOverviewPanel');
+ async assertNodesOverviewPanelExists(expectPanelExits: boolean = true) {
+ if (expectPanelExits) {
+ await testSubjects.existOrFail('mlNodesOverviewPanel');
+ } else {
+ await testSubjects.missingOrFail('mlNodesOverviewPanel');
+ }
},
async assertNodesListLoaded() {
From 6771e49a52db3b82111577fd0a26711041c1bf17 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 13:59:26 +0100
Subject: [PATCH 07/10] waitForDatePickerIndicatorLoaded
---
x-pack/test/functional/apps/ml/permissions/full_ml_access.ts | 2 ++
x-pack/test/functional/apps/ml/permissions/read_ml_access.ts | 2 ++
x-pack/test/functional/services/ml/common_ui.ts | 4 ++++
3 files changed, 8 insertions(+)
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index d5e31150b9921..5d4be5e65f558 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -83,6 +83,8 @@ export default function ({ getService }: FtrProviderContext) {
await ml.testExecution.logTestStep('should load the ML overview page');
await ml.navigation.navigateToOverview();
+ await ml.commonUI.waitForDatePickerIndicatorLoaded();
+
await ml.testExecution.logTestStep('should display a welcome callout');
await ml.overviewPage.assertGettingStartedCalloutVisible(true);
await ml.overviewPage.dismissGettingStartedCallout();
diff --git a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
index a056a16785684..fd9cb2cb4c79e 100644
--- a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
@@ -83,6 +83,8 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.navigateToMl();
await ml.navigation.navigateToOverview();
+ await ml.commonUI.waitForDatePickerIndicatorLoaded();
+
await ml.testExecution.logTestStep('should display a welcome callout');
await ml.overviewPage.assertGettingStartedCalloutVisible(true);
await ml.overviewPage.dismissGettingStartedCallout();
diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts
index cb9ef179f0626..d6b75f53578a8 100644
--- a/x-pack/test/functional/services/ml/common_ui.ts
+++ b/x-pack/test/functional/services/ml/common_ui.ts
@@ -334,5 +334,9 @@ export function MachineLearningCommonUIProvider({
await PageObjects.spaceSelector.goToSpecificSpace(spaceId);
await PageObjects.spaceSelector.expectHomePage(spaceId);
},
+
+ async waitForDatePickerIndicatorLoaded() {
+ await testSubjects.waitForEnabled('superDatePickerApplyTimeButton');
+ },
};
}
From b00459f9ca2673892fc647eb4a89004749fa02aa Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 14:50:58 +0100
Subject: [PATCH 08/10] add missing step
---
x-pack/test/functional/apps/ml/permissions/full_ml_access.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index 5d4be5e65f558..eff484c51c679 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -194,6 +194,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should display elements on ML Overview page correctly', async () => {
await ml.testExecution.logTestStep('should load the Overview page');
+ await ml.navigation.navigateToMl();
await ml.navigation.navigateToOverview();
await ml.testExecution.logTestStep('should display ML Nodes panel');
From 9ee0b3d7a63c07f34d2e61a1721c446e8ebfb792 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 16:48:49 +0100
Subject: [PATCH 09/10] fix typo
---
x-pack/test/functional/apps/ml/permissions/full_ml_access.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
index eff484c51c679..c038aeba608bd 100644
--- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
+++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts
@@ -103,7 +103,7 @@ export default function ({ getService }: FtrProviderContext) {
await ml.overviewPage.assertDFACreateJobButtonEnabled(true);
await ml.testExecution.logTestStep(
- 'should persist the getting callout state after refresh'
+ 'should persist the getting started callout state after refresh'
);
await browser.refresh();
await ml.overviewPage.assertGettingStartedCalloutVisible(false);
From 3faa423099326a7811d3a801d39554f0558f488b Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Mon, 7 Feb 2022 16:50:30 +0100
Subject: [PATCH 10/10] rename variable
---
x-pack/test/functional/services/ml/ml_nodes_list.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/x-pack/test/functional/services/ml/ml_nodes_list.ts b/x-pack/test/functional/services/ml/ml_nodes_list.ts
index 02727290d6c2b..37cd4143e26cc 100644
--- a/x-pack/test/functional/services/ml/ml_nodes_list.ts
+++ b/x-pack/test/functional/services/ml/ml_nodes_list.ts
@@ -24,11 +24,11 @@ export function MlNodesPanelProvider({ getService }: FtrProviderContext) {
await testSubjects.existOrFail('mlNodesTable loaded', { timeout: 5000 });
},
- async assertMlNodesCount(expectedCount: number = 1) {
+ async assertMlNodesCount(minCount: number = 1) {
const actualCount = parseInt(await testSubjects.getVisibleText('mlTotalNodesCount'), 10);
expect(actualCount).to.not.be.lessThan(
- expectedCount,
- `Total ML nodes count should be at least '${expectedCount}' (got '${actualCount}')`
+ minCount,
+ `Total ML nodes count should be at least '${minCount}' (got '${actualCount}')`
);
},