-
+
{
+ before(async () => {
+ await esArchiver.load('empty_kibana');
+ });
+
+ after(async () => {
+ await esArchiver.unload('empty_kibana');
+ });
+
+ it('loads the home page', async () => {
+ await ml.navigateTo();
+ });
+
+ it('loads the job management page', async () => {
+ await ml.navigateToJobManagement();
+ await ml.assertJobStatsBarExists();
+ await ml.assertJobTableExists();
+ await ml.assertCreateNewJobButtonExists();
+ });
+
+ it('loads the anomaly explorer page', async () => {
+ await ml.navigateToAnomalyExplorert();
+ await ml.assertAnomalyExplorerEmptyListMessageExists();
+ });
+
+ it('loads the single metric viewer page', async () => {
+ await ml.navigateToSingleMetricViewer();
+ await ml.assertSingleMetricViewerEmptyListMessageExsist();
+ });
+
+ it('loads the data visualizer page', async () => {
+ await ml.navigateToDataVisualizer();
+ await ml.assertDataVisualizerImportDataCardExists();
+ await ml.assertDataVisualizerIndexDataCardExists();
+ });
+
+ it('loads the settings page', async () => {
+ await ml.navigateToSettings();
+ await ml.assertSettingsCalendarLinkExists();
+ await ml.assertSettingsFilterlistLinkExists();
+ });
+ });
+}
diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js
index 581230aced693..13e4b50701fe6 100644
--- a/x-pack/test/functional/config.js
+++ b/x-pack/test/functional/config.js
@@ -54,6 +54,7 @@ import {
AceEditorProvider,
GrokDebuggerProvider,
UptimeProvider,
+ MachineLearningProvider,
} from './services';
@@ -87,7 +88,8 @@ export default async function ({ readConfigFile }) {
resolve(__dirname, './apps/maps'),
resolve(__dirname, './apps/status_page'),
resolve(__dirname, './apps/upgrade_assistant'),
- resolve(__dirname, './apps/uptime')
+ resolve(__dirname, './apps/uptime'),
+ resolve(__dirname, './apps/ml'),
],
// define the name and providers for services that should be
@@ -124,6 +126,7 @@ export default async function ({ readConfigFile }) {
grokDebugger: GrokDebuggerProvider,
uptime: UptimeProvider,
rollup: RollupPageProvider,
+ ml: MachineLearningProvider,
},
// just like services, PageObjects are defined as a map of
@@ -213,7 +216,10 @@ export default async function ({ readConfigFile }) {
rollupJob: {
pathname: '/app/kibana',
hash: '/management/elasticsearch/rollup_jobs/'
- }
+ },
+ ml: {
+ pathname: '/app/ml'
+ },
},
// choose where esArchiver should load archives from
diff --git a/x-pack/test/functional/services/index.js b/x-pack/test/functional/services/index.js
index 1c88c993d2b56..23d12aafbd331 100644
--- a/x-pack/test/functional/services/index.js
+++ b/x-pack/test/functional/services/index.js
@@ -11,3 +11,4 @@ export { RandomProvider } from './random';
export { AceEditorProvider } from './ace_editor';
export { GrokDebuggerProvider } from './grok_debugger';
export { UptimeProvider } from './uptime';
+export { MachineLearningProvider } from './ml';
diff --git a/x-pack/test/functional/services/ml.ts b/x-pack/test/functional/services/ml.ts
new file mode 100644
index 0000000000000..43ef997be7db0
--- /dev/null
+++ b/x-pack/test/functional/services/ml.ts
@@ -0,0 +1,82 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { KibanaFunctionalTestDefaultProviders } from '../../types/providers';
+
+export function MachineLearningProvider({
+ getService,
+ getPageObjects,
+}: KibanaFunctionalTestDefaultProviders) {
+ const testSubjects = getService('testSubjects');
+ const PageObjects = getPageObjects(['common']);
+
+ return {
+ async navigateTo() {
+ return await PageObjects.common.navigateToApp('ml');
+ },
+
+ async navigateToJobManagement() {
+ await testSubjects.click('mlTabJobManagement');
+ await testSubjects.exists('mlPageJobManagement');
+ },
+
+ async navigateToAnomalyExplorert() {
+ await testSubjects.click('mlTabAnomalyExplorer');
+ await testSubjects.exists('mlPageAnomalyExplorer');
+ },
+
+ async navigateToSingleMetricViewer() {
+ await testSubjects.click('mlTabSingleMetricViewer');
+ await testSubjects.exists('mlPageSingleMetricViewer');
+ },
+
+ async navigateToDataVisualizer() {
+ await testSubjects.click('mlTabDataVisualizer');
+ await testSubjects.exists('mlPageDataVisualizerSelector');
+ },
+
+ async navigateToSettings() {
+ await testSubjects.click('mlTabSettings');
+ await testSubjects.exists('mlPageSettings');
+ },
+
+ async assertJobTableExists() {
+ await testSubjects.existOrFail('mlJobListTable');
+ },
+
+ async assertCreateNewJobButtonExists() {
+ await testSubjects.existOrFail('mlCreateNewJobButton');
+ },
+
+ async assertJobStatsBarExists() {
+ await testSubjects.existOrFail('mlJobStatsBar');
+ },
+
+ async assertAnomalyExplorerEmptyListMessageExists() {
+ await testSubjects.existOrFail('mlNoJobsFound');
+ },
+
+ async assertSingleMetricViewerEmptyListMessageExsist() {
+ await testSubjects.existOrFail('mlNoSingleMetricJobsFound');
+ },
+
+ async assertDataVisualizerImportDataCardExists() {
+ await testSubjects.existOrFail('mlDataVisualizerCardImportData');
+ },
+
+ async assertDataVisualizerIndexDataCardExists() {
+ await testSubjects.existOrFail('mlDataVisualizerCardIndexData');
+ },
+
+ async assertSettingsCalendarLinkExists() {
+ await testSubjects.existOrFail('ml_calendar_mng_button');
+ },
+
+ async assertSettingsFilterlistLinkExists() {
+ await testSubjects.existOrFail('ml_filter_lists_button');
+ },
+ };
+}