diff --git a/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts index aff1150997496..6b8fbe8350a43 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/create_annotations.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { Annotation } from '../../../../../plugins/ml/common/types/annotations'; import { createJobConfig, createAnnotationRequestBody } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/annotations/delete_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/delete_annotations.ts index d3451c4d7da0c..5e55fb616cbfb 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/delete_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/delete_annotations.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { testSetupJobConfigs, jobIds, testSetupAnnotations } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/annotations/get_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/get_annotations.ts index 29ad905bd3f2d..b720477abb350 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/get_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/get_annotations.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { omit } from 'lodash'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { testSetupJobConfigs, jobIds, testSetupAnnotations } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts b/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts index bcfb7ab0825b8..a1e4bcac31807 100644 --- a/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts +++ b/x-pack/test/api_integration/apis/ml/annotations/update_annotations.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { ANNOTATION_TYPE } from '../../../../../plugins/ml/common/constants/annotations'; import { Annotation } from '../../../../../plugins/ml/common/types/annotations'; diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/create.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/create.ts index 71703ed019dc5..8eb4d7f756fe5 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/create.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/create.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get.ts b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get.ts index e17870d8c6408..58202ea9b35b3 100644 --- a/x-pack/test/api_integration/apis/ml/anomaly_detectors/get.ts +++ b/x-pack/test/api_integration/apis/ml/anomaly_detectors/get.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/calendars/create_calendars.ts b/x-pack/test/api_integration/apis/ml/calendars/create_calendars.ts index 82f4eee8cc328..e351eafea6e7f 100644 --- a/x-pack/test/api_integration/apis/ml/calendars/create_calendars.ts +++ b/x-pack/test/api_integration/apis/ml/calendars/create_calendars.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/calendars/delete_calendars.ts b/x-pack/test/api_integration/apis/ml/calendars/delete_calendars.ts index eef8479b811b4..575c7c99dde17 100644 --- a/x-pack/test/api_integration/apis/ml/calendars/delete_calendars.ts +++ b/x-pack/test/api_integration/apis/ml/calendars/delete_calendars.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/calendars/get_calendars.ts b/x-pack/test/api_integration/apis/ml/calendars/get_calendars.ts index 0b4f4a8f73ede..a5e65028196fe 100644 --- a/x-pack/test/api_integration/apis/ml/calendars/get_calendars.ts +++ b/x-pack/test/api_integration/apis/ml/calendars/get_calendars.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/calendars/update_calendars.ts b/x-pack/test/api_integration/apis/ml/calendars/update_calendars.ts index 65832ac9ca81e..69a8eb3e06ee8 100644 --- a/x-pack/test/api_integration/apis/ml/calendars/update_calendars.ts +++ b/x-pack/test/api_integration/apis/ml/calendars/update_calendars.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts index 2a39bc14fbb7f..c6043b7a282d4 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/delete.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; import { DataFrameAnalyticsConfig } from '../../../../../plugins/ml/public/application/data_frame_analytics/common'; import { DeepPartial } from '../../../../../plugins/ml/common/types/common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts index d3e4788ee41da..ebae5a80c2337 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/get.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { DataFrameAnalyticsConfig } from '../../../../../plugins/ml/public/application/data_frame_analytics/common'; import { DeepPartial } from '../../../../../plugins/ml/common/types/common'; diff --git a/x-pack/test/api_integration/apis/ml/data_frame_analytics/update.ts b/x-pack/test/api_integration/apis/ml/data_frame_analytics/update.ts index 5dc781657619d..f4964308cd8c9 100644 --- a/x-pack/test/api_integration/apis/ml/data_frame_analytics/update.ts +++ b/x-pack/test/api_integration/apis/ml/data_frame_analytics/update.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; import { DataFrameAnalyticsConfig } from '../../../../../plugins/ml/public/application/data_frame_analytics/common'; import { DeepPartial } from '../../../../../plugins/ml/common/types/common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_histograms.ts b/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_histograms.ts index 1a71894f8423d..299f5f93fd281 100644 --- a/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_histograms.ts +++ b/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_histograms.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_stats.ts b/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_stats.ts index 5373da6a794c7..5795eac9637b1 100644 --- a/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_stats.ts +++ b/x-pack/test/api_integration/apis/ml/data_visualizer/get_field_stats.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/data_visualizer/get_overall_stats.ts b/x-pack/test/api_integration/apis/ml/data_visualizer/get_overall_stats.ts index d87ab16d71c18..fa83807be161a 100644 --- a/x-pack/test/api_integration/apis/ml/data_visualizer/get_overall_stats.ts +++ b/x-pack/test/api_integration/apis/ml/data_visualizer/get_overall_stats.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/fields_service/field_cardinality.ts b/x-pack/test/api_integration/apis/ml/fields_service/field_cardinality.ts index ced4d937863ee..627d9454beeb6 100644 --- a/x-pack/test/api_integration/apis/ml/fields_service/field_cardinality.ts +++ b/x-pack/test/api_integration/apis/ml/fields_service/field_cardinality.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/fields_service/time_field_range.ts b/x-pack/test/api_integration/apis/ml/fields_service/time_field_range.ts index 2128b1fe8d9e1..b1c086ddbb456 100644 --- a/x-pack/test/api_integration/apis/ml/fields_service/time_field_range.ts +++ b/x-pack/test/api_integration/apis/ml/fields_service/time_field_range.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/filters/create_filters.ts b/x-pack/test/api_integration/apis/ml/filters/create_filters.ts index 233c95b190f02..dfec7798ffc0c 100644 --- a/x-pack/test/api_integration/apis/ml/filters/create_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/create_filters.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/filters/delete_filters.ts b/x-pack/test/api_integration/apis/ml/filters/delete_filters.ts index d0323360400be..7a55c2308eb9d 100644 --- a/x-pack/test/api_integration/apis/ml/filters/delete_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/delete_filters.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/filters/get_filters.ts b/x-pack/test/api_integration/apis/ml/filters/get_filters.ts index f0aa7aac7b9e4..5d7900ea5e9d9 100644 --- a/x-pack/test/api_integration/apis/ml/filters/get_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/get_filters.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/filters/update_filters.ts b/x-pack/test/api_integration/apis/ml/filters/update_filters.ts index 87eec99906c34..fbbb94d54c035 100644 --- a/x-pack/test/api_integration/apis/ml/filters/update_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/update_filters.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/ml/job_validation/bucket_span_estimator.ts b/x-pack/test/api_integration/apis/ml/job_validation/bucket_span_estimator.ts index c556a6c28554b..a03432232a7d8 100644 --- a/x-pack/test/api_integration/apis/ml/job_validation/bucket_span_estimator.ts +++ b/x-pack/test/api_integration/apis/ml/job_validation/bucket_span_estimator.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/job_validation/calculate_model_memory_limit.ts b/x-pack/test/api_integration/apis/ml/job_validation/calculate_model_memory_limit.ts index 409bd161e601b..30a387fe33b0e 100644 --- a/x-pack/test/api_integration/apis/ml/job_validation/calculate_model_memory_limit.ts +++ b/x-pack/test/api_integration/apis/ml/job_validation/calculate_model_memory_limit.ts @@ -6,7 +6,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/job_validation/cardinality.ts b/x-pack/test/api_integration/apis/ml/job_validation/cardinality.ts index ed61f234a671d..ddf752bd876cb 100644 --- a/x-pack/test/api_integration/apis/ml/job_validation/cardinality.ts +++ b/x-pack/test/api_integration/apis/ml/job_validation/cardinality.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/job_validation/validate.ts b/x-pack/test/api_integration/apis/ml/job_validation/validate.ts index 5e9b2d68bd6df..dab69498efc77 100644 --- a/x-pack/test/api_integration/apis/ml/job_validation/validate.ts +++ b/x-pack/test/api_integration/apis/ml/job_validation/validate.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import pkg from '../../../../../../package.json'; export default ({ getService }: FtrProviderContext) => { diff --git a/x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples.ts b/x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples.ts index b99a4965adb9d..ccab65e1576a2 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; const start = 1554463535770; const end = 1574316073914; diff --git a/x-pack/test/api_integration/apis/ml/jobs/close_jobs.ts b/x-pack/test/api_integration/apis/ml/jobs/close_jobs.ts index f411595aca995..5b9c5393e81d9 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/close_jobs.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/close_jobs.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { JOB_STATE, DATAFEED_STATE } from '../../../../../plugins/ml/common/constants/states'; import { MULTI_METRIC_JOB_CONFIG, SINGLE_METRIC_JOB_CONFIG, DATAFEED_CONFIG } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/jobs/delete_jobs.ts b/x-pack/test/api_integration/apis/ml/jobs/delete_jobs.ts index 4976b6441c37a..e8f733d2fc6ad 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/delete_jobs.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/delete_jobs.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { MULTI_METRIC_JOB_CONFIG, SINGLE_METRIC_JOB_CONFIG } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/jobs/jobs_summary.ts b/x-pack/test/api_integration/apis/ml/jobs/jobs_summary.ts index 0a6e1ed75020a..f7ff5b118f6ae 100644 --- a/x-pack/test/api_integration/apis/ml/jobs/jobs_summary.ts +++ b/x-pack/test/api_integration/apis/ml/jobs/jobs_summary.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; import { USER } from '../../../../functional/services/ml/security_common'; import { MULTI_METRIC_JOB_CONFIG, SINGLE_METRIC_JOB_CONFIG } from './common_jobs'; diff --git a/x-pack/test/api_integration/apis/ml/modules/get_module.ts b/x-pack/test/api_integration/apis/ml/modules/get_module.ts index e2a5d3cd425dc..a3d060bb1faca 100644 --- a/x-pack/test/api_integration/apis/ml/modules/get_module.ts +++ b/x-pack/test/api_integration/apis/ml/modules/get_module.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; const moduleIds = [ 'apache_ecs', diff --git a/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts b/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts index 6634c4e2ed16c..d50148ec583a0 100644 --- a/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts +++ b/x-pack/test/api_integration/apis/ml/modules/recognize_module.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/modules/setup_module.ts b/x-pack/test/api_integration/apis/ml/modules/setup_module.ts index 6c3eda197f892..bc7fc691bc60d 100644 --- a/x-pack/test/api_integration/apis/ml/modules/setup_module.ts +++ b/x-pack/test/api_integration/apis/ml/modules/setup_module.ts @@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { JOB_STATE, DATAFEED_STATE } from '../../../../../plugins/ml/common/constants/states'; import { Job } from '../../../../../plugins/ml/common/types/anomaly_detection_jobs'; import { USER } from '../../../../functional/services/ml/security_common'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/ml/results/get_anomalies_table_data.ts b/x-pack/test/api_integration/apis/ml/results/get_anomalies_table_data.ts index f769d0d878cb2..d1d7d2e8d78ce 100644 --- a/x-pack/test/api_integration/apis/ml/results/get_anomalies_table_data.ts +++ b/x-pack/test/api_integration/apis/ml/results/get_anomalies_table_data.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { USER } from '../../../../functional/services/ml/security_common'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { Datafeed, Job } from '../../../../../plugins/ml/common/types/anomaly_detection_jobs'; -import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api'; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/api_integration/apis/transform/delete_transforms.ts b/x-pack/test/api_integration/apis/transform/delete_transforms.ts index 136bb85dd5ac2..7f01d2741ad15 100644 --- a/x-pack/test/api_integration/apis/transform/delete_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/delete_transforms.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { TransformEndpointRequest } from '../../../../plugins/transform/common'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { COMMON_REQUEST_HEADERS } from '../../../functional/services/ml/common'; +import { COMMON_REQUEST_HEADERS } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; async function asyncForEach(array: any[], callback: Function) { diff --git a/x-pack/test/api_integration/services/ml.ts b/x-pack/test/api_integration/services/ml.ts index be3b9732f83bf..a8780473fad67 100644 --- a/x-pack/test/api_integration/services/ml.ts +++ b/x-pack/test/api_integration/services/ml.ts @@ -7,16 +7,19 @@ import { FtrProviderContext } from '../../functional/ftr_provider_context'; import { MachineLearningAPIProvider } from '../../functional/services/ml/api'; +import { MachineLearningCommonAPIProvider } from '../../functional/services/ml/common_api'; import { MachineLearningSecurityCommonProvider } from '../../functional/services/ml/security_common'; import { MachineLearningTestResourcesProvider } from '../../functional/services/ml/test_resources'; export function MachineLearningProvider(context: FtrProviderContext) { const api = MachineLearningAPIProvider(context); + const commonAPI = MachineLearningCommonAPIProvider(context); const securityCommon = MachineLearningSecurityCommonProvider(context); const testResources = MachineLearningTestResourcesProvider(context); return { api, + commonAPI, securityCommon, testResources, }; diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts index a8836a463e652..18a7a4b26a752 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts @@ -33,60 +33,6 @@ interface PickFieldsConfig { summaryCountField?: string; } -// type guards -// Detector -const isDetectorWithField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('field'); -}; -const isDetectorWithByField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('byField'); -}; -const isDetectorWithOverField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('overField'); -}; -const isDetectorWithPartitionField = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('partitionField'); -}; -const isDetectorWithExcludeFrequent = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('excludeFrequent'); -}; -const isDetectorWithDescription = (arg: any): arg is Required> => { - return arg.hasOwnProperty('description'); -}; - -// DatafeedConfig -const isDatafeedConfigWithQueryDelay = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('queryDelay'); -}; -const isDatafeedConfigWithFrequency = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('frequency'); -}; -const isDatafeedConfigWithScrollSize = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('scrollSize'); -}; - -// PickFieldsConfig -const isPickFieldsConfigWithCategorizationField = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('categorizationField'); -}; -const isPickFieldsConfigWithSummaryCountField = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('summaryCountField'); -}; - export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); @@ -290,88 +236,80 @@ export default function ({ getService }: FtrProviderContext) { for (const testData of testDataList) { describe(`${testData.suiteTitle}`, function () { - it('job creation loads the job management page', async () => { + it('job creation loads the advanced wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation navigates to job management'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep( + 'job creation loads the new job source selection page' + ); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(testData.jobSource); - }); - it('job creation loads the advanced job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the advanced job wizard page'); await ml.jobTypeSelection.selectAdvancedJob(); }); - it('job creation displays the configure datafeed step', async () => { + it('job creation navigates through the advanced wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the configure datafeed step'); await ml.jobWizardCommon.assertConfigureDatafeedSectionExists(); - }); - it('job creation pre-fills the datafeed query editor', async () => { + await ml.testExecution.logTestStep('job creation pre-fills the datafeed query editor'); await ml.jobWizardAdvanced.assertDatafeedQueryEditorExists(); await ml.jobWizardAdvanced.assertDatafeedQueryEditorValue(defaultValues.datafeedQuery); - }); - it('job creation inputs the query delay', async () => { + await ml.testExecution.logTestStep('job creation inputs the query delay'); await ml.jobWizardAdvanced.assertQueryDelayInputExists(); await ml.jobWizardAdvanced.assertQueryDelayValue(defaultValues.queryDelay); - if (isDatafeedConfigWithQueryDelay(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setQueryDelay(testData.datafeedConfig.queryDelay); + if (testData.datafeedConfig.hasOwnProperty('queryDelay')) { + await ml.jobWizardAdvanced.setQueryDelay(testData.datafeedConfig.queryDelay!); } - }); - it('job creation inputs the frequency', async () => { + await ml.testExecution.logTestStep('job creation inputs the frequency'); await ml.jobWizardAdvanced.assertFrequencyInputExists(); await ml.jobWizardAdvanced.assertFrequencyValue(defaultValues.frequency); - if (isDatafeedConfigWithFrequency(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setFrequency(testData.datafeedConfig.frequency); + if (testData.datafeedConfig.hasOwnProperty('frequency')) { + await ml.jobWizardAdvanced.setFrequency(testData.datafeedConfig.frequency!); } - }); - it('job creation inputs the scroll size', async () => { + await ml.testExecution.logTestStep('job creation inputs the scroll size'); await ml.jobWizardAdvanced.assertScrollSizeInputExists(); await ml.jobWizardAdvanced.assertScrollSizeValue(defaultValues.scrollSize); - if (isDatafeedConfigWithScrollSize(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setScrollSize(testData.datafeedConfig.scrollSize); + if (testData.datafeedConfig.hasOwnProperty('scrollSize')) { + await ml.jobWizardAdvanced.setScrollSize(testData.datafeedConfig.scrollSize!); } - }); - it('job creation pre-fills the time field', async () => { + await ml.testExecution.logTestStep('job creation pre-fills the time field'); await ml.jobWizardAdvanced.assertTimeFieldInputExists(); await ml.jobWizardAdvanced.assertTimeFieldSelection([testData.expected.wizard.timeField]); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects the categorization field', async () => { + await ml.testExecution.logTestStep('job creation selects the categorization field'); await ml.jobWizardAdvanced.assertCategorizationFieldInputExists(); - if (isPickFieldsConfigWithCategorizationField(testData.pickFieldsConfig)) { + if (testData.pickFieldsConfig.hasOwnProperty('categorizationField')) { await ml.jobWizardAdvanced.selectCategorizationField( - testData.pickFieldsConfig.categorizationField + testData.pickFieldsConfig.categorizationField! ); } else { await ml.jobWizardAdvanced.assertCategorizationFieldSelection([]); } - }); - it('job creation selects the summary count field', async () => { + await ml.testExecution.logTestStep('job creation selects the summary count field'); await ml.jobWizardAdvanced.assertSummaryCountFieldInputExists(); - if (isPickFieldsConfigWithSummaryCountField(testData.pickFieldsConfig)) { + if (testData.pickFieldsConfig.hasOwnProperty('summaryCountField')) { await ml.jobWizardAdvanced.selectSummaryCountField( - testData.pickFieldsConfig.summaryCountField + testData.pickFieldsConfig.summaryCountField! ); } else { await ml.jobWizardAdvanced.assertSummaryCountFieldSelection([]); } - }); - it('job creation adds detectors', async () => { + await ml.testExecution.logTestStep('job creation adds detectors'); for (const detector of testData.pickFieldsConfig.detectors) { await ml.jobWizardAdvanced.openCreateDetectorModal(); await ml.jobWizardAdvanced.assertDetectorFunctionInputExists(); @@ -390,128 +328,118 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardAdvanced.assertDetectorDescriptionValue(''); await ml.jobWizardAdvanced.selectDetectorFunction(detector.function); - if (isDetectorWithField(detector)) { - await ml.jobWizardAdvanced.selectDetectorField(detector.field); + if (detector.hasOwnProperty('field')) { + await ml.jobWizardAdvanced.selectDetectorField(detector.field!); } - if (isDetectorWithByField(detector)) { - await ml.jobWizardAdvanced.selectDetectorByField(detector.byField); + if (detector.hasOwnProperty('byField')) { + await ml.jobWizardAdvanced.selectDetectorByField(detector.byField!); } - if (isDetectorWithOverField(detector)) { - await ml.jobWizardAdvanced.selectDetectorOverField(detector.overField); + if (detector.hasOwnProperty('overField')) { + await ml.jobWizardAdvanced.selectDetectorOverField(detector.overField!); } - if (isDetectorWithPartitionField(detector)) { - await ml.jobWizardAdvanced.selectDetectorPartitionField(detector.partitionField); + if (detector.hasOwnProperty('partitionField')) { + await ml.jobWizardAdvanced.selectDetectorPartitionField(detector.partitionField!); } - if (isDetectorWithExcludeFrequent(detector)) { - await ml.jobWizardAdvanced.selectDetectorExcludeFrequent(detector.excludeFrequent); + if (detector.hasOwnProperty('excludeFrequent')) { + await ml.jobWizardAdvanced.selectDetectorExcludeFrequent(detector.excludeFrequent!); } - if (isDetectorWithDescription(detector)) { - await ml.jobWizardAdvanced.setDetectorDescription(detector.description); + if (detector.hasOwnProperty('description')) { + await ml.jobWizardAdvanced.setDetectorDescription(detector.description!); } await ml.jobWizardAdvanced.confirmAddDetectorModal(); } - }); - it('job creation displays detector entries', async () => { + await ml.testExecution.logTestStep('job creation displays detector entries'); for (const [index, detector] of testData.pickFieldsConfig.detectors.entries()) { await ml.jobWizardAdvanced.assertDetectorEntryExists( index, detector.identifier, - isDetectorWithDescription(detector) ? detector.description : undefined + detector.hasOwnProperty('description') ? detector.description! : undefined ); } - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(testData.pickFieldsConfig.bucketSpan); - }); - it('job creation inputs influencers', async () => { + await ml.testExecution.logTestStep('job creation inputs influencers'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection([]); for (const influencer of testData.pickFieldsConfig.influencers) { await ml.jobWizardCommon.addInfluencer(influencer); } - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists({ withAdvancedSection: false, }); await ml.jobWizardCommon.setModelMemoryLimit(testData.pickFieldsConfig.memoryLimit, { withAdvancedSection: false, }); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(testData.jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(testData.jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of testData.jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation adds a new custom url', async () => { + await ml.testExecution.logTestStep('job creation adds a new custom url'); await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' }); - }); - it('job creation assigns calendars', async () => { + await ml.testExecution.logTestStep('job creation assigns calendars'); await ml.jobWizardCommon.addCalendar(calendarId); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists({ withAdvancedSection: false }); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists({ withAdvancedSection: false }); await ml.jobWizardCommon.activateDedicatedIndexSwitch({ withAdvancedSection: false }); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation creates the job and finishes processing' + ); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardAdvanced.createJob(); await ml.jobManagement.assertStartDatafeedModalExists(); await ml.jobManagement.confirmStartDatafeedModal(); await ml.jobManagement.waitForJobCompletion(testData.jobId); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays the created job in the job list' + ); await ml.jobTable.refreshJobList(); await ml.jobTable.filterWithSearchString(testData.jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === testData.jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -530,84 +458,78 @@ export default function ({ getService }: FtrProviderContext) { ...testData.expected.modelSizeStats, } ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); for (let i = 0; i < testData.pickFieldsConfig.detectors.length; i++) { await ml.api.assertDetectorResultsExist(testData.jobId, i); } }); - it('job cloning clicks the clone action and loads the advanced wizard', async () => { + it('job cloning opens the existing job in the advanced wizard', async () => { + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and loads the advanced wizard' + ); await ml.jobTable.clickCloneJobAction(testData.jobId); await ml.jobTypeSelection.assertAdvancedJobWizardOpen(); }); - it('job cloning displays the configure datafeed step', async () => { + it('job cloning navigates through the advanced wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job cloning displays the configure datafeed step'); await ml.jobWizardCommon.assertConfigureDatafeedSectionExists(); - }); - it('job cloning pre-fills the datafeed query editor', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the datafeed query editor'); await ml.jobWizardAdvanced.assertDatafeedQueryEditorExists(); await ml.jobWizardAdvanced.assertDatafeedQueryEditorValue(defaultValues.datafeedQuery); - }); - it('job cloning pre-fills the query delay', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the query delay'); await ml.jobWizardAdvanced.assertQueryDelayInputExists(); - if (isDatafeedConfigWithQueryDelay(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.assertQueryDelayValue(testData.datafeedConfig.queryDelay); + if (testData.datafeedConfig.hasOwnProperty('queryDelay')) { + await ml.jobWizardAdvanced.assertQueryDelayValue(testData.datafeedConfig.queryDelay!); } - }); - it('job cloning pre-fills the frequency', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the frequency'); await ml.jobWizardAdvanced.assertFrequencyInputExists(); - if (isDatafeedConfigWithFrequency(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.assertFrequencyValue(testData.datafeedConfig.frequency); + if (testData.datafeedConfig.hasOwnProperty('frequency')) { + await ml.jobWizardAdvanced.assertFrequencyValue(testData.datafeedConfig.frequency!); } - }); - it('job cloning pre-fills the scroll size', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the scroll size'); await ml.jobWizardAdvanced.assertScrollSizeInputExists(); await ml.jobWizardAdvanced.assertScrollSizeValue( - isDatafeedConfigWithScrollSize(testData.datafeedConfig) - ? testData.datafeedConfig.scrollSize + testData.datafeedConfig.hasOwnProperty('scrollSize') + ? testData.datafeedConfig.scrollSize! : defaultValues.scrollSize ); - }); - it('job creation pre-fills the time field', async () => { + await ml.testExecution.logTestStep('job creation pre-fills the time field'); await ml.jobWizardAdvanced.assertTimeFieldInputExists(); await ml.jobWizardAdvanced.assertTimeFieldSelection([testData.expected.wizard.timeField]); - }); - it('job cloning displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job cloning displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job cloning pre-fills the categorization field', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the categorization field'); await ml.jobWizardAdvanced.assertCategorizationFieldInputExists(); await ml.jobWizardAdvanced.assertCategorizationFieldSelection( - isPickFieldsConfigWithCategorizationField(testData.pickFieldsConfig) - ? [testData.pickFieldsConfig.categorizationField] + testData.pickFieldsConfig.hasOwnProperty('categorizationField') + ? [testData.pickFieldsConfig.categorizationField!] : [] ); - }); - it('job cloning pre-fills the summary count field', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the summary count field'); await ml.jobWizardAdvanced.assertSummaryCountFieldInputExists(); await ml.jobWizardAdvanced.assertSummaryCountFieldSelection( - isPickFieldsConfigWithSummaryCountField(testData.pickFieldsConfig) - ? [testData.pickFieldsConfig.summaryCountField] + testData.pickFieldsConfig.hasOwnProperty('summaryCountField') + ? [testData.pickFieldsConfig.summaryCountField!] : [] ); - }); - it('job cloning pre-fills detectors', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills detectors'); for (const [index, detector] of testData.pickFieldsConfig.detectors.entries()) { await ml.jobWizardAdvanced.assertDetectorEntryExists( index, detector.identifier, - isDetectorWithDescription(detector) ? detector.description : undefined + detector.hasOwnProperty('description') ? detector.description! : undefined ); await ml.jobWizardAdvanced.clickEditDetector(index); @@ -621,134 +543,121 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardAdvanced.assertDetectorFunctionSelection([detector.function]); await ml.jobWizardAdvanced.assertDetectorFieldSelection( - isDetectorWithField(detector) ? [detector.field] : [] + detector.hasOwnProperty('field') ? [detector.field!] : [] ); await ml.jobWizardAdvanced.assertDetectorByFieldSelection( - isDetectorWithByField(detector) ? [detector.byField] : [] + detector.hasOwnProperty('byField') ? [detector.byField!] : [] ); await ml.jobWizardAdvanced.assertDetectorOverFieldSelection( - isDetectorWithOverField(detector) ? [detector.overField] : [] + detector.hasOwnProperty('overField') ? [detector.overField!] : [] ); await ml.jobWizardAdvanced.assertDetectorPartitionFieldSelection( - isDetectorWithPartitionField(detector) ? [detector.partitionField] : [] + detector.hasOwnProperty('partitionField') ? [detector.partitionField!] : [] ); await ml.jobWizardAdvanced.assertDetectorExcludeFrequentSelection( - isDetectorWithExcludeFrequent(detector) ? [detector.excludeFrequent] : [] + detector.hasOwnProperty('excludeFrequent') ? [detector.excludeFrequent!] : [] ); // Currently, a description different form the identifier is generated for detectors with partition field await ml.jobWizardAdvanced.assertDetectorDescriptionValue( - isDetectorWithDescription(detector) - ? detector.description + detector.hasOwnProperty('description') + ? detector.description! : detector.identifier.replace('partition_field_name', 'partitionfield') ); await ml.jobWizardAdvanced.cancelAddDetectorModal(); } - }); - it('job cloning pre-fills the bucket span', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.assertBucketSpanValue(testData.pickFieldsConfig.bucketSpan); - }); - it('job cloning pre-fills influencers', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills influencers'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection(testData.pickFieldsConfig.influencers); - }); - - // MML during clone has changed in #61589 - // TODO: adjust test code to reflect the new behavior - it.skip('job cloning pre-fills the model memory limit', async () => { - await ml.jobWizardCommon.assertModelMemoryLimitInputExists({ - withAdvancedSection: false, - }); - await ml.jobWizardCommon.assertModelMemoryLimitValue( - testData.pickFieldsConfig.memoryLimit, - { - withAdvancedSection: false, - } - ); - }); - it('job cloning displays the job details step', async () => { + // MML during clone has changed in #61589 + // TODO: adjust test code to reflect the new behavior + // await ml.testExecution.logTestStep('job cloning pre-fills the model memory limit'); + // await ml.jobWizardCommon.assertModelMemoryLimitInputExists({ + // withAdvancedSection: false, + // }); + // await ml.jobWizardCommon.assertModelMemoryLimitValue( + // testData.pickFieldsConfig.memoryLimit, + // { + // withAdvancedSection: false, + // } + // ); + + await ml.testExecution.logTestStep('job cloning displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job cloning does not pre-fill the job id', async () => { + await ml.testExecution.logTestStep('job cloning does not pre-fill the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.assertJobIdValue(''); - }); - it('job cloning inputs the clone job id', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job id'); await ml.jobWizardCommon.setJobId(testData.jobIdClone); - }); - it('job cloning pre-fills the job description', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.assertJobDescriptionValue(testData.jobDescription); - }); - it('job cloning pre-fills job groups', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroups); - }); - it('job cloning inputs the clone job group', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job group'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.addJobGroup('clone'); await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroupsClone); - }); - it('job cloning opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job cloning opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job cloning persists custom urls', async () => { + await ml.testExecution.logTestStep('job cloning persists custom urls'); await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard'); - }); - it('job cloning persists assigned calendars', async () => { + await ml.testExecution.logTestStep('job cloning persists assigned calendars'); await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); - }); - it('job cloning pre-fills the model plot switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists({ withAdvancedSection: false }); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false, { withAdvancedSection: false, }); - }); - it('job cloning pre-fills the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists({ withAdvancedSection: false }); await ml.jobWizardCommon.assertDedicatedIndexSwitchCheckedState(true, { withAdvancedSection: false, }); - }); - it('job cloning displays the validation step', async () => { + await ml.testExecution.logTestStep('job cloning displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job cloning displays the summary step', async () => { + await ml.testExecution.logTestStep('job cloning displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job cloning creates the job and finishes processing', async () => { + it('job cloning runs the clone job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job cloning creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardAdvanced.createJob(); await ml.jobManagement.assertStartDatafeedModalExists(); await ml.jobManagement.confirmStartDatafeedModal(); await ml.jobManagement.waitForJobCompletion(testData.jobIdClone); - }); - it('job cloning displays the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays the created job in the job list' + ); await ml.jobTable.refreshJobList(); await ml.jobTable.filterWithSearchString(testData.jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === testData.jobIdClone)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(testData.jobIdClone, { id: testData.jobIdClone, description: testData.jobDescription, @@ -767,9 +676,8 @@ export default function ({ getService }: FtrProviderContext) { ...testData.expected.modelSizeStats, } ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job cloning has detector results'); for (let i = 0; i < testData.pickFieldsConfig.detectors.length; i++) { await ml.api.assertDetectorResultsExist(testData.jobIdClone, i); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts b/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts index 202910622fb64..9e48c71ab0eba 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts @@ -56,7 +56,8 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('loads from job list row link', async () => { + it('displays error on broken annotation index and recovers after fix', async () => { + await ml.testExecution.logTestStep('loads from job list row link'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -66,43 +67,35 @@ export default function ({ getService }: FtrProviderContext) { expect(rows.filter((row) => row.id === JOB_CONFIG.job_id)).to.have.length(1); await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id); - await ml.common.waitForMlLoadingIndicatorToDisappear(); - }); + await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); - it('pre-fills the job selection', async () => { + await ml.testExecution.logTestStep('pre-fills the job selection'); await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); - }); - it('pre-fills the detector input', async () => { + await ml.testExecution.logTestStep('pre-fills the detector input'); await ml.singleMetricViewer.assertDetectorInputExsist(); await ml.singleMetricViewer.assertDetectorInputValue('0'); - }); - it('should display the annotations section showing an error', async () => { + await ml.testExecution.logTestStep('should display the annotations section showing an error'); await ml.singleMetricViewer.assertAnnotationsExists('error'); - }); - it('should navigate to anomaly explorer', async () => { + await ml.testExecution.logTestStep('should navigate to anomaly explorer'); await ml.navigation.navigateToAnomalyExplorerViaSingleMetricViewer(); - }); - it('should display the annotations section showing an error', async () => { + await ml.testExecution.logTestStep('should display the annotations section showing an error'); await ml.anomalyExplorer.assertAnnotationsPanelExists('error'); - }); - it('should display the annotations section without an error', async () => { + await ml.testExecution.logTestStep('should display the annotations section without an error'); // restores the aliases to point to the original working annotations index // so we can run tests against successfully loaded annotations sections. await ml.testResources.restoreAnnotationsIndexState(); await ml.anomalyExplorer.refreshPage(); await ml.anomalyExplorer.assertAnnotationsPanelExists('loaded'); - }); - it('should navigate to single metric viewer', async () => { + await ml.testExecution.logTestStep('should navigate to single metric viewer'); await ml.navigation.navigateToSingleMetricViewerViaAnomalyExplorer(); - }); - it('should display the annotations section without an error', async () => { + await ml.testExecution.logTestStep('should display the annotations section without an error'); await ml.singleMetricViewer.assertAnnotationsExists('loaded'); }); }); diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts index cbee36abef78d..cfbebd478fcb8 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts @@ -79,24 +79,26 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('loads from job list row link', async () => { + it('opens a job from job list link', async () => { + await ml.testExecution.logTestStep('navigate to job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); + await ml.testExecution.logTestStep('open job in anomaly explorer'); await ml.jobTable.waitForJobsToLoad(); await ml.jobTable.filterWithSearchString(testData.jobConfig.job_id); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === testData.jobConfig.job_id)).to.have.length(1); await ml.jobTable.clickOpenJobInAnomalyExplorerButton(testData.jobConfig.job_id); - await ml.common.waitForMlLoadingIndicatorToDisappear(); + await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); }); - it('pre-fills the job selection', async () => { + it('displays job results', async () => { + await ml.testExecution.logTestStep('pre-fills the job selection'); await ml.jobSelection.assertJobSelection([testData.jobConfig.job_id]); - }); - it('displays the influencers list', async () => { + await ml.testExecution.logTestStep('displays the influencers list'); await ml.anomalyExplorer.assertInfluencerListExists(); for (const influencerBlock of testData.expected.influencers) { await ml.anomalyExplorer.assertInfluencerFieldExists(influencerBlock.field); @@ -111,27 +113,26 @@ export default function ({ getService }: FtrProviderContext) { ); } } - }); - it('displays the swimlanes', async () => { + await ml.testExecution.logTestStep('displays the swimlanes'); await ml.anomalyExplorer.assertOverallSwimlaneExists(); await ml.anomalyExplorer.assertSwimlaneViewByExists(); - }); - it('should display the annotations panel', async () => { + await ml.testExecution.logTestStep('should display the annotations panel'); await ml.anomalyExplorer.assertAnnotationsPanelExists('loaded'); - }); - it('displays the anomalies table', async () => { + await ml.testExecution.logTestStep('displays the anomalies table'); await ml.anomaliesTable.assertTableExists(); - }); - it('anomalies table is not empty', async () => { + await ml.testExecution.logTestStep('anomalies table is not empty'); await ml.anomaliesTable.assertTableNotEmpty(); }); - // should be the last step because it navigates away from the Anomaly Explorer page - it('should allow to attach anomaly swimlane embeddable to the dashboard', async () => { + it('adds swim lane embeddable to a dashboard', async () => { + // should be the last step because it navigates away from the Anomaly Explorer page + await ml.testExecution.logTestStep( + 'should allow to attach anomaly swimlane embeddable to the dashboard' + ); await ml.anomalyExplorer.openAddToDashboardControl(); await ml.anomalyExplorer.addAndEditSwimlaneInDashboard('ML Test'); }); diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts index 1581bd54f5c44..c410aff292ffa 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts @@ -89,49 +89,46 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('job creation loads the job management page', async () => { + it('job creation loads the categorization wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); + await ml.testExecution.logTestStep(''); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the new job source selection page'); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_categorization'); - }); - it('job creation loads the categorization job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the categorization job wizard page'); await ml.jobTypeSelection.selectCategorizationJob(); }); - it('job creation displays the time range step', async () => { + it('job creation navigates through the categorization wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job creation sets the timerange', async () => { + await ml.testExecution.logTestStep('job creation sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Apr 5, 2019 @ 11:25:35.770', 'Nov 21, 2019 @ 06:01:13.914' ); - }); - it('job creation displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it(`job creation selects ${detectorTypeIdentifier} detector type`, async () => { + await ml.testExecution.logTestStep( + `job creation selects ${detectorTypeIdentifier} detector type` + ); await ml.jobWizardCategorization.assertCategorizationDetectorTypeSelectionExists(); await ml.jobWizardCategorization.selectCategorizationDetectorType(detectorTypeIdentifier); - }); - it(`job creation selects the categorization field`, async () => { + await ml.testExecution.logTestStep(`job creation selects the categorization field`); await ml.jobWizardCategorization.assertCategorizationFieldInputExists(); await ml.jobWizardCategorization.selectCategorizationField(categorizationFieldIdentifier); await ml.jobWizardCategorization.assertCategorizationExamplesCallout( @@ -140,81 +137,67 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardCategorization.assertCategorizationExamplesTable( categorizationExampleCount ); - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(bucketSpan); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation adds a new custom url', async () => { + await ml.testExecution.logTestStep('job creation adds a new custom url'); await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' }); - }); - it('job creation assigns calendars', async () => { + await ml.testExecution.logTestStep('job creation assigns calendars'); await ml.jobWizardCommon.addCalendar(calendarId); - }); - it('job creation opens the advanced section', async () => { + await ml.testExecution.logTestStep('job creation opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); await ml.jobWizardCommon.assertModelPlotSwitchEnabled(false); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.activateDedicatedIndexSwitch(); - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); await ml.jobWizardCommon.setModelMemoryLimit(memoryLimit); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job creation creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job creation displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -222,9 +205,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobId, getExpectedRow(jobId, jobGroups)); await ml.jobTable.assertJobRowDetailsCounts( @@ -232,123 +216,106 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobId), getExpectedModelSizeStats(jobId) ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); await ml.api.assertDetectorResultsExist(jobId, 0); }); - it('job cloning clicks the clone action and loads the single metric wizard', async () => { + it('job cloning opens the existing job in the categorization wizard', async () => { + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and loads the single metric wizard' + ); await ml.jobTable.clickCloneJobAction(jobId); await ml.jobTypeSelection.assertCategorizationJobWizardOpen(); }); - it('job cloning displays the time range step', async () => { + it('job cloning navigates through the categorization wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job cloning displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job cloning sets the timerange', async () => { + await ml.testExecution.logTestStep('job cloning sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Apr 5, 2019 @ 11:25:35.770', 'Nov 21, 2019 @ 06:01:13.914' ); - }); - it('job cloning displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job cloning displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job cloning displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job cloning displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job cloning pre-fills field and aggregation', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills field and aggregation'); await ml.jobWizardCategorization.assertCategorizationDetectorTypeSelectionExists(); - }); - it('job cloning pre-fills the bucket span', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.assertBucketSpanValue(bucketSpan); - }); - it('job cloning displays the job details step', async () => { + await ml.testExecution.logTestStep('job cloning displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job cloning does not pre-fill the job id', async () => { + await ml.testExecution.logTestStep('job cloning does not pre-fill the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.assertJobIdValue(''); - }); - it('job cloning inputs the clone job id', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job id'); await ml.jobWizardCommon.setJobId(jobIdClone); - }); - it('job cloning pre-fills the job description', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.assertJobDescriptionValue(jobDescription); - }); - it('job cloning pre-fills job groups', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job cloning inputs the clone job group', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job group'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.addJobGroup('clone'); await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone); - }); - it('job cloning opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job cloning opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job cloning persists custom urls', async () => { + await ml.testExecution.logTestStep('job cloning persists custom urls'); await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard'); - }); - it('job cloning persists assigned calendars', async () => { + await ml.testExecution.logTestStep('job cloning persists assigned calendars'); await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); - }); - it('job cloning opens the advanced section', async () => { + await ml.testExecution.logTestStep('job cloning opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job cloning pre-fills the model plot switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); await ml.jobWizardCommon.assertModelPlotSwitchEnabled(false); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false); - }); - it('job cloning pre-fills the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.assertDedicatedIndexSwitchCheckedState(true); - }); - // MML during clone has changed in #61589 - // TODO: adjust test code to reflect the new behavior - it.skip('job cloning pre-fills the model memory limit', async () => { - await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); - await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - }); + // MML during clone has changed in #61589 + // TODO: adjust test code to reflect the new behavior + // await ml.testExecution.logTestStep('job cloning pre-fills the model memory limit'); + // await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); + // await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - it('job cloning displays the validation step', async () => { + await ml.testExecution.logTestStep('job cloning displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job cloning displays the summary step', async () => { + await ml.testExecution.logTestStep('job cloning displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job cloning creates the job and finishes processing', async () => { + it('job cloning runs the clone job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job cloning creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job cloning displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job cloning displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -356,9 +323,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(1); - }); - it('job cloning displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobIdClone, getExpectedRow(jobIdClone, jobGroupsClone)); await ml.jobTable.assertJobRowDetailsCounts( @@ -366,32 +334,32 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobIdClone), getExpectedModelSizeStats(jobIdClone) ); - }); - it('job cloning has detector results', async () => { + await ml.testExecution.logTestStep('job cloning has detector results'); await ml.api.assertDetectorResultsExist(jobId, 0); }); - it('job deletion has results for the job before deletion', async () => { + it('deletes the cloned job', async () => { + await ml.testExecution.logTestStep('job deletion has results for the job before deletion'); await ml.api.assertJobResultsExist(jobIdClone); - }); - it('job deletion triggers the delete action', async () => { + await ml.testExecution.logTestStep('job deletion triggers the delete action'); await ml.jobTable.clickDeleteJobAction(jobIdClone); - }); - it('job deletion confirms the delete modal', async () => { + await ml.testExecution.logTestStep('job deletion confirms the delete modal'); await ml.jobTable.confirmDeleteJobModal(); - }); - it('job deletion does not display the deleted job in the job list any more', async () => { + await ml.testExecution.logTestStep( + 'job deletion does not display the deleted job in the job list any more' + ); await ml.jobTable.waitForJobsToLoad(); await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(0); - }); - it('job deletion does not have results for the deleted job any more', async () => { + await ml.testExecution.logTestStep( + 'job deletion does not have results for the deleted job any more' + ); await ml.api.assertNoJobResultsExist(jobIdClone); }); }); diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/date_nanos_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/date_nanos_job.ts index 50622604c4e5c..22b4c4a1fdfe3 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/date_nanos_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/date_nanos_job.ts @@ -32,55 +32,6 @@ interface PickFieldsConfig { summaryCountField?: string; } -// type guards -// Detector -const isDetectorWithField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('field'); -}; -const isDetectorWithByField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('byField'); -}; -const isDetectorWithOverField = (arg: any): arg is Required> => { - return arg.hasOwnProperty('overField'); -}; -const isDetectorWithPartitionField = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('partitionField'); -}; -const isDetectorWithExcludeFrequent = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('excludeFrequent'); -}; -const isDetectorWithDescription = (arg: any): arg is Required> => { - return arg.hasOwnProperty('description'); -}; - -// DatafeedConfig -const isDatafeedConfigWithQueryDelay = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('queryDelay'); -}; -const isDatafeedConfigWithFrequency = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('frequency'); -}; -const isDatafeedConfigWithScrollSize = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('scrollSize'); -}; - -// PickFieldsConfig -const isPickFieldsConfigWithSummaryCountField = ( - arg: any -): arg is Required> => { - return arg.hasOwnProperty('summaryCountField'); -}; - export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); @@ -183,77 +134,70 @@ export default function ({ getService }: FtrProviderContext) { for (const testData of testDataList) { describe(`${testData.suiteTitle}`, function () { - it('job creation loads the job management page', async () => { + it('loads the advanced wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep( + 'job creation loads the new job source selection page' + ); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(testData.jobSource); - }); - it('job creation loads the advanced job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the advanced job wizard page'); await ml.jobTypeSelection.selectAdvancedJob(); }); - it('job creation displays the configure datafeed step', async () => { + it('navigates through the advanced wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the configure datafeed step'); await ml.jobWizardCommon.assertConfigureDatafeedSectionExists(); - }); - it('job creation pre-fills the datafeed query editor', async () => { + await ml.testExecution.logTestStep('job creation pre-fills the datafeed query editor'); await ml.jobWizardAdvanced.assertDatafeedQueryEditorExists(); await ml.jobWizardAdvanced.assertDatafeedQueryEditorValue(defaultValues.datafeedQuery); - }); - it('job creation inputs the query delay', async () => { + await ml.testExecution.logTestStep('job creation inputs the query delay'); await ml.jobWizardAdvanced.assertQueryDelayInputExists(); await ml.jobWizardAdvanced.assertQueryDelayValue(defaultValues.queryDelay); - if (isDatafeedConfigWithQueryDelay(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setQueryDelay(testData.datafeedConfig.queryDelay); + if (testData.datafeedConfig.hasOwnProperty('queryDelay')) { + await ml.jobWizardAdvanced.setQueryDelay(testData.datafeedConfig.queryDelay!); } - }); - it('job creation inputs the frequency', async () => { + await ml.testExecution.logTestStep('job creation inputs the frequency'); await ml.jobWizardAdvanced.assertFrequencyInputExists(); await ml.jobWizardAdvanced.assertFrequencyValue(defaultValues.frequency); - if (isDatafeedConfigWithFrequency(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setFrequency(testData.datafeedConfig.frequency); + if (testData.datafeedConfig.hasOwnProperty('frequency')) { + await ml.jobWizardAdvanced.setFrequency(testData.datafeedConfig.frequency!); } - }); - it('job creation inputs the scroll size', async () => { + await ml.testExecution.logTestStep('job creation inputs the scroll size'); await ml.jobWizardAdvanced.assertScrollSizeInputExists(); await ml.jobWizardAdvanced.assertScrollSizeValue(defaultValues.scrollSize); - if (isDatafeedConfigWithScrollSize(testData.datafeedConfig)) { - await ml.jobWizardAdvanced.setScrollSize(testData.datafeedConfig.scrollSize); + if (testData.datafeedConfig.hasOwnProperty('scrollSize')) { + await ml.jobWizardAdvanced.setScrollSize(testData.datafeedConfig.scrollSize!); } - }); - it('job creation pre-fills the time field', async () => { + await ml.testExecution.logTestStep('ob creation pre-fills the time field'); await ml.jobWizardAdvanced.assertTimeFieldInputExists(); await ml.jobWizardAdvanced.assertTimeFieldSelection([testData.expected.wizard.timeField]); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects the summary count field', async () => { + await ml.testExecution.logTestStep('job creation selects the summary count field'); await ml.jobWizardAdvanced.assertSummaryCountFieldInputExists(); - if (isPickFieldsConfigWithSummaryCountField(testData.pickFieldsConfig)) { + if (testData.pickFieldsConfig.hasOwnProperty('summaryCountField')) { await ml.jobWizardAdvanced.selectSummaryCountField( - testData.pickFieldsConfig.summaryCountField + testData.pickFieldsConfig.summaryCountField! ); } else { await ml.jobWizardAdvanced.assertSummaryCountFieldSelection([]); } - }); - it('job creation adds detectors', async () => { + await ml.testExecution.logTestStep('job creation adds detectors'); for (const detector of testData.pickFieldsConfig.detectors) { await ml.jobWizardAdvanced.openCreateDetectorModal(); await ml.jobWizardAdvanced.assertDetectorFunctionInputExists(); @@ -272,120 +216,112 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardAdvanced.assertDetectorDescriptionValue(''); await ml.jobWizardAdvanced.selectDetectorFunction(detector.function); - if (isDetectorWithField(detector)) { - await ml.jobWizardAdvanced.selectDetectorField(detector.field); + if (detector.hasOwnProperty('field')) { + await ml.jobWizardAdvanced.selectDetectorField(detector.field!); } - if (isDetectorWithByField(detector)) { - await ml.jobWizardAdvanced.selectDetectorByField(detector.byField); + if (detector.hasOwnProperty('byField')) { + await ml.jobWizardAdvanced.selectDetectorByField(detector.byField!); } - if (isDetectorWithOverField(detector)) { - await ml.jobWizardAdvanced.selectDetectorOverField(detector.overField); + if (detector.hasOwnProperty('overField')) { + await ml.jobWizardAdvanced.selectDetectorOverField(detector.overField!); } - if (isDetectorWithPartitionField(detector)) { - await ml.jobWizardAdvanced.selectDetectorPartitionField(detector.partitionField); + if (detector.hasOwnProperty('partitionField')) { + await ml.jobWizardAdvanced.selectDetectorPartitionField(detector.partitionField!); } - if (isDetectorWithExcludeFrequent(detector)) { - await ml.jobWizardAdvanced.selectDetectorExcludeFrequent(detector.excludeFrequent); + if (detector.hasOwnProperty('excludeFrequent')) { + await ml.jobWizardAdvanced.selectDetectorExcludeFrequent(detector.excludeFrequent!); } - if (isDetectorWithDescription(detector)) { - await ml.jobWizardAdvanced.setDetectorDescription(detector.description); + if (detector.hasOwnProperty('description')) { + await ml.jobWizardAdvanced.setDetectorDescription(detector.description!); } await ml.jobWizardAdvanced.confirmAddDetectorModal(); } - }); - it('job creation displays detector entries', async () => { + await ml.testExecution.logTestStep('job creation displays detector entries'); for (const [index, detector] of testData.pickFieldsConfig.detectors.entries()) { await ml.jobWizardAdvanced.assertDetectorEntryExists( index, detector.identifier, - isDetectorWithDescription(detector) ? detector.description : undefined + detector.hasOwnProperty('description') ? detector.description! : undefined ); } - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(testData.pickFieldsConfig.bucketSpan); - }); - it('job creation inputs influencers', async () => { + await ml.testExecution.logTestStep('job creation inputs influencers'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection([]); for (const influencer of testData.pickFieldsConfig.influencers) { await ml.jobWizardCommon.addInfluencer(influencer); } - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists({ withAdvancedSection: false, }); await ml.jobWizardCommon.setModelMemoryLimit(testData.pickFieldsConfig.memoryLimit, { withAdvancedSection: false, }); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(testData.jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(testData.jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of testData.jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists({ withAdvancedSection: false }); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists({ withAdvancedSection: false }); await ml.jobWizardCommon.activateDedicatedIndexSwitch({ withAdvancedSection: false }); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation creates the job and finishes processing' + ); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardAdvanced.createJob(); await ml.jobManagement.assertStartDatafeedModalExists(); await ml.jobManagement.confirmStartDatafeedModal(); await ml.jobManagement.waitForJobCompletion(testData.jobId); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays the created job in the job list' + ); await ml.jobTable.refreshJobList(); await ml.jobTable.filterWithSearchString(testData.jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === testData.jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -404,9 +340,8 @@ export default function ({ getService }: FtrProviderContext) { ...testData.expected.modelSizeStats, } ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); for (let i = 0; i < testData.pickFieldsConfig.detectors.length; i++) { await ml.api.assertDetectorResultsExist(testData.jobId, i); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/multi_metric_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/multi_metric_job.ts index 85477b105abe9..8702cfd734454 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/multi_metric_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/multi_metric_job.ts @@ -86,52 +86,50 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('job creation loads the job management page', async () => { + it('job creation loads the multi metric wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the new job source selection page'); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_farequote'); - }); - it('job creation loads the multi metric job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the multi metric job wizard page'); await ml.jobTypeSelection.selectMultiMetricJob(); }); - it('job creation displays the time range step', async () => { + it('job creation navigates through the multi metric wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job creation sets the timerange', async () => { + await ml.testExecution.logTestStep('job creation sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Feb 7, 2016 @ 00:00:00.000', 'Feb 11, 2016 @ 23:59:54.000' ); - }); - it('job creation displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects detectors and displays detector previews', async () => { + await ml.testExecution.logTestStep( + 'job creation selects detectors and displays detector previews' + ); for (const [index, aggAndFieldIdentifier] of aggAndFieldIdentifiers.entries()) { await ml.jobWizardCommon.assertAggAndFieldInputExists(); await ml.jobWizardCommon.selectAggAndField(aggAndFieldIdentifier, false); await ml.jobWizardCommon.assertDetectorPreviewExists(aggAndFieldIdentifier, index, 'LINE'); } - }); - it('job creation inputs the split field and displays split cards', async () => { + await ml.testExecution.logTestStep( + 'job creation inputs the split field and displays split cards' + ); await ml.jobWizardMultiMetric.assertSplitFieldInputExists(); await ml.jobWizardMultiMetric.selectSplitField(splitField); @@ -140,84 +138,69 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardMultiMetric.assertDetectorSplitNumberOfBackCards(9); await ml.jobWizardCommon.assertInfluencerSelection([splitField]); - }); - it('job creation displays the influencer field', async () => { + await ml.testExecution.logTestStep('job creation displays the influencer field'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection([splitField]); - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(bucketSpan); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation adds a new custom url', async () => { + await ml.testExecution.logTestStep('job creation adds a new custom url'); await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' }); - }); - it('job creation assigns calendars', async () => { + await ml.testExecution.logTestStep('job creation assigns calendars'); await ml.jobWizardCommon.addCalendar(calendarId); - }); - it('job creation opens the advanced section', async () => { + await ml.testExecution.logTestStep('job creation opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.activateDedicatedIndexSwitch(); - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); await ml.jobWizardCommon.setModelMemoryLimit(memoryLimit); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job creation creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job creation displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -225,9 +208,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobId, getExpectedRow(jobId, jobGroups)); await ml.jobTable.assertJobRowDetailsCounts( @@ -235,40 +219,41 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobId), getExpectedModelSizeStats(jobId) ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); for (let i = 0; i < aggAndFieldIdentifiers.length; i++) { await ml.api.assertDetectorResultsExist(jobId, i); } }); - it('job cloning clicks the clone action and loads the multi metric wizard', async () => { + it('job cloning opens the existing job in the multi metric wizard', async () => { + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and loads the multi metric wizard' + ); await ml.jobTable.clickCloneJobAction(jobId); await ml.jobTypeSelection.assertMultiMetricJobWizardOpen(); }); - it('job cloning displays the time range step', async () => { + it('job cloning navigates through the multi metric wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job cloning displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job cloning sets the timerange', async () => { + await ml.testExecution.logTestStep('job cloning sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Feb 7, 2016 @ 00:00:00.000', 'Feb 11, 2016 @ 23:59:54.000' ); - }); - it('job cloning displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job cloning displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job cloning displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job cloning displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job cloning pre-fills detectors and shows preview with split cards', async () => { + await ml.testExecution.logTestStep( + 'job cloning pre-fills detectors and shows preview with split cards' + ); for (const [index, aggAndFieldIdentifier] of aggAndFieldIdentifiers.entries()) { await ml.jobWizardCommon.assertDetectorPreviewExists(aggAndFieldIdentifier, index, 'LINE'); } @@ -276,99 +261,81 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardMultiMetric.assertDetectorSplitExists(splitField); await ml.jobWizardMultiMetric.assertDetectorSplitFrontCardTitle('AAL'); await ml.jobWizardMultiMetric.assertDetectorSplitNumberOfBackCards(9); - }); - it('job cloning pre-fills the split field', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the split field'); await ml.jobWizardMultiMetric.assertSplitFieldInputExists(); await ml.jobWizardMultiMetric.assertSplitFieldSelection([splitField]); - }); - it('job cloning pre-fills influencers', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills influencers'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection([splitField]); - }); - it('job cloning pre-fills the bucket span', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.assertBucketSpanValue(bucketSpan); - }); - it('job cloning displays the job details step', async () => { + await ml.testExecution.logTestStep('job cloning displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job cloning does not pre-fill the job id', async () => { + await ml.testExecution.logTestStep('job cloning does not pre-fill the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.assertJobIdValue(''); - }); - it('job cloning inputs the clone job id', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job id'); await ml.jobWizardCommon.setJobId(jobIdClone); - }); - it('job cloning pre-fills the job description', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.assertJobDescriptionValue(jobDescription); - }); - it('job cloning pre-fills job groups', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job cloning inputs the clone job group', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job group'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.addJobGroup('clone'); await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone); - }); - it('job cloning opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job cloning opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job cloning persists custom urls', async () => { + await ml.testExecution.logTestStep('job cloning persists custom urls'); await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard'); - }); - it('job cloning persists assigned calendars', async () => { + await ml.testExecution.logTestStep('job cloning persists assigned calendars'); await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); - }); - it('job cloning opens the advanced section', async () => { + await ml.testExecution.logTestStep('job cloning opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job cloning pre-fills the model plot switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false); - }); - it('job cloning pre-fills the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.assertDedicatedIndexSwitchCheckedState(true); - }); - // MML during clone has changed in #61589 - // TODO: adjust test code to reflect the new behavior - it.skip('job cloning pre-fills the model memory limit', async () => { - await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); - await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - }); + // MML during clone has changed in #61589 + // TODO: adjust test code to reflect the new behavior + // await ml.testExecution.logTestStep('job cloning pre-fills the model memory limit'); + // await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); + // await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - it('job cloning displays the validation step', async () => { + await ml.testExecution.logTestStep('job cloning displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job cloning displays the summary step', async () => { + await ml.testExecution.logTestStep('job cloning displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job cloning creates the job and finishes processing', async () => { + it('job cloning runs the clone job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job cloning creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job cloning displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job cloning displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -376,9 +343,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(1); - }); - it('job cloning displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobIdClone, getExpectedRow(jobIdClone, jobGroupsClone)); await ml.jobTable.assertJobRowDetailsCounts( @@ -386,9 +354,8 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobIdClone), getExpectedModelSizeStats(jobIdClone) ); - }); - it('job cloning has detector results', async () => { + await ml.testExecution.logTestStep('job cloning has detector results'); for (let i = 0; i < aggAndFieldIdentifiers.length; i++) { await ml.api.assertDetectorResultsExist(jobId, i); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/population_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/population_job.ts index c6de7f8a2bd39..3ec78eccf3de4 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/population_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/population_job.ts @@ -100,57 +100,54 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('job creation loads the job management page', async () => { + it('job creation loads the population wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the new job source selection page'); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_ecommerce'); - }); - it('job creation loads the population job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the population job wizard page'); await ml.jobTypeSelection.selectPopulationJob(); }); - it('job creation displays the time range step', async () => { + it('job creation navigates through the population wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job creation sets the timerange', async () => { + await ml.testExecution.logTestStep('job creation sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Jun 12, 2019 @ 00:04:19.000', 'Jul 12, 2019 @ 23:45:36.000' ); - }); - it('job creation displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects the population field', async () => { + await ml.testExecution.logTestStep('job creation selects the population field'); await ml.jobWizardPopulation.assertPopulationFieldInputExists(); await ml.jobWizardPopulation.selectPopulationField(populationField); - }); - it('job creation selects detectors and displays detector previews', async () => { + await ml.testExecution.logTestStep( + 'job creation selects detectors and displays detector previews' + ); for (const [index, detector] of detectors.entries()) { await ml.jobWizardCommon.assertAggAndFieldInputExists(); await ml.jobWizardCommon.selectAggAndField(detector.identifier, false); await ml.jobWizardCommon.assertDetectorPreviewExists(detector.identifier, index, 'SCATTER'); } - }); - it('job creation inputs detector split fields and displays split cards', async () => { + await ml.testExecution.logTestStep( + 'job creation inputs detector split fields and displays split cards' + ); for (const [index, detector] of detectors.entries()) { await ml.jobWizardPopulation.assertDetectorSplitFieldInputExists(index); await ml.jobWizardPopulation.selectDetectorSplitField(index, detector.splitField); @@ -165,86 +162,71 @@ export default function ({ getService }: FtrProviderContext) { detector.numberOfBackCards ); } - }); - it('job creation displays the influencer field', async () => { + await ml.testExecution.logTestStep('job creation displays the influencer field'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection( [populationField].concat(detectors.map((detector) => detector.splitField)) ); - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(bucketSpan); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation adds a new custom url', async () => { + await ml.testExecution.logTestStep('job creation adds a new custom url'); await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' }); - }); - it('job creation assigns calendars', async () => { + await ml.testExecution.logTestStep('job creation assigns calendars'); await ml.jobWizardCommon.addCalendar(calendarId); - }); - it('job creation opens the advanced section', async () => { + await ml.testExecution.logTestStep('job creation opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.activateDedicatedIndexSwitch(); - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); await ml.jobWizardCommon.setModelMemoryLimit(memoryLimit); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job creation creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job creation displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -252,9 +234,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobId, getExpectedRow(jobId, jobGroups)); await ml.jobTable.assertJobRowDetailsCounts( @@ -262,45 +245,45 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobId), getExpectedModelSizeStats(jobId) ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); for (let i = 0; i < detectors.length; i++) { await ml.api.assertDetectorResultsExist(jobId, i); } }); - it('job cloning clicks the clone action and loads the population wizard', async () => { + it('job cloning opens the existing job in the population wizard', async () => { + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and loads the population wizard' + ); await ml.jobTable.clickCloneJobAction(jobId); await ml.jobTypeSelection.assertPopulationJobWizardOpen(); }); - it('job cloning displays the time range step', async () => { + it('job cloning navigates through the population wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job cloning displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job cloning sets the timerange', async () => { + await ml.testExecution.logTestStep('job cloning sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Jun 12, 2019 @ 00:04:19.000', 'Jul 12, 2019 @ 23:45:36.000' ); - }); - it('job cloning displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job cloning displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job cloning displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job cloning displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job cloning pre-fills the population field', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the population field'); await ml.jobWizardPopulation.assertPopulationFieldInputExists(); await ml.jobWizardPopulation.assertPopulationFieldSelection([populationField]); - }); - it('job cloning pre-fills detectors and shows preview with split cards', async () => { + await ml.testExecution.logTestStep( + 'job cloning pre-fills detectors and shows preview with split cards' + ); for (const [index, detector] of detectors.entries()) { await ml.jobWizardCommon.assertDetectorPreviewExists(detector.identifier, index, 'SCATTER'); @@ -317,96 +300,79 @@ export default function ({ getService }: FtrProviderContext) { detector.numberOfBackCards ); } - }); - it('job cloning pre-fills influencers', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills influencers'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection( [populationField].concat(detectors.map((detector) => detector.splitField)) ); - }); - it('job cloning pre-fills the bucket span', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.assertBucketSpanValue(bucketSpan); - }); - it('job cloning displays the job details step', async () => { + await ml.testExecution.logTestStep('job cloning displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job cloning does not pre-fill the job id', async () => { + await ml.testExecution.logTestStep('job cloning does not pre-fill the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.assertJobIdValue(''); - }); - it('job cloning inputs the clone job id', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job id'); await ml.jobWizardCommon.setJobId(jobIdClone); - }); - it('job cloning pre-fills the job description', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.assertJobDescriptionValue(jobDescription); - }); - it('job cloning pre-fills job groups', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job cloning inputs the clone job group', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job group'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.addJobGroup('clone'); await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone); - }); - it('job cloning opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job cloning opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job cloning persists custom urls', async () => { + await ml.testExecution.logTestStep('job cloning persists custom urls'); await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard'); - }); - it('job cloning persists assigned calendars', async () => { + await ml.testExecution.logTestStep('job cloning persists assigned calendars'); await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); - }); - it('job cloning opens the advanced section', async () => { + await ml.testExecution.logTestStep('job cloning opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job cloning pre-fills the model plot switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(false); - }); - it('job cloning pre-fills the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.assertDedicatedIndexSwitchCheckedState(true); - }); - // MML during clone has changed in #61589 - // TODO: adjust test code to reflect the new behavior - it.skip('job cloning pre-fills the model memory limit', async () => { - await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); - await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - }); + // MML during clone has changed in #61589 + // TODO: adjust test code to reflect the new behavior + // await ml.testExecution.logTestStep('job cloning pre-fills the model memory limit'); + // await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); + // await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - it('job cloning displays the validation step', async () => { + await ml.testExecution.logTestStep('job cloning displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job cloning displays the summary step', async () => { + await ml.testExecution.logTestStep('job cloning displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job cloning creates the job and finishes processing', async () => { + it('job cloning runs the clone job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job cloning creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job cloning displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job cloning displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -414,9 +380,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(1); - }); - it('job cloning displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobIdClone, getExpectedRow(jobIdClone, jobGroupsClone)); await ml.jobTable.assertJobRowDetailsCounts( @@ -424,9 +391,8 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobIdClone), getExpectedModelSizeStats(jobIdClone) ); - }); - it('job cloning has detector results', async () => { + await ml.testExecution.logTestStep('job cloning has detector results'); for (let i = 0; i < detectors.length; i++) { await ml.api.assertDetectorResultsExist(jobId, i); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/saved_search_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/saved_search_job.ts index 6f40ec5427b74..170b88efd70f5 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/saved_search_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/saved_search_job.ts @@ -286,44 +286,43 @@ export default function ({ getService }: FtrProviderContext) { for (const testData of testDataList) { describe(` ${testData.suiteTitle}`, function () { - it('job creation loads the job management page', async () => { + it('job creation loads the multi metric wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep( + 'job creation loads the new job source selection page' + ); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(testData.jobSource); - }); - it('job creation loads the multi metric job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the multi metric job wizard page'); await ml.jobTypeSelection.selectMultiMetricJob(); }); - it('job creation displays the time range step', async () => { + it('job creation navigates through the multi metric wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job creation sets the timerange', async () => { + await ml.testExecution.logTestStep('job creation sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Feb 7, 2016 @ 00:00:00.000', 'Feb 11, 2016 @ 23:59:54.000' ); - }); - it('job creation displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects detectors and displays detector previews', async () => { + await ml.testExecution.logTestStep( + 'job creation selects detectors and displays detector previews' + ); for (const [index, aggAndFieldIdentifier] of testData.aggAndFieldIdentifiers.entries()) { await ml.jobWizardCommon.assertAggAndFieldInputExists(); await ml.jobWizardCommon.selectAggAndField(aggAndFieldIdentifier, false); @@ -333,9 +332,10 @@ export default function ({ getService }: FtrProviderContext) { 'LINE' ); } - }); - it('job creation inputs the split field and displays split cards', async () => { + await ml.testExecution.logTestStep( + 'job creation inputs the split field and displays split cards' + ); await ml.jobWizardMultiMetric.assertSplitFieldInputExists(); await ml.jobWizardMultiMetric.selectSplitField(testData.splitField); @@ -348,72 +348,64 @@ export default function ({ getService }: FtrProviderContext) { ); await ml.jobWizardCommon.assertInfluencerSelection([testData.splitField]); - }); - it('job creation displays the influencer field', async () => { + await ml.testExecution.logTestStep('job creation displays the influencer field'); await ml.jobWizardCommon.assertInfluencerInputExists(); await ml.jobWizardCommon.assertInfluencerSelection([testData.splitField]); - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(testData.bucketSpan); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(testData.jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(testData.jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of testData.jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(testData.jobGroups); - }); - it('job creation opens the advanced section', async () => { + await ml.testExecution.logTestStep('job creation opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.activateDedicatedIndexSwitch(); - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); await ml.jobWizardCommon.setModelMemoryLimit(testData.memoryLimit); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation creates the job and finishes processing' + ); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays the created job in the job list' + ); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -421,9 +413,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(testData.jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === testData.jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -442,9 +435,8 @@ export default function ({ getService }: FtrProviderContext) { ...testData.expected.modelSizeStats, } ); - }); - it('has detector results', async () => { + await ml.testExecution.logTestStep('has detector results'); for (let i = 0; i < testData.aggAndFieldIdentifiers.length; i++) { await ml.api.assertDetectorResultsExist(testData.jobId, i); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts index 58f3960153bc6..ba5628661bfc2 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_job.ts @@ -85,120 +85,101 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('job creation loads the job management page', async () => { + it('job creation loads the single metric wizard for the source data', async () => { + await ml.testExecution.logTestStep('job creation loads the job management page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); - }); - it('job creation loads the new job source selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the new job source selection page'); await ml.jobManagement.navigateToNewJobSourceSelection(); - }); - it('job creation loads the job type selection page', async () => { + await ml.testExecution.logTestStep('job creation loads the job type selection page'); await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_farequote'); - }); - it('job creation loads the single metric job wizard page', async () => { + await ml.testExecution.logTestStep('job creation loads the single metric job wizard page'); await ml.jobTypeSelection.selectSingleMetricJob(); }); - it('job creation displays the time range step', async () => { + it('job creation navigates through the single metric wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job creation sets the timerange', async () => { + await ml.testExecution.logTestStep('job creation sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Feb 7, 2016 @ 00:00:00.000', 'Feb 11, 2016 @ 23:59:54.000' ); - }); - it('job creation displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job creation displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job creation displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job creation selects field and aggregation', async () => { + await ml.testExecution.logTestStep('job creation selects field and aggregation'); await ml.jobWizardCommon.assertAggAndFieldInputExists(); await ml.jobWizardCommon.selectAggAndField(aggAndFieldIdentifier, true); await ml.jobWizardCommon.assertAnomalyChartExists('LINE'); - }); - it('job creation inputs the bucket span', async () => { + await ml.testExecution.logTestStep('job creation inputs the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.setBucketSpan(bucketSpan); - }); - it('job creation displays the job details step', async () => { + await ml.testExecution.logTestStep('job creation displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job creation inputs the job id', async () => { + await ml.testExecution.logTestStep('job creation inputs the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.setJobId(jobId); - }); - it('job creation inputs the job description', async () => { + await ml.testExecution.logTestStep('job creation inputs the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.setJobDescription(jobDescription); - }); - it('job creation inputs job groups', async () => { + await ml.testExecution.logTestStep('job creation inputs job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); for (const jobGroup of jobGroups) { await ml.jobWizardCommon.addJobGroup(jobGroup); } await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job creation opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job creation opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job creation adds a new custom url', async () => { + await ml.testExecution.logTestStep('job creation adds a new custom url'); await ml.jobWizardCommon.addCustomUrl({ label: 'check-kibana-dashboard' }); - }); - it('job creation assigns calendars', async () => { + await ml.testExecution.logTestStep('job creation assigns calendars'); await ml.jobWizardCommon.addCalendar(calendarId); - }); - it('job creation opens the advanced section', async () => { + await ml.testExecution.logTestStep('job creation opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job creation displays the model plot switch', async () => { + await ml.testExecution.logTestStep('job creation displays the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); - }); - it('job creation enables the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job creation enables the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.activateDedicatedIndexSwitch(); - }); - it('job creation inputs the model memory limit', async () => { + await ml.testExecution.logTestStep('job creation inputs the model memory limit'); await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); await ml.jobWizardCommon.setModelMemoryLimit(memoryLimit); - }); - it('job creation displays the validation step', async () => { + await ml.testExecution.logTestStep('job creation displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job creation displays the summary step', async () => { + await ml.testExecution.logTestStep('job creation displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job creation creates the job and finishes processing', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job creation creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job creation displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job creation displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -206,9 +187,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobId); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobId)).to.have.length(1); - }); - it('job creation displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job creation displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobId, getExpectedRow(jobId, jobGroups)); await ml.jobTable.assertJobRowDetailsCounts( @@ -216,124 +198,107 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobId), getExpectedModelSizeStats(jobId) ); - }); - it('job creation has detector results', async () => { + await ml.testExecution.logTestStep('job creation has detector results'); await ml.api.assertDetectorResultsExist(jobId, 0); }); - it('job cloning clicks the clone action and loads the single metric wizard', async () => { + it('job cloning opens the existing job in the single metric wizard', async () => { + await ml.testExecution.logTestStep( + 'job cloning clicks the clone action and loads the single metric wizard' + ); await ml.jobTable.clickCloneJobAction(jobId); await ml.jobTypeSelection.assertSingleMetricJobWizardOpen(); }); - it('job cloning displays the time range step', async () => { + it('job cloning navigates through the single metric wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep('job cloning displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); - }); - it('job cloning sets the timerange', async () => { + await ml.testExecution.logTestStep('job cloning sets the timerange'); await ml.jobWizardCommon.clickUseFullDataButton( 'Feb 7, 2016 @ 00:00:00.000', 'Feb 11, 2016 @ 23:59:54.000' ); - }); - it('job cloning displays the event rate chart', async () => { + await ml.testExecution.logTestStep('job cloning displays the event rate chart'); await ml.jobWizardCommon.assertEventRateChartExists(); await ml.jobWizardCommon.assertEventRateChartHasData(); - }); - it('job cloning displays the pick fields step', async () => { + await ml.testExecution.logTestStep('job cloning displays the pick fields step'); await ml.jobWizardCommon.advanceToPickFieldsSection(); - }); - it('job cloning pre-fills field and aggregation', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills field and aggregation'); await ml.jobWizardCommon.assertAggAndFieldInputExists(); await ml.jobWizardCommon.assertAggAndFieldSelection([aggAndFieldIdentifier]); await ml.jobWizardCommon.assertAnomalyChartExists('LINE'); - }); - it('job cloning pre-fills the bucket span', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the bucket span'); await ml.jobWizardCommon.assertBucketSpanInputExists(); await ml.jobWizardCommon.assertBucketSpanValue(bucketSpan); - }); - it('job cloning displays the job details step', async () => { + await ml.testExecution.logTestStep('job cloning displays the job details step'); await ml.jobWizardCommon.advanceToJobDetailsSection(); - }); - it('job cloning does not pre-fill the job id', async () => { + await ml.testExecution.logTestStep('job cloning does not pre-fill the job id'); await ml.jobWizardCommon.assertJobIdInputExists(); await ml.jobWizardCommon.assertJobIdValue(''); - }); - it('job cloning inputs the clone job id', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job id'); await ml.jobWizardCommon.setJobId(jobIdClone); - }); - it('job cloning pre-fills the job description', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the job description'); await ml.jobWizardCommon.assertJobDescriptionInputExists(); await ml.jobWizardCommon.assertJobDescriptionValue(jobDescription); - }); - it('job cloning pre-fills job groups', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills job groups'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.assertJobGroupSelection(jobGroups); - }); - it('job cloning inputs the clone job group', async () => { + await ml.testExecution.logTestStep('job cloning inputs the clone job group'); await ml.jobWizardCommon.assertJobGroupInputExists(); await ml.jobWizardCommon.addJobGroup('clone'); await ml.jobWizardCommon.assertJobGroupSelection(jobGroupsClone); - }); - it('job cloning opens the additional settings section', async () => { + await ml.testExecution.logTestStep('job cloning opens the additional settings section'); await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen(); - }); - it('job cloning persists custom urls', async () => { + await ml.testExecution.logTestStep('job cloning persists custom urls'); await ml.customUrls.assertCustomUrlItem(0, 'check-kibana-dashboard'); - }); - it('job cloning persists assigned calendars', async () => { + await ml.testExecution.logTestStep('job cloning persists assigned calendars'); await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); - }); - it('job cloning opens the advanced section', async () => { + await ml.testExecution.logTestStep('job cloning opens the advanced section'); await ml.jobWizardCommon.ensureAdvancedSectionOpen(); - }); - it('job cloning pre-fills the model plot switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the model plot switch'); await ml.jobWizardCommon.assertModelPlotSwitchExists(); await ml.jobWizardCommon.assertModelPlotSwitchCheckedState(true); - }); - it('job cloning pre-fills the dedicated index switch', async () => { + await ml.testExecution.logTestStep('job cloning pre-fills the dedicated index switch'); await ml.jobWizardCommon.assertDedicatedIndexSwitchExists(); await ml.jobWizardCommon.assertDedicatedIndexSwitchCheckedState(true); - }); - // MML during clone has changed in #61589 - // TODO: adjust test code to reflect the new behavior - it.skip('job cloning pre-fills the model memory limit', async () => { - await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); - await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - }); + // MML during clone has changed in #61589 + // TODO: adjust test code to reflect the new behavior + // await ml.testExecution.logTestStep('job cloning pre-fills the model memory limit'); + // await ml.jobWizardCommon.assertModelMemoryLimitInputExists(); + // await ml.jobWizardCommon.assertModelMemoryLimitValue(memoryLimit); - it('job cloning displays the validation step', async () => { + await ml.testExecution.logTestStep('job cloning displays the validation step'); await ml.jobWizardCommon.advanceToValidationSection(); - }); - it('job cloning displays the summary step', async () => { + await ml.testExecution.logTestStep('job cloning displays the summary step'); await ml.jobWizardCommon.advanceToSummarySection(); }); - it('job cloning creates the job and finishes processing', async () => { + it('job cloning runs the clone job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('job cloning creates the job and finishes processing'); await ml.jobWizardCommon.assertCreateJobButtonExists(); await ml.jobWizardCommon.createJobAndWaitForCompletion(); - }); - it('job cloning displays the created job in the job list', async () => { + await ml.testExecution.logTestStep('job cloning displays the created job in the job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); @@ -341,9 +306,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(1); - }); - it('job cloning displays details for the created job in the job list', async () => { + await ml.testExecution.logTestStep( + 'job cloning displays details for the created job in the job list' + ); await ml.jobTable.assertJobRowFields(jobIdClone, getExpectedRow(jobIdClone, jobGroupsClone)); await ml.jobTable.assertJobRowDetailsCounts( @@ -351,32 +317,32 @@ export default function ({ getService }: FtrProviderContext) { getExpectedCounts(jobIdClone), getExpectedModelSizeStats(jobIdClone) ); - }); - it('job cloning has detector results', async () => { + await ml.testExecution.logTestStep('job cloning has detector results'); await ml.api.assertDetectorResultsExist(jobId, 0); }); - it('job deletion has results for the job before deletion', async () => { + it('deletes the cloned job', async () => { + await ml.testExecution.logTestStep('job deletion has results for the job before deletion'); await ml.api.assertJobResultsExist(jobIdClone); - }); - it('job deletion triggers the delete action', async () => { + await ml.testExecution.logTestStep('job deletion triggers the delete action'); await ml.jobTable.clickDeleteJobAction(jobIdClone); - }); - it('job deletion confirms the delete modal', async () => { + await ml.testExecution.logTestStep('job deletion confirms the delete modal'); await ml.jobTable.confirmDeleteJobModal(); - }); - it('job deletion does not display the deleted job in the job list any more', async () => { + await ml.testExecution.logTestStep( + 'job deletion does not display the deleted job in the job list any more' + ); await ml.jobTable.waitForJobsToLoad(); await ml.jobTable.filterWithSearchString(jobIdClone); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === jobIdClone)).to.have.length(0); - }); - it('job deletion does not have results for the deleted job any more', async () => { + await ml.testExecution.logTestStep( + 'job deletion does not have results for the deleted job any more' + ); await ml.api.assertNoJobResultsExist(jobIdClone); }); }); diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts index 3855bd0c884cd..e1ab3f8e092c3 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts @@ -53,41 +53,39 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.cleanMlIndices(); }); - it('loads from job list row link', async () => { + it('opens a job from job list link', async () => { + await ml.testExecution.logTestStep('navigate to job list'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToJobManagement(); + await ml.testExecution.logTestStep('open job in single metric viewer'); await ml.jobTable.waitForJobsToLoad(); await ml.jobTable.filterWithSearchString(JOB_CONFIG.job_id); const rows = await ml.jobTable.parseJobTable(); expect(rows.filter((row) => row.id === JOB_CONFIG.job_id)).to.have.length(1); await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id); - await ml.common.waitForMlLoadingIndicatorToDisappear(); + await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); }); - it('pre-fills the job selection', async () => { + it('displays job results', async () => { + await ml.testExecution.logTestStep('pre-fills the job selection'); await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); - }); - it('pre-fills the detector input', async () => { + await ml.testExecution.logTestStep('pre-fills the detector input'); await ml.singleMetricViewer.assertDetectorInputExsist(); await ml.singleMetricViewer.assertDetectorInputValue('0'); - }); - it('displays the chart', async () => { + await ml.testExecution.logTestStep('displays the chart'); await ml.singleMetricViewer.assertChartExsist(); - }); - it('should display the annotations section', async () => { + await ml.testExecution.logTestStep('should display the annotations section'); await ml.singleMetricViewer.assertAnnotationsExists('loaded'); - }); - it('displays the anomalies table', async () => { + await ml.testExecution.logTestStep('displays the anomalies table'); await ml.anomaliesTable.assertTableExists(); - }); - it('anomalies table is not empty', async () => { + await ml.testExecution.logTestStep('anomalies table is not empty'); await ml.anomaliesTable.assertTableNotEmpty(); }); }); diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts index a62bfdcde0572..6beefaafa3792 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts @@ -56,108 +56,96 @@ export default function ({ getService }: FtrProviderContext) { await ml.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('loads the data frame analytics page', async () => { + it('loads the data frame analytics wizard', async () => { + await ml.testExecution.logTestStep('loads the data frame analytics page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToDataFrameAnalytics(); - }); - it('loads the source selection modal', async () => { + await ml.testExecution.logTestStep('loads the source selection modal'); await ml.dataFrameAnalytics.startAnalyticsCreation(); - }); - it('selects the source data and loads the job wizard page', async () => { + await ml.testExecution.logTestStep( + 'selects the source data and loads the job wizard page' + ); await ml.jobSourceSelection.selectSourceForAnalyticsJob(testData.source); await ml.dataFrameAnalyticsCreation.assertConfigurationStepActive(); }); - it('selects the job type', async () => { + it('navigates through the wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('selects the job type'); await ml.dataFrameAnalyticsCreation.assertJobTypeSelectExists(); await ml.dataFrameAnalyticsCreation.selectJobType(testData.jobType); - }); - it('inputs the dependent variable', async () => { + await ml.testExecution.logTestStep('inputs the dependent variable'); await ml.dataFrameAnalyticsCreation.assertDependentVariableInputExists(); await ml.dataFrameAnalyticsCreation.selectDependentVariable(testData.dependentVariable); - }); - it('inputs the training percent', async () => { + await ml.testExecution.logTestStep('inputs the training percent'); await ml.dataFrameAnalyticsCreation.assertTrainingPercentInputExists(); await ml.dataFrameAnalyticsCreation.setTrainingPercent(testData.trainingPercent); - }); - it('displays the source data preview', async () => { + await ml.testExecution.logTestStep('displays the source data preview'); await ml.dataFrameAnalyticsCreation.assertSourceDataPreviewExists(); - }); - it('displays the include fields selection', async () => { + await ml.testExecution.logTestStep('displays the include fields selection'); await ml.dataFrameAnalyticsCreation.assertIncludeFieldsSelectionExists(); - }); - it('continues to the additional options step', async () => { + await ml.testExecution.logTestStep('continues to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); - }); - it('accepts the suggested model memory limit', async () => { + await ml.testExecution.logTestStep('accepts the suggested model memory limit'); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputExists(); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputPopulated(); - }); - it('continues to the details step', async () => { + await ml.testExecution.logTestStep('continues to the details step'); await ml.dataFrameAnalyticsCreation.continueToDetailsStep(); - }); - it('inputs the job id', async () => { + await ml.testExecution.logTestStep('inputs the job id'); await ml.dataFrameAnalyticsCreation.assertJobIdInputExists(); await ml.dataFrameAnalyticsCreation.setJobId(testData.jobId); - }); - it('inputs the job description', async () => { + await ml.testExecution.logTestStep('inputs the job description'); await ml.dataFrameAnalyticsCreation.assertJobDescriptionInputExists(); await ml.dataFrameAnalyticsCreation.setJobDescription(testData.jobDescription); - }); - it('should default the set destination index to job id switch to true', async () => { + await ml.testExecution.logTestStep( + 'should default the set destination index to job id switch to true' + ); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdSwitchExists(); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdCheckState(true); - }); - it('should input the destination index', async () => { + await ml.testExecution.logTestStep('should input the destination index'); await ml.dataFrameAnalyticsCreation.setDestIndexSameAsIdCheckState(false); await ml.dataFrameAnalyticsCreation.assertDestIndexInputExists(); await ml.dataFrameAnalyticsCreation.setDestIndex(testData.destinationIndex); - }); - it('sets the create index pattern switch', async () => { + await ml.testExecution.logTestStep('sets the create index pattern switch'); await ml.dataFrameAnalyticsCreation.assertCreateIndexPatternSwitchExists(); await ml.dataFrameAnalyticsCreation.setCreateIndexPatternSwitchState( testData.createIndexPattern ); - }); - it('continues to the create step', async () => { + await ml.testExecution.logTestStep('continues to the create step'); await ml.dataFrameAnalyticsCreation.continueToCreateStep(); }); - it('creates and starts the analytics job', async () => { + it('runs the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('creates and starts the analytics job'); await ml.dataFrameAnalyticsCreation.assertCreateButtonExists(); await ml.dataFrameAnalyticsCreation.assertStartJobCheckboxCheckState(true); await ml.dataFrameAnalyticsCreation.createAnalyticsJob(testData.jobId); - }); - it('finishes analytics processing', async () => { + await ml.testExecution.logTestStep('finishes analytics processing'); await ml.dataFrameAnalytics.waitForAnalyticsCompletion(testData.jobId); - }); - it('displays the analytics table', async () => { + await ml.testExecution.logTestStep('displays the analytics table'); await ml.dataFrameAnalyticsCreation.navigateToJobManagementPage(); await ml.dataFrameAnalytics.assertAnalyticsTableExists(); - }); - it('displays the stats bar', async () => { + await ml.testExecution.logTestStep('displays the stats bar'); await ml.dataFrameAnalytics.assertAnalyticsStatsBarExists(); - }); - it('displays the created job in the analytics table', async () => { + await ml.testExecution.logTestStep('displays the created job in the analytics table'); await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); await ml.dataFrameAnalyticsTable.filterWithSearchString(testData.jobId); const rows = await ml.dataFrameAnalyticsTable.parseAnalyticsTable(); @@ -166,9 +154,10 @@ export default function ({ getService }: FtrProviderContext) { 1, `Filtered analytics table should have 1 row for job id '${testData.jobId}' (got matching items '${filteredRows}')` ); - }); - it('displays details for the created job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -180,25 +169,28 @@ export default function ({ getService }: FtrProviderContext) { }); }); - it('should open the edit form for the created job in the analytics table', async () => { + it('edits the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'should open the edit form for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.openEditFlyout(testData.jobId); - }); - it('should input the description in the edit form', async () => { + await ml.testExecution.logTestStep('should input the description in the edit form'); await ml.dataFrameAnalyticsEdit.assertJobDescriptionEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobDescriptionEdit(editedDescription); - }); - it('should input the model memory limit in the edit form', async () => { + await ml.testExecution.logTestStep( + 'should input the model memory limit in the edit form' + ); await ml.dataFrameAnalyticsEdit.assertJobMmlEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobMmlEdit('21mb'); - }); - it('should submit the edit job form', async () => { + await ml.testExecution.logTestStep('should submit the edit job form'); await ml.dataFrameAnalyticsEdit.updateAnalyticsJob(); - }); - it('displays details for the edited job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the edited job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: editedDescription, @@ -208,14 +200,14 @@ export default function ({ getService }: FtrProviderContext) { status: testData.expected.row.status, progress: testData.expected.row.progress, }); - }); - it('creates the destination index and writes results to it', async () => { + await ml.testExecution.logTestStep( + 'creates the destination index and writes results to it' + ); await ml.api.assertIndicesExist(testData.destinationIndex); await ml.api.assertIndicesNotEmpty(testData.destinationIndex); - }); - it('displays the results view for created job', async () => { + await ml.testExecution.logTestStep('displays the results view for created job'); await ml.dataFrameAnalyticsTable.openResultsView(); await ml.dataFrameAnalytics.assertClassificationEvaluatePanelElementsExists(); await ml.dataFrameAnalytics.assertClassificationTablePanelExists(); diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/cloning.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/cloning.ts index e8f0a69b397cd..5494f2f963d37 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/cloning.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/cloning.ts @@ -159,57 +159,62 @@ export default function ({ getService }: FtrProviderContext) { await ml.testResources.deleteIndexPatternByTitle(cloneDestIndex); }); - it('should open the wizard with a proper header', async () => { + it('opens the existing job in the data frame analytics job wizard', async () => { + await ml.testExecution.logTestStep('should open the wizard with a proper header'); const headerText = await ml.dataFrameAnalyticsCreation.getHeaderText(); expect(headerText).to.match(/Clone job/); await ml.dataFrameAnalyticsCreation.assertConfigurationStepActive(); }); - it('should have correct init form values for config step', async () => { + it('navigates through the wizard, checks and sets all needed fields', async () => { + await ml.testExecution.logTestStep( + 'should have correct init form values for config step' + ); await ml.dataFrameAnalyticsCreation.assertInitialCloneJobConfigStep( testData.job as DataFrameAnalyticsConfig ); - }); - it('should continue to the additional options step', async () => { + await ml.testExecution.logTestStep('should continue to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); - }); - it('should have correct init form values for additional options step', async () => { + await ml.testExecution.logTestStep( + 'should have correct init form values for additional options step' + ); await ml.dataFrameAnalyticsCreation.assertInitialCloneJobAdditionalOptionsStep( testData.job.analysis as DataFrameAnalyticsConfig['analysis'] ); - }); - it('should continue to the details step', async () => { + await ml.testExecution.logTestStep('should continue to the details step'); await ml.dataFrameAnalyticsCreation.continueToDetailsStep(); - }); - it('should have correct init form values for details step', async () => { + await ml.testExecution.logTestStep( + 'should have correct init form values for details step' + ); await ml.dataFrameAnalyticsCreation.assertInitialCloneJobDetailsStep( testData.job as DataFrameAnalyticsConfig ); await ml.dataFrameAnalyticsCreation.setJobId(cloneJobId); await ml.dataFrameAnalyticsCreation.setDestIndex(cloneDestIndex); - }); - it('should continue to the create step', async () => { + await ml.testExecution.logTestStep('should continue to the create step'); await ml.dataFrameAnalyticsCreation.continueToCreateStep(); }); - it('should have enabled Create button on a valid form input', async () => { + it('runs the clone analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'should have enabled Create button on a valid form input' + ); expect(await ml.dataFrameAnalyticsCreation.isCreateButtonDisabled()).to.be(false); - }); - it('should create a clone job', async () => { + await ml.testExecution.logTestStep('should create a clone job'); await ml.dataFrameAnalyticsCreation.createAnalyticsJob(cloneJobId); - }); - it('should finish analytics processing', async () => { + await ml.testExecution.logTestStep('should finish analytics processing'); await ml.dataFrameAnalytics.waitForAnalyticsCompletion(cloneJobId); - }); - it('should display the created job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'should display the created job in the analytics table' + ); await ml.dataFrameAnalyticsCreation.navigateToJobManagementPage(); await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); await ml.dataFrameAnalyticsTable.filterWithSearchString(cloneJobId); diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts index 5b89cec49db3e..e4bc7b940aaea 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts @@ -66,116 +66,102 @@ export default function ({ getService }: FtrProviderContext) { await ml.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('loads the data frame analytics page', async () => { + it('loads the data frame analytics wizard', async () => { + await ml.testExecution.logTestStep('loads the data frame analytics page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToDataFrameAnalytics(); - }); - it('loads the source selection modal', async () => { + await ml.testExecution.logTestStep('loads the source selection modal'); await ml.dataFrameAnalytics.startAnalyticsCreation(); - }); - it('selects the source data and loads the job wizard page', async () => { + await ml.testExecution.logTestStep( + 'selects the source data and loads the job wizard page' + ); await ml.jobSourceSelection.selectSourceForAnalyticsJob(testData.source); await ml.dataFrameAnalyticsCreation.assertConfigurationStepActive(); }); - it('selects the job type', async () => { + it('navigates through the wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('selects the job type'); await ml.dataFrameAnalyticsCreation.assertJobTypeSelectExists(); await ml.dataFrameAnalyticsCreation.selectJobType(testData.jobType); - }); - it('does not display the dependent variable input', async () => { + await ml.testExecution.logTestStep('does not display the dependent variable input'); await ml.dataFrameAnalyticsCreation.assertDependentVariableInputMissing(); - }); - it('does not display the training percent input', async () => { + await ml.testExecution.logTestStep('does not display the training percent input'); await ml.dataFrameAnalyticsCreation.assertTrainingPercentInputMissing(); - }); - it('displays the source data preview', async () => { + await ml.testExecution.logTestStep('displays the source data preview'); await ml.dataFrameAnalyticsCreation.assertSourceDataPreviewExists(); - }); - it('enables the source data preview histogram charts', async () => { + await ml.testExecution.logTestStep('enables the source data preview histogram charts'); await ml.dataFrameAnalyticsCreation.enableSourceDataPreviewHistogramCharts(); - }); - it('displays the source data preview histogram charts', async () => { + await ml.testExecution.logTestStep('displays the source data preview histogram charts'); await ml.dataFrameAnalyticsCreation.assertSourceDataPreviewHistogramCharts( testData.expected.histogramCharts ); - }); - it('displays the include fields selection', async () => { + await ml.testExecution.logTestStep('displays the include fields selection'); await ml.dataFrameAnalyticsCreation.assertIncludeFieldsSelectionExists(); - }); - it('continues to the additional options step', async () => { + await ml.testExecution.logTestStep('continues to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); - }); - it('accepts the suggested model memory limit', async () => { + await ml.testExecution.logTestStep('accepts the suggested model memory limit'); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputExists(); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputPopulated(); - }); - it('continues to the details step', async () => { + await ml.testExecution.logTestStep('continues to the details step'); await ml.dataFrameAnalyticsCreation.continueToDetailsStep(); - }); - it('inputs the job id', async () => { + await ml.testExecution.logTestStep('inputs the job id'); await ml.dataFrameAnalyticsCreation.assertJobIdInputExists(); await ml.dataFrameAnalyticsCreation.setJobId(testData.jobId); - }); - it('inputs the job description', async () => { + await ml.testExecution.logTestStep('inputs the job description'); await ml.dataFrameAnalyticsCreation.assertJobDescriptionInputExists(); await ml.dataFrameAnalyticsCreation.setJobDescription(testData.jobDescription); - }); - it('should default the set destination index to job id switch to true', async () => { + await ml.testExecution.logTestStep( + 'should default the set destination index to job id switch to true' + ); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdSwitchExists(); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdCheckState(true); - }); - it('should input the destination index', async () => { + await ml.testExecution.logTestStep('should input the destination index'); await ml.dataFrameAnalyticsCreation.setDestIndexSameAsIdCheckState(false); await ml.dataFrameAnalyticsCreation.assertDestIndexInputExists(); await ml.dataFrameAnalyticsCreation.setDestIndex(testData.destinationIndex); - }); - it('sets the create index pattern switch', async () => { + await ml.testExecution.logTestStep('sets the create index pattern switch'); await ml.dataFrameAnalyticsCreation.assertCreateIndexPatternSwitchExists(); await ml.dataFrameAnalyticsCreation.setCreateIndexPatternSwitchState( testData.createIndexPattern ); - }); - it('continues to the create step', async () => { + await ml.testExecution.logTestStep('continues to the create step'); await ml.dataFrameAnalyticsCreation.continueToCreateStep(); }); - it('creates and starts the analytics job', async () => { + it('runs the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('creates and starts the analytics job'); await ml.dataFrameAnalyticsCreation.assertCreateButtonExists(); await ml.dataFrameAnalyticsCreation.assertStartJobCheckboxCheckState(true); await ml.dataFrameAnalyticsCreation.createAnalyticsJob(testData.jobId); - }); - it('finishes analytics processing', async () => { + await ml.testExecution.logTestStep('finishes analytics processing'); await ml.dataFrameAnalytics.waitForAnalyticsCompletion(testData.jobId); - }); - it('displays the analytics table', async () => { + await ml.testExecution.logTestStep('displays the analytics table'); await ml.dataFrameAnalyticsCreation.navigateToJobManagementPage(); await ml.dataFrameAnalytics.assertAnalyticsTableExists(); - }); - it('displays the stats bar', async () => { + await ml.testExecution.logTestStep('displays the stats bar'); await ml.dataFrameAnalytics.assertAnalyticsStatsBarExists(); - }); - it('displays the created job in the analytics table', async () => { + await ml.testExecution.logTestStep('displays the created job in the analytics table'); await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); await ml.dataFrameAnalyticsTable.filterWithSearchString(testData.jobId); const rows = await ml.dataFrameAnalyticsTable.parseAnalyticsTable(); @@ -184,9 +170,10 @@ export default function ({ getService }: FtrProviderContext) { 1, `Filtered analytics table should have 1 row for job id '${testData.jobId}' (got matching items '${filteredRows}')` ); - }); - it('displays details for the created job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -198,25 +185,28 @@ export default function ({ getService }: FtrProviderContext) { }); }); - it('should open the edit form for the created job in the analytics table', async () => { + it('edits the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'should open the edit form for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.openEditFlyout(testData.jobId); - }); - it('should input the description in the edit form', async () => { + await ml.testExecution.logTestStep('should input the description in the edit form'); await ml.dataFrameAnalyticsEdit.assertJobDescriptionEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobDescriptionEdit(editedDescription); - }); - it('should input the model memory limit in the edit form', async () => { + await ml.testExecution.logTestStep( + 'should input the model memory limit in the edit form' + ); await ml.dataFrameAnalyticsEdit.assertJobMmlEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobMmlEdit('21mb'); - }); - it('should submit the edit job form', async () => { + await ml.testExecution.logTestStep('should submit the edit job form'); await ml.dataFrameAnalyticsEdit.updateAnalyticsJob(); - }); - it('displays details for the edited job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the edited job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: editedDescription, @@ -226,14 +216,14 @@ export default function ({ getService }: FtrProviderContext) { status: testData.expected.row.status, progress: testData.expected.row.progress, }); - }); - it('creates the destination index and writes results to it', async () => { + await ml.testExecution.logTestStep( + 'creates the destination index and writes results to it' + ); await ml.api.assertIndicesExist(testData.destinationIndex); await ml.api.assertIndicesNotEmpty(testData.destinationIndex); - }); - it('displays the results view for created job', async () => { + await ml.testExecution.logTestStep('displays the results view for created job'); await ml.dataFrameAnalyticsTable.openResultsView(); await ml.dataFrameAnalytics.assertOutlierTablePanelExists(); }); diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/regression_creation.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/regression_creation.ts index a67a348323347..af9c5417e4826 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/regression_creation.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/regression_creation.ts @@ -56,108 +56,96 @@ export default function ({ getService }: FtrProviderContext) { await ml.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('loads the data frame analytics page', async () => { + it('loads the data frame analytics wizard', async () => { + await ml.testExecution.logTestStep('loads the data frame analytics page'); await ml.navigation.navigateToMl(); await ml.navigation.navigateToDataFrameAnalytics(); - }); - it('loads the source selection modal', async () => { + await ml.testExecution.logTestStep('loads the source selection modal'); await ml.dataFrameAnalytics.startAnalyticsCreation(); - }); - it('selects the source data and loads the job wizard page', async () => { + await ml.testExecution.logTestStep( + 'selects the source data and loads the job wizard page' + ); await ml.jobSourceSelection.selectSourceForAnalyticsJob(testData.source); await ml.dataFrameAnalyticsCreation.assertConfigurationStepActive(); }); - it('selects the job type', async () => { + it('navigates through the wizard and sets all needed fields', async () => { + await ml.testExecution.logTestStep('selects the job type'); await ml.dataFrameAnalyticsCreation.assertJobTypeSelectExists(); await ml.dataFrameAnalyticsCreation.selectJobType(testData.jobType); - }); - it('inputs the dependent variable', async () => { + await ml.testExecution.logTestStep('inputs the dependent variable'); await ml.dataFrameAnalyticsCreation.assertDependentVariableInputExists(); await ml.dataFrameAnalyticsCreation.selectDependentVariable(testData.dependentVariable); - }); - it('inputs the training percent', async () => { + await ml.testExecution.logTestStep('inputs the training percent'); await ml.dataFrameAnalyticsCreation.assertTrainingPercentInputExists(); await ml.dataFrameAnalyticsCreation.setTrainingPercent(testData.trainingPercent); - }); - it('displays the source data preview', async () => { + await ml.testExecution.logTestStep('displays the source data preview'); await ml.dataFrameAnalyticsCreation.assertSourceDataPreviewExists(); - }); - it('displays the include fields selection', async () => { + await ml.testExecution.logTestStep('displays the include fields selection'); await ml.dataFrameAnalyticsCreation.assertIncludeFieldsSelectionExists(); - }); - it('continues to the additional options step', async () => { + await ml.testExecution.logTestStep('continues to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); - }); - it('accepts the suggested model memory limit', async () => { + await ml.testExecution.logTestStep('accepts the suggested model memory limit'); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputExists(); await ml.dataFrameAnalyticsCreation.assertModelMemoryInputPopulated(); - }); - it('continues to the details step', async () => { + await ml.testExecution.logTestStep('continues to the details step'); await ml.dataFrameAnalyticsCreation.continueToDetailsStep(); - }); - it('inputs the job id', async () => { + await ml.testExecution.logTestStep('inputs the job id'); await ml.dataFrameAnalyticsCreation.assertJobIdInputExists(); await ml.dataFrameAnalyticsCreation.setJobId(testData.jobId); - }); - it('inputs the job description', async () => { + await ml.testExecution.logTestStep('inputs the job description'); await ml.dataFrameAnalyticsCreation.assertJobDescriptionInputExists(); await ml.dataFrameAnalyticsCreation.setJobDescription(testData.jobDescription); - }); - it('should default the set destination index to job id switch to true', async () => { + await ml.testExecution.logTestStep( + 'should default the set destination index to job id switch to true' + ); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdSwitchExists(); await ml.dataFrameAnalyticsCreation.assertDestIndexSameAsIdCheckState(true); - }); - it('should input the destination index', async () => { + await ml.testExecution.logTestStep('should input the destination index'); await ml.dataFrameAnalyticsCreation.setDestIndexSameAsIdCheckState(false); await ml.dataFrameAnalyticsCreation.assertDestIndexInputExists(); await ml.dataFrameAnalyticsCreation.setDestIndex(testData.destinationIndex); - }); - it('sets the create index pattern switch', async () => { + await ml.testExecution.logTestStep('sets the create index pattern switch'); await ml.dataFrameAnalyticsCreation.assertCreateIndexPatternSwitchExists(); await ml.dataFrameAnalyticsCreation.setCreateIndexPatternSwitchState( testData.createIndexPattern ); - }); - it('continues to the create step', async () => { + await ml.testExecution.logTestStep('continues to the create step'); await ml.dataFrameAnalyticsCreation.continueToCreateStep(); }); - it('creates and starts the analytics job', async () => { + it('runs the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep('creates and starts the analytics job'); await ml.dataFrameAnalyticsCreation.assertCreateButtonExists(); await ml.dataFrameAnalyticsCreation.assertStartJobCheckboxCheckState(true); await ml.dataFrameAnalyticsCreation.createAnalyticsJob(testData.jobId); - }); - it('finishes analytics processing', async () => { + await ml.testExecution.logTestStep('finishes analytics processing'); await ml.dataFrameAnalytics.waitForAnalyticsCompletion(testData.jobId); - }); - it('displays the analytics table', async () => { + await ml.testExecution.logTestStep('displays the analytics table'); await ml.dataFrameAnalyticsCreation.navigateToJobManagementPage(); await ml.dataFrameAnalytics.assertAnalyticsTableExists(); - }); - it('displays the stats bar', async () => { + await ml.testExecution.logTestStep('displays the stats bar'); await ml.dataFrameAnalytics.assertAnalyticsStatsBarExists(); - }); - it('displays the created job in the analytics table', async () => { + await ml.testExecution.logTestStep('displays the created job in the analytics table'); await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); await ml.dataFrameAnalyticsTable.filterWithSearchString(testData.jobId); const rows = await ml.dataFrameAnalyticsTable.parseAnalyticsTable(); @@ -166,9 +154,10 @@ export default function ({ getService }: FtrProviderContext) { 1, `Filtered analytics table should have 1 row for job id '${testData.jobId}' (got matching items '${filteredRows}')` ); - }); - it('displays details for the created job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: testData.jobDescription, @@ -180,25 +169,28 @@ export default function ({ getService }: FtrProviderContext) { }); }); - it('should open the edit form for the created job in the analytics table', async () => { + it('edits the analytics job and displays it correctly in the job list', async () => { + await ml.testExecution.logTestStep( + 'should open the edit form for the created job in the analytics table' + ); await ml.dataFrameAnalyticsTable.openEditFlyout(testData.jobId); - }); - it('should input the description in the edit form', async () => { + await ml.testExecution.logTestStep('should input the description in the edit form'); await ml.dataFrameAnalyticsEdit.assertJobDescriptionEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobDescriptionEdit(editedDescription); - }); - it('should input the model memory limit in the edit form', async () => { + await ml.testExecution.logTestStep( + 'should input the model memory limit in the edit form' + ); await ml.dataFrameAnalyticsEdit.assertJobMmlEditInputExists(); await ml.dataFrameAnalyticsEdit.setJobMmlEdit('21mb'); - }); - it('should submit the edit job form', async () => { + await ml.testExecution.logTestStep('should submit the edit job form'); await ml.dataFrameAnalyticsEdit.updateAnalyticsJob(); - }); - it('displays details for the edited job in the analytics table', async () => { + await ml.testExecution.logTestStep( + 'displays details for the edited job in the analytics table' + ); await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { id: testData.jobId, description: editedDescription, @@ -208,14 +200,14 @@ export default function ({ getService }: FtrProviderContext) { status: testData.expected.row.status, progress: testData.expected.row.progress, }); - }); - it('creates the destination index and writes results to it', async () => { + await ml.testExecution.logTestStep( + 'creates the destination index and writes results to it' + ); await ml.api.assertIndicesExist(testData.destinationIndex); await ml.api.assertIndicesNotEmpty(testData.destinationIndex); - }); - it('displays the results view for created job', async () => { + await ml.testExecution.logTestStep('displays the results view for created job'); await ml.dataFrameAnalyticsTable.openResultsView(); await ml.dataFrameAnalytics.assertRegressionEvaluatePanelElementsExists(); await ml.dataFrameAnalytics.assertRegressionTablePanelExists(); diff --git a/x-pack/test/functional/apps/ml/data_visualizer/file_data_visualizer.ts b/x-pack/test/functional/apps/ml/data_visualizer/file_data_visualizer.ts index 3c9111c246630..4b3b0c38f2acf 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/file_data_visualizer.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/file_data_visualizer.ts @@ -47,40 +47,34 @@ export default function ({ getService }: FtrProviderContext) { await ml.api.deleteIndices(testData.indexName); }); - it('loads the data visualizer selector page', async () => { + it('displays and imports a file', async () => { + await ml.testExecution.logTestStep('loads the data visualizer selector page'); await ml.navigation.navigateToDataVisualizer(); - }); - it('loads the file upload page', async () => { + await ml.testExecution.logTestStep('loads the file upload page'); await ml.dataVisualizer.navigateToFileUpload(); - }); - it('selects a file and loads visualizer results', async () => { + await ml.testExecution.logTestStep('selects a file and loads visualizer results'); await ml.dataVisualizerFileBased.selectFile(testData.filePath); - }); - it('displays the components of the file details page', async () => { + await ml.testExecution.logTestStep('displays the components of the file details page'); await ml.dataVisualizerFileBased.assertFileTitle(testData.expected.results.title); await ml.dataVisualizerFileBased.assertFileContentPanelExists(); await ml.dataVisualizerFileBased.assertSummaryPanelExists(); await ml.dataVisualizerFileBased.assertFileStatsPanelExists(); - }); - it('loads the import settings page', async () => { + await ml.testExecution.logTestStep('loads the import settings page'); await ml.dataVisualizerFileBased.navigateToFileImport(); - }); - it('sets the index name', async () => { + await ml.testExecution.logTestStep('sets the index name'); await ml.dataVisualizerFileBased.setIndexName(testData.indexName); - }); - it('sets the create index pattern checkbox', async () => { + await ml.testExecution.logTestStep('sets the create index pattern checkbox'); await ml.dataVisualizerFileBased.setCreateIndexPatternCheckboxState( testData.createIndexPattern ); - }); - it('imports the file', async () => { + await ml.testExecution.logTestStep('imports the file'); await ml.dataVisualizerFileBased.startImportAndWaitForProcessing(); }); }); @@ -88,15 +82,14 @@ export default function ({ getService }: FtrProviderContext) { for (const testData of testDataListNegative) { describe(testData.suiteSuffix, function () { - it('loads the data visualizer selector page', async () => { + it('does not import an invalid file', async () => { + await ml.testExecution.logTestStep('loads the data visualizer selector page'); await ml.navigation.navigateToDataVisualizer(); - }); - it('loads the file upload page', async () => { + await ml.testExecution.logTestStep('loads the file upload page'); await ml.dataVisualizer.navigateToFileUpload(); - }); - it('selects a file and displays an error', async () => { + await ml.testExecution.logTestStep('selects a file and displays an error'); await ml.dataVisualizerFileBased.selectFile(testData.filePath, true); }); }); diff --git a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts index eb76a8b4298af..2dc1d9ec00eca 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts @@ -292,67 +292,74 @@ export default function ({ getService }: FtrProviderContext) { }; function runTests(testData: TestData) { - it(`${testData.suiteTitle} loads the saved search selection page`, async () => { + it(`${testData.suiteTitle} loads the source data in the data visualizer`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} loads the saved search selection page` + ); await ml.dataVisualizer.navigateToIndexPatternSelection(); - }); - it(`${testData.suiteTitle} loads the index data visualizer page`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} loads the index data visualizer page` + ); await ml.jobSourceSelection.selectSourceForIndexBasedDataVisualizer( testData.sourceIndexOrSavedSearch ); }); - it(`${testData.suiteTitle} displays the time range step`, async () => { + it(`${testData.suiteTitle} displays index details`, async () => { + await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the time range step`); await ml.dataVisualizerIndexBased.assertTimeRangeSelectorSectionExists(); - }); - it(`${testData.suiteTitle} loads data for full time range`, async () => { + await ml.testExecution.logTestStep(`${testData.suiteTitle} loads data for full time range`); await ml.dataVisualizerIndexBased.clickUseFullDataButton(testData.expected.totalDocCount); - }); - it(`${testData.suiteTitle} displays the panels of fields`, async () => { + await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the panels of fields`); await ml.dataVisualizerIndexBased.assertFieldsPanelsExist(testData.expected.fieldsPanelCount); - }); - if (testData.expected.metricCards !== undefined && testData.expected.metricCards.length > 0) { - it(`${testData.suiteTitle} displays the Metrics panel`, async () => { + if (testData.expected.metricCards !== undefined && testData.expected.metricCards.length > 0) { + await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the Metrics panel`); await ml.dataVisualizerIndexBased.assertFieldsPanelForTypesExist([ ML_JOB_FIELD_TYPES.NUMBER, ]); // document_count not exposed as a type in the panel - }); - it(`${testData.suiteTitle} displays the expected metric field cards`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} displays the expected metric field cards` + ); for (const fieldCard of testData.expected.metricCards as FieldVisConfig[]) { await ml.dataVisualizerIndexBased.assertCardExists(fieldCard.type, fieldCard.fieldName); } - }); - it(`${testData.suiteTitle} filters metric fields cards with search`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} filters metric fields cards with search` + ); await ml.dataVisualizerIndexBased.filterFieldsPanelWithSearchString( ['number'], testData.metricFieldsFilter, testData.expected.metricFieldsFilterCardCount ); - }); - } + } - if ( - testData.expected.nonMetricCards !== undefined && - testData.expected.nonMetricCards.length > 0 - ) { - it(`${testData.suiteTitle} displays the non-metric Fields panel`, async () => { + if ( + testData.expected.nonMetricCards !== undefined && + testData.expected.nonMetricCards.length > 0 + ) { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} displays the non-metric Fields panel` + ); await ml.dataVisualizerIndexBased.assertFieldsPanelForTypesExist( getFieldTypes(testData.expected.nonMetricCards as FieldVisConfig[]) ); - }); - it(`${testData.suiteTitle} displays the expected non-metric field cards`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} displays the expected non-metric field cards` + ); for (const fieldCard of testData.expected.nonMetricCards!) { await ml.dataVisualizerIndexBased.assertCardExists(fieldCard.type, fieldCard.fieldName); } - }); - it(`${testData.suiteTitle} sets the non metric field types input`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} sets the non metric field types input` + ); const fieldTypes: ML_JOB_FIELD_TYPES[] = getFieldTypes( testData.expected.nonMetricCards as FieldVisConfig[] ); @@ -362,16 +369,17 @@ export default function ({ getService }: FtrProviderContext) { testData.nonMetricFieldsTypeFilter, testData.expected.nonMetricFieldsTypeFilterCardCount ); - }); - it(`${testData.suiteTitle} filters non-metric fields cards with search`, async () => { + await ml.testExecution.logTestStep( + `${testData.suiteTitle} filters non-metric fields cards with search` + ); await ml.dataVisualizerIndexBased.filterFieldsPanelWithSearchString( getFieldTypes(testData.expected.nonMetricCards as FieldVisConfig[]), testData.nonMetricFieldsFilter, testData.expected.nonMetricFieldsFilterCardCount ); - }); - } + } + }); } describe('index based', function () { diff --git a/x-pack/test/functional/apps/ml/pages.ts b/x-pack/test/functional/apps/ml/pages.ts index 3691e6b1afcdc..5d084d5abe11e 100644 --- a/x-pack/test/functional/apps/ml/pages.ts +++ b/x-pack/test/functional/apps/ml/pages.ts @@ -16,53 +16,49 @@ export default function ({ getService }: FtrProviderContext) { await ml.securityUI.loginAsMlPowerUser(); }); - it('loads the home page', async () => { + it('loads the ML pages', async () => { + await ml.testExecution.logTestStep('home'); await ml.navigation.navigateToMl(); - }); - it('loads the overview page', async () => { + await ml.testExecution.logTestStep('loads the overview page'); await ml.navigation.navigateToOverview(); - }); - it('loads the anomaly detection area', async () => { + await ml.testExecution.logTestStep('loads the anomaly detection area'); await ml.navigation.navigateToAnomalyDetection(); - }); - it('loads the job management page', async () => { + await ml.testExecution.logTestStep('loads the job management page'); await ml.navigation.navigateToJobManagement(); await ml.jobManagement.assertJobStatsBarExists(); await ml.jobManagement.assertJobTableExists(); await ml.jobManagement.assertCreateNewJobButtonExists(); - }); - it('loads the settings page', async () => { + await ml.testExecution.logTestStep('loads the settings page'); await ml.navigation.navigateToSettings(); await ml.settings.assertSettingsManageCalendarsLinkExists(); await ml.settings.assertSettingsCreateCalendarLinkExists(); await ml.settings.assertSettingsManageFilterListsLinkExists(); await ml.settings.assertSettingsCreateFilterListLinkExists(); - }); - it('loads the data frame analytics page', async () => { + await ml.testExecution.logTestStep('loads the data frame analytics page'); await ml.navigation.navigateToDataFrameAnalytics(); await ml.dataFrameAnalytics.assertEmptyListMessageExists(); - }); - it('loads the data visualizer page', async () => { + await ml.testExecution.logTestStep('loads the data visualizer page'); await ml.navigation.navigateToDataVisualizer(); await ml.dataVisualizer.assertDataVisualizerImportDataCardExists(); await ml.dataVisualizer.assertDataVisualizerIndexDataCardExists(); - }); - it('should load the stack management with the ML menu item being present', async () => { + await ml.testExecution.logTestStep( + 'should load the stack management with the ML menu item being present' + ); await ml.navigation.navigateToStackManagement(); - }); - it('should load the jobs list page in stack management', async () => { + await ml.testExecution.logTestStep('should load the jobs list page in stack management'); await ml.navigation.navigateToStackManagementJobsListPage(); - }); - it('should load the analytics jobs list page in stack management', async () => { + await ml.testExecution.logTestStep( + 'should load the analytics jobs list page in stack management' + ); await ml.navigation.navigateToStackManagementJobsListPageAnalyticsTab(); }); }); diff --git a/x-pack/test/functional/apps/transform/cloning.ts b/x-pack/test/functional/apps/transform/cloning.ts index d94923d9a7cce..d5c972cb8bd1f 100644 --- a/x-pack/test/functional/apps/transform/cloning.ts +++ b/x-pack/test/functional/apps/transform/cloning.ts @@ -87,138 +87,130 @@ export default function ({ getService }: FtrProviderContext) { await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('should load the home page', async () => { + it('opens the existing transform in the wizard', async () => { + await transform.testExecution.logTestStep('should load the home page'); await transform.navigation.navigateTo(); await transform.management.assertTransformListPageExists(); - }); - it('should display the transforms table', async () => { + await transform.testExecution.logTestStep('should display the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('should display the original transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'should display the original transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(transformConfig.id); const rows = await transform.table.parseTransformTable(); expect(rows.filter((row) => row.id === transformConfig.id)).to.have.length(1); - }); - it('should show the actions popover', async () => { + await transform.testExecution.logTestStep('should show the actions popover'); await transform.table.assertTransformRowActions(false); - }); - it('should display the define pivot step', async () => { + await transform.testExecution.logTestStep('should display the define pivot step'); await transform.table.clickTransformRowAction('Clone'); await transform.wizard.assertDefineStepActive(); }); - it('should load the index preview', async () => { + it('navigates through the wizard, checks and sets all needed fields', async () => { + await transform.testExecution.logTestStep('should load the index preview'); await transform.wizard.assertIndexPreviewLoaded(); - }); - it('should show the index preview', async () => { + await transform.testExecution.logTestStep('should show the index preview'); await transform.wizard.assertIndexPreview( testData.expected.indexPreview.columns, testData.expected.indexPreview.rows ); - }); - it('should display the query input', async () => { + await transform.testExecution.logTestStep('should display the query input'); await transform.wizard.assertQueryInputExists(); await transform.wizard.assertQueryValue(''); - }); - it('should show the pre-filled group-by configuration', async () => { + await transform.testExecution.logTestStep( + 'should show the pre-filled group-by configuration' + ); await transform.wizard.assertGroupByEntryExists( testData.expected.groupBy.index, testData.expected.groupBy.label ); - }); - it('should show the pre-filled aggs configuration', async () => { + await transform.testExecution.logTestStep( + 'should show the pre-filled aggs configuration' + ); await transform.wizard.assertAggregationEntryExists( testData.expected.aggs.index, testData.expected.aggs.label ); - }); - it('should show the pivot preview', async () => { + await transform.testExecution.logTestStep('should show the pivot preview'); await transform.wizard.assertPivotPreviewChartHistogramButtonMissing(); await transform.wizard.assertPivotPreviewColumnValues( testData.expected.pivotPreview.column, testData.expected.pivotPreview.values ); - }); - it('should load the details step', async () => { + await transform.testExecution.logTestStep('should load the details step'); await transform.wizard.advanceToDetailsStep(); - }); - it('should input the transform id', async () => { + await transform.testExecution.logTestStep('should input the transform id'); await transform.wizard.assertTransformIdInputExists(); await transform.wizard.assertTransformIdValue(''); await transform.wizard.setTransformId(testData.transformId); - }); - it('should input the transform description', async () => { + await transform.testExecution.logTestStep('should input the transform description'); await transform.wizard.assertTransformDescriptionInputExists(); await transform.wizard.assertTransformDescriptionValue(''); await transform.wizard.setTransformDescription(testData.transformDescription); - }); - it('should input the destination index', async () => { + await transform.testExecution.logTestStep('should input the destination index'); await transform.wizard.assertDestinationIndexInputExists(); await transform.wizard.assertDestinationIndexValue(''); await transform.wizard.setDestinationIndex(testData.destinationIndex); - }); - it('should display the create index pattern switch', async () => { + await transform.testExecution.logTestStep( + 'should display the create index pattern switch' + ); await transform.wizard.assertCreateIndexPatternSwitchExists(); await transform.wizard.assertCreateIndexPatternSwitchCheckState(true); - }); - it('should display the continuous mode switch', async () => { + await transform.testExecution.logTestStep('should display the continuous mode switch'); await transform.wizard.assertContinuousModeSwitchExists(); await transform.wizard.assertContinuousModeSwitchCheckState(false); - }); - it('should load the create step', async () => { + await transform.testExecution.logTestStep('should load the create step'); await transform.wizard.advanceToCreateStep(); - }); - it('should display the create and start button', async () => { + await transform.testExecution.logTestStep('should display the create and start button'); await transform.wizard.assertCreateAndStartButtonExists(); await transform.wizard.assertCreateAndStartButtonEnabled(true); - }); - it('should display the create button', async () => { + await transform.testExecution.logTestStep('should display the create button'); await transform.wizard.assertCreateButtonExists(); await transform.wizard.assertCreateButtonEnabled(true); - }); - it('should display the copy to clipboard button', async () => { + await transform.testExecution.logTestStep('should display the copy to clipboard button'); await transform.wizard.assertCopyToClipboardButtonExists(); await transform.wizard.assertCopyToClipboardButtonEnabled(true); }); - it('should create the transform', async () => { + it('runs the clone transform and displays it correctly in the job list', async () => { + await transform.testExecution.logTestStep('should create the transform'); await transform.wizard.createTransform(); - }); - it('should start the transform and finish processing', async () => { + await transform.testExecution.logTestStep( + 'should start the transform and finish processing' + ); await transform.wizard.startTransform(); await transform.wizard.waitForProgressBarComplete(); - }); - it('should return to the management page', async () => { + await transform.testExecution.logTestStep('should return to the management page'); await transform.wizard.returnToManagement(); - }); - it('should display the transforms table', async () => { + await transform.testExecution.logTestStep('should display the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('should display the created transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'should display the created transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(testData.transformId); const rows = await transform.table.parseTransformTable(); diff --git a/x-pack/test/functional/apps/transform/creation_index_pattern.ts b/x-pack/test/functional/apps/transform/creation_index_pattern.ts index 7c9983101f607..daecc26186ac1 100644 --- a/x-pack/test/functional/apps/transform/creation_index_pattern.ts +++ b/x-pack/test/functional/apps/transform/creation_index_pattern.ts @@ -260,63 +260,54 @@ export default function ({ getService }: FtrProviderContext) { await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('loads the home page', async () => { + it('loads the wizard for the source data', async () => { + await transform.testExecution.logTestStep('loads the home page'); await transform.navigation.navigateTo(); await transform.management.assertTransformListPageExists(); - }); - it('displays the stats bar', async () => { + await transform.testExecution.logTestStep('displays the stats bar'); await transform.management.assertTransformStatsBarExists(); - }); - it('loads the source selection modal', async () => { + await transform.testExecution.logTestStep('loads the source selection modal'); await transform.management.startTransformCreation(); - }); - it('selects the source data', async () => { + await transform.testExecution.logTestStep('selects the source data'); await transform.sourceSelection.selectSource(testData.source); }); - it('displays the define pivot step', async () => { + it('navigates through the wizard and sets all needed fields', async () => { + await transform.testExecution.logTestStep('displays the define pivot step'); await transform.wizard.assertDefineStepActive(); - }); - it('loads the index preview', async () => { + await transform.testExecution.logTestStep('loads the index preview'); await transform.wizard.assertIndexPreviewLoaded(); - }); - it('shows the index preview', async () => { + await transform.testExecution.logTestStep('shows the index preview'); await transform.wizard.assertIndexPreview( testData.expected.indexPreview.columns, testData.expected.indexPreview.rows ); - }); - it('displays an empty pivot preview', async () => { + await transform.testExecution.logTestStep('displays an empty pivot preview'); await transform.wizard.assertPivotPreviewEmpty(); - }); - it('displays the query input', async () => { + await transform.testExecution.logTestStep('displays the query input'); await transform.wizard.assertQueryInputExists(); await transform.wizard.assertQueryValue(''); - }); - it('displays the advanced query editor switch', async () => { + await transform.testExecution.logTestStep('displays the advanced query editor switch'); await transform.wizard.assertAdvancedQueryEditorSwitchExists(); await transform.wizard.assertAdvancedQueryEditorSwitchCheckState(false); - }); - it('enables the index preview histogram charts', async () => { + await transform.testExecution.logTestStep('enables the index preview histogram charts'); await transform.wizard.enableIndexPreviewHistogramCharts(); - }); - it('displays the index preview histogram charts', async () => { + await transform.testExecution.logTestStep('displays the index preview histogram charts'); await transform.wizard.assertIndexPreviewHistogramCharts( testData.expected.histogramCharts ); - }); - it('adds the group by entries', async () => { + await transform.testExecution.logTestStep('adds the group by entries'); for (const [index, entry] of testData.groupByEntries.entries()) { await transform.wizard.assertGroupByInputExists(); await transform.wizard.assertGroupByInputValue([]); @@ -327,112 +318,97 @@ export default function ({ getService }: FtrProviderContext) { entry.intervalLabel ); } - }); - it('adds the aggregation entries', async () => { + await transform.testExecution.logTestStep('adds the aggregation entries'); await transform.wizard.addAggregationEntries(testData.aggregationEntries); - }); - it('displays the advanced pivot editor switch', async () => { + await transform.testExecution.logTestStep('displays the advanced pivot editor switch'); await transform.wizard.assertAdvancedPivotEditorSwitchExists(); await transform.wizard.assertAdvancedPivotEditorSwitchCheckState(false); - }); - it('displays the advanced configuration', async () => { + await transform.testExecution.logTestStep('displays the advanced configuration'); await transform.wizard.enabledAdvancedPivotEditor(); await transform.wizard.assertAdvancedPivotEditorContent( testData.expected.pivotAdvancedEditorValueArr ); - }); - it('loads the pivot preview', async () => { + await transform.testExecution.logTestStep('loads the pivot preview'); await transform.wizard.assertPivotPreviewLoaded(); - }); - it('shows the pivot preview', async () => { + await transform.testExecution.logTestStep('shows the pivot preview'); await transform.wizard.assertPivotPreviewChartHistogramButtonMissing(); await transform.wizard.assertPivotPreviewColumnValues( testData.expected.pivotPreview.column, testData.expected.pivotPreview.values ); - }); - it('loads the details step', async () => { + await transform.testExecution.logTestStep('loads the details step'); await transform.wizard.advanceToDetailsStep(); - }); - it('inputs the transform id', async () => { + await transform.testExecution.logTestStep('inputs the transform id'); await transform.wizard.assertTransformIdInputExists(); await transform.wizard.assertTransformIdValue(''); await transform.wizard.setTransformId(testData.transformId); - }); - it('inputs the transform description', async () => { + await transform.testExecution.logTestStep('inputs the transform description'); await transform.wizard.assertTransformDescriptionInputExists(); await transform.wizard.assertTransformDescriptionValue(''); await transform.wizard.setTransformDescription(testData.transformDescription); - }); - it('inputs the destination index', async () => { + await transform.testExecution.logTestStep('inputs the destination index'); await transform.wizard.assertDestinationIndexInputExists(); await transform.wizard.assertDestinationIndexValue(''); await transform.wizard.setDestinationIndex(testData.destinationIndex); - }); - it('displays the create index pattern switch', async () => { + await transform.testExecution.logTestStep('displays the create index pattern switch'); await transform.wizard.assertCreateIndexPatternSwitchExists(); await transform.wizard.assertCreateIndexPatternSwitchCheckState(true); - }); - it('displays the continuous mode switch', async () => { + await transform.testExecution.logTestStep('displays the continuous mode switch'); await transform.wizard.assertContinuousModeSwitchExists(); await transform.wizard.assertContinuousModeSwitchCheckState(false); - }); - it('loads the create step', async () => { + await transform.testExecution.logTestStep('loads the create step'); await transform.wizard.advanceToCreateStep(); - }); - it('displays the create and start button', async () => { + await transform.testExecution.logTestStep('displays the create and start button'); await transform.wizard.assertCreateAndStartButtonExists(); await transform.wizard.assertCreateAndStartButtonEnabled(true); - }); - it('displays the create button', async () => { + await transform.testExecution.logTestStep('displays the create button'); await transform.wizard.assertCreateButtonExists(); await transform.wizard.assertCreateButtonEnabled(true); - }); - it('displays the copy to clipboard button', async () => { + await transform.testExecution.logTestStep('displays the copy to clipboard button'); await transform.wizard.assertCopyToClipboardButtonExists(); await transform.wizard.assertCopyToClipboardButtonEnabled(true); }); - it('creates the transform', async () => { + it('runs the transform and displays it correctly in the job list', async () => { + await transform.testExecution.logTestStep('creates the transform'); await transform.wizard.createTransform(); - }); - it('starts the transform and finishes processing', async () => { + await transform.testExecution.logTestStep('starts the transform and finishes processing'); await transform.wizard.startTransform(); await transform.wizard.waitForProgressBarComplete(); - }); - it('returns to the management page', async () => { + await transform.testExecution.logTestStep('returns to the management page'); await transform.wizard.returnToManagement(); - }); - it('displays the transforms table', async () => { + await transform.testExecution.logTestStep('displays the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('displays the created transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'displays the created transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(testData.transformId); const rows = await transform.table.parseTransformTable(); expect(rows.filter((row) => row.id === testData.transformId)).to.have.length(1); - }); - it('transform creation displays details for the created transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'transform creation displays details for the created transform in the transform list' + ); await transform.table.assertTransformRowFields(testData.transformId, { id: testData.transformId, description: testData.transformDescription, diff --git a/x-pack/test/functional/apps/transform/creation_saved_search.ts b/x-pack/test/functional/apps/transform/creation_saved_search.ts index 54cc5b3f62933..d3cbc1159a9c7 100644 --- a/x-pack/test/functional/apps/transform/creation_saved_search.ts +++ b/x-pack/test/functional/apps/transform/creation_saved_search.ts @@ -79,51 +79,44 @@ export default function ({ getService }: FtrProviderContext) { await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex); }); - it('loads the home page', async () => { + it('loads the wizard for the source data', async () => { + await transform.testExecution.logTestStep('loads the home page'); await transform.navigation.navigateTo(); await transform.management.assertTransformListPageExists(); - }); - it('displays the stats bar', async () => { + await transform.testExecution.logTestStep('displays the stats bar'); await transform.management.assertTransformStatsBarExists(); - }); - it('loads the source selection modal', async () => { + await transform.testExecution.logTestStep('loads the source selection modal'); await transform.management.startTransformCreation(); - }); - it('selects the source data', async () => { + await transform.testExecution.logTestStep('selects the source data'); await transform.sourceSelection.selectSource(testData.source); }); - it('displays the define pivot step', async () => { + it('navigates through the wizard and sets all needed fields', async () => { + await transform.testExecution.logTestStep('displays the define pivot step'); await transform.wizard.assertDefineStepActive(); - }); - it('loads the index preview', async () => { + await transform.testExecution.logTestStep('loads the index preview'); await transform.wizard.assertIndexPreviewLoaded(); - }); - it('shows the filtered index preview', async () => { + await transform.testExecution.logTestStep('shows the filtered index preview'); await transform.wizard.assertIndexPreviewColumnValues( testData.expected.indexPreview.column, testData.expected.indexPreview.values ); - }); - it('displays an empty pivot preview', async () => { + await transform.testExecution.logTestStep('displays an empty pivot preview'); await transform.wizard.assertPivotPreviewEmpty(); - }); - it('hides the query input', async () => { + await transform.testExecution.logTestStep('hides the query input'); await transform.wizard.assertQueryInputMissing(); - }); - it('hides the advanced query editor switch', async () => { + await transform.testExecution.logTestStep('hides the advanced query editor switch'); await transform.wizard.assertAdvancedQueryEditorSwitchMissing(); - }); - it('adds the group by entries', async () => { + await transform.testExecution.logTestStep('adds the group by entries'); for (const [index, entry] of testData.groupByEntries.entries()) { await transform.wizard.assertGroupByInputExists(); await transform.wizard.assertGroupByInputValue([]); @@ -134,108 +127,94 @@ export default function ({ getService }: FtrProviderContext) { entry.intervalLabel ); } - }); - it('adds the aggregation entries', async () => { + await transform.testExecution.logTestStep('adds the aggregation entries'); for (const [index, agg] of testData.aggregationEntries.entries()) { await transform.wizard.assertAggregationInputExists(); await transform.wizard.assertAggregationInputValue([]); await transform.wizard.addAggregationEntry(index, agg.identifier, agg.label); } - }); - it('displays the advanced pivot editor switch', async () => { + await transform.testExecution.logTestStep('displays the advanced pivot editor switch'); await transform.wizard.assertAdvancedPivotEditorSwitchExists(); await transform.wizard.assertAdvancedPivotEditorSwitchCheckState(false); - }); - it('loads the pivot preview', async () => { + await transform.testExecution.logTestStep('loads the pivot preview'); await transform.wizard.assertPivotPreviewLoaded(); - }); - it('shows the pivot preview', async () => { + await transform.testExecution.logTestStep('shows the pivot preview'); await transform.wizard.assertPivotPreviewColumnValues( testData.expected.pivotPreview.column, testData.expected.pivotPreview.values ); - }); - it('loads the details step', async () => { + await transform.testExecution.logTestStep('loads the details step'); await transform.wizard.advanceToDetailsStep(); - }); - it('inputs the transform id', async () => { + await transform.testExecution.logTestStep('inputs the transform id'); await transform.wizard.assertTransformIdInputExists(); await transform.wizard.assertTransformIdValue(''); await transform.wizard.setTransformId(testData.transformId); - }); - it('inputs the transform description', async () => { + await transform.testExecution.logTestStep('inputs the transform description'); await transform.wizard.assertTransformDescriptionInputExists(); await transform.wizard.assertTransformDescriptionValue(''); await transform.wizard.setTransformDescription(testData.transformDescription); - }); - it('inputs the destination index', async () => { + await transform.testExecution.logTestStep('inputs the destination index'); await transform.wizard.assertDestinationIndexInputExists(); await transform.wizard.assertDestinationIndexValue(''); await transform.wizard.setDestinationIndex(testData.destinationIndex); - }); - it('displays the create index pattern switch', async () => { + await transform.testExecution.logTestStep('displays the create index pattern switch'); await transform.wizard.assertCreateIndexPatternSwitchExists(); await transform.wizard.assertCreateIndexPatternSwitchCheckState(true); - }); - it('displays the continuous mode switch', async () => { + await transform.testExecution.logTestStep('displays the continuous mode switch'); await transform.wizard.assertContinuousModeSwitchExists(); await transform.wizard.assertContinuousModeSwitchCheckState(false); - }); - it('loads the create step', async () => { + await transform.testExecution.logTestStep('loads the create step'); await transform.wizard.advanceToCreateStep(); - }); - it('displays the create and start button', async () => { + await transform.testExecution.logTestStep('displays the create and start button'); await transform.wizard.assertCreateAndStartButtonExists(); await transform.wizard.assertCreateAndStartButtonEnabled(true); - }); - it('displays the create button', async () => { + await transform.testExecution.logTestStep('displays the create button'); await transform.wizard.assertCreateButtonExists(); await transform.wizard.assertCreateButtonEnabled(true); - }); - it('displays the copy to clipboard button', async () => { + await transform.testExecution.logTestStep('displays the copy to clipboard button'); await transform.wizard.assertCopyToClipboardButtonExists(); await transform.wizard.assertCopyToClipboardButtonEnabled(true); }); - it('creates the transform', async () => { + it('runs the transform and displays it correctly in the job list', async () => { + await transform.testExecution.logTestStep('creates the transform'); await transform.wizard.createTransform(); - }); - it('starts the transform and finishes processing', async () => { + await transform.testExecution.logTestStep('starts the transform and finishes processing'); await transform.wizard.startTransform(); await transform.wizard.waitForProgressBarComplete(); - }); - it('returns to the management page', async () => { + await transform.testExecution.logTestStep('returns to the management page'); await transform.wizard.returnToManagement(); - }); - it('displays the transforms table', async () => { + await transform.testExecution.logTestStep('displays the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('displays the created transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'displays the created transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(testData.transformId); const rows = await transform.table.parseTransformTable(); expect(rows.filter((row) => row.id === testData.transformId)).to.have.length(1); - }); - it('transform creation displays details for the created transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'transform creation displays details for the created transform in the transform list' + ); await transform.table.assertTransformRowFields(testData.transformId, { id: testData.transformId, description: testData.transformDescription, @@ -243,13 +222,15 @@ export default function ({ getService }: FtrProviderContext) { mode: testData.expected.row.mode, progress: testData.expected.row.progress, }); - }); - it('expands the transform management table row and walks through available tabs', async () => { + await transform.testExecution.logTestStep( + 'expands the transform management table row and walks through available tabs' + ); await transform.table.assertTransformExpandedRow(); - }); - it('displays the transform preview in the expanded row', async () => { + await transform.testExecution.logTestStep( + 'displays the transform preview in the expanded row' + ); await transform.table.assertTransformsExpandedRowPreviewColumnValues( testData.expected.pivotPreview.column, testData.expected.pivotPreview.values diff --git a/x-pack/test/functional/apps/transform/editing.ts b/x-pack/test/functional/apps/transform/editing.ts index 44ecca17328a7..5582d279833e7 100644 --- a/x-pack/test/functional/apps/transform/editing.ts +++ b/x-pack/test/functional/apps/transform/editing.ts @@ -61,32 +61,32 @@ export default function ({ getService }: FtrProviderContext) { }; describe(`${testData.suiteTitle}`, function () { - it('should load the home page', async () => { + it('opens the edit flyout for an existing transform', async () => { + await transform.testExecution.logTestStep('should load the home page'); await transform.navigation.navigateTo(); await transform.management.assertTransformListPageExists(); - }); - it('should display the transforms table', async () => { + await transform.testExecution.logTestStep('should display the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('should display the original transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'should display the original transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(transformConfig.id); const rows = await transform.table.parseTransformTable(); expect(rows.filter((row) => row.id === transformConfig.id)).to.have.length(1); - }); - it('should show the actions popover', async () => { + await transform.testExecution.logTestStep('should show the actions popover'); await transform.table.assertTransformRowActions(false); - }); - it('should show the edit flyout', async () => { + await transform.testExecution.logTestStep('should show the edit flyout'); await transform.table.clickTransformRowAction('Edit'); await transform.editFlyout.assertTransformEditFlyoutExists(); }); - it('should update the transform description', async () => { + it('navigates through the edit flyout and sets all needed fields', async () => { + await transform.testExecution.logTestStep('should update the transform description'); await transform.editFlyout.assertTransformEditFlyoutInputExists('Description'); await transform.editFlyout.assertTransformEditFlyoutInputValue( 'Description', @@ -96,18 +96,18 @@ export default function ({ getService }: FtrProviderContext) { 'Description', testData.transformDescription ); - }); - it('should update the transform documents per second', async () => { + await transform.testExecution.logTestStep( + 'should update the transform documents per second' + ); await transform.editFlyout.assertTransformEditFlyoutInputExists('DocsPerSecond'); await transform.editFlyout.assertTransformEditFlyoutInputValue('DocsPerSecond', ''); await transform.editFlyout.setTransformEditFlyoutInputValue( 'DocsPerSecond', testData.transformDocsPerSecond ); - }); - it('should update the transform frequency', async () => { + await transform.testExecution.logTestStep('should update the transform frequency'); await transform.editFlyout.assertTransformEditFlyoutInputExists('Frequency'); await transform.editFlyout.assertTransformEditFlyoutInputValue('Frequency', ''); await transform.editFlyout.setTransformEditFlyoutInputValue( @@ -116,22 +116,24 @@ export default function ({ getService }: FtrProviderContext) { ); }); - it('should update the transform', async () => { + it('updates the transform and displays it correctly in the job list', async () => { + await transform.testExecution.logTestStep('should update the transform'); await transform.editFlyout.updateTransform(); - }); - it('should display the transforms table', async () => { + await transform.testExecution.logTestStep('should display the transforms table'); await transform.management.assertTransformsTableExists(); - }); - it('should display the updated transform in the transform list', async () => { + await transform.testExecution.logTestStep( + 'should display the updated transform in the transform list' + ); await transform.table.refreshTransformList(); await transform.table.filterWithSearchString(transformConfig.id); const rows = await transform.table.parseTransformTable(); expect(rows.filter((row) => row.id === transformConfig.id)).to.have.length(1); - }); - it('should display the updated transform in the transform list row cells', async () => { + await transform.testExecution.logTestStep( + 'should display the updated transform in the transform list row cells' + ); await transform.table.assertTransformRowFields(transformConfig.id, { id: transformConfig.id, description: testData.transformDescription, @@ -139,9 +141,10 @@ export default function ({ getService }: FtrProviderContext) { mode: testData.expected.row.mode, progress: testData.expected.row.progress, }); - }); - it('should display the messages tab and include an update message', async () => { + await transform.testExecution.logTestStep( + 'should display the messages tab and include an update message' + ); await transform.table.assertTransformExpandedRowMessages(testData.expected.messageText); }); }); diff --git a/x-pack/test/functional/services/ml/common_api.ts b/x-pack/test/functional/services/ml/common_api.ts new file mode 100644 index 0000000000000..e68dbf4bdcaf6 --- /dev/null +++ b/x-pack/test/functional/services/ml/common_api.ts @@ -0,0 +1,22 @@ +/* + * 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 { ProvidedType } from '@kbn/test/types/ftr'; + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export const COMMON_REQUEST_HEADERS = { + 'kbn-xsrf': 'some-xsrf-token', +}; + +export type MlCommonAPI = ProvidedType; + +export function MachineLearningCommonAPIProvider({}: FtrProviderContext) { + return { + async getCommonRequestHeader() { + return COMMON_REQUEST_HEADERS; + }, + }; +} diff --git a/x-pack/test/functional/services/ml/common.ts b/x-pack/test/functional/services/ml/common_ui.ts similarity index 92% rename from x-pack/test/functional/services/ml/common.ts rename to x-pack/test/functional/services/ml/common_ui.ts index 3333a81f028fa..b66fd7087654d 100644 --- a/x-pack/test/functional/services/ml/common.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -12,13 +12,9 @@ interface SetValueOptions { typeCharByChar?: boolean; } -export const COMMON_REQUEST_HEADERS = { - 'kbn-xsrf': 'some-xsrf-token', -}; +export type MlCommonUI = ProvidedType; -export type MlCommon = ProvidedType; - -export function MachineLearningCommonProvider({ getService }: FtrProviderContext) { +export function MachineLearningCommonUIProvider({ getService }: FtrProviderContext) { const log = getService('log'); const retry = getService('retry'); const testSubjects = getService('testSubjects'); diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts index 474d6845ef3ec..9282cb4a057de 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts @@ -11,7 +11,7 @@ import { } from '../../../../plugins/ml/public/application/data_frame_analytics/common/analytics'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { MlCommon } from './common'; +import { MlCommonUI } from './common_ui'; import { MlApi } from './api'; enum ANALYSIS_CONFIG_TYPE { @@ -32,7 +32,7 @@ const isClassificationAnalysis = (arg: any): arg is ClassificationAnalysis => { export function MachineLearningDataFrameAnalyticsCreationProvider( { getService }: FtrProviderContext, - mlCommon: MlCommon, + mlCommonUI: MlCommonUI, mlApi: MlApi ) { const testSubjects = getService('testSubjects'); @@ -113,16 +113,20 @@ export function MachineLearningDataFrameAnalyticsCreationProvider( }, async setJobId(jobId: string) { - await mlCommon.setValueWithChecks('mlAnalyticsCreateJobFlyoutJobIdInput', jobId, { + await mlCommonUI.setValueWithChecks('mlAnalyticsCreateJobFlyoutJobIdInput', jobId, { clearWithKeyboard: true, }); await this.assertJobIdValue(jobId); }, async setJobDescription(jobDescription: string) { - await mlCommon.setValueWithChecks('mlDFAnalyticsJobCreationJobDescription', jobDescription, { - clearWithKeyboard: true, - }); + await mlCommonUI.setValueWithChecks( + 'mlDFAnalyticsJobCreationJobDescription', + jobDescription, + { + clearWithKeyboard: true, + } + ); await this.assertJobDescriptionValue(jobDescription); }, @@ -218,7 +222,7 @@ export function MachineLearningDataFrameAnalyticsCreationProvider( }, async setDestIndex(destIndex: string) { - await mlCommon.setValueWithChecks( + await mlCommonUI.setValueWithChecks( 'mlAnalyticsCreateJobFlyoutDestinationIndexInput', destIndex, { @@ -405,7 +409,7 @@ export function MachineLearningDataFrameAnalyticsCreationProvider( async setModelMemory(modelMemory: string) { await retry.tryForTime(15 * 1000, async () => { - await mlCommon.setValueWithChecks( + await mlCommonUI.setValueWithChecks( 'mlAnalyticsCreateJobWizardModelMemoryInput', modelMemory, { diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_edit.ts b/x-pack/test/functional/services/ml/data_frame_analytics_edit.ts index fd06dd24d6f8b..6e446667875d9 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_edit.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_edit.ts @@ -6,11 +6,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { MlCommon } from './common'; +import { MlCommonUI } from './common_ui'; export function MachineLearningDataFrameAnalyticsEditProvider( { getService }: FtrProviderContext, - mlCommon: MlCommon + mlCommonUI: MlCommonUI ) { const testSubjects = getService('testSubjects'); const retry = getService('retry'); @@ -43,14 +43,14 @@ export function MachineLearningDataFrameAnalyticsEditProvider( ); }, async setJobDescriptionEdit(jobDescription: string) { - await mlCommon.setValueWithChecks('mlAnalyticsEditFlyoutDescriptionInput', jobDescription, { + await mlCommonUI.setValueWithChecks('mlAnalyticsEditFlyoutDescriptionInput', jobDescription, { clearWithKeyboard: true, }); await this.assertJobDescriptionEditValue(jobDescription); }, async setJobMmlEdit(mml: string) { - await mlCommon.setValueWithChecks('mlAnalyticsEditFlyoutmodelMemoryLimitInput', mml, { + await mlCommonUI.setValueWithChecks('mlAnalyticsEditFlyoutmodelMemoryLimitInput', mml, { clearWithKeyboard: true, }); await this.assertJobMmlEditValue(mml); diff --git a/x-pack/test/functional/services/ml/data_visualizer_file_based.ts b/x-pack/test/functional/services/ml/data_visualizer_file_based.ts index 8c5e40dd5dbdd..14c6f8de7d329 100644 --- a/x-pack/test/functional/services/ml/data_visualizer_file_based.ts +++ b/x-pack/test/functional/services/ml/data_visualizer_file_based.ts @@ -7,11 +7,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { MlCommon } from './common'; +import { MlCommonUI } from './common_ui'; export function MachineLearningDataVisualizerFileBasedProvider( { getService, getPageObjects }: FtrProviderContext, - mlCommon: MlCommon + mlCommonUI: MlCommonUI ) { const log = getService('log'); const retry = getService('retry'); @@ -75,7 +75,7 @@ export function MachineLearningDataVisualizerFileBasedProvider( }, async setIndexName(indexName: string) { - await mlCommon.setValueWithChecks('mlFileDataVisIndexNameInput', indexName, { + await mlCommonUI.setValueWithChecks('mlFileDataVisIndexNameInput', indexName, { clearWithKeyboard: true, }); await this.assertIndexNameValue(indexName); diff --git a/x-pack/test/functional/services/ml/index.ts b/x-pack/test/functional/services/ml/index.ts index fd36bb0f47f95..d7ff60440bf31 100644 --- a/x-pack/test/functional/services/ml/index.ts +++ b/x-pack/test/functional/services/ml/index.ts @@ -9,7 +9,8 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { MachineLearningAnomaliesTableProvider } from './anomalies_table'; import { MachineLearningAnomalyExplorerProvider } from './anomaly_explorer'; import { MachineLearningAPIProvider } from './api'; -import { MachineLearningCommonProvider } from './common'; +import { MachineLearningCommonAPIProvider } from './common_api'; +import { MachineLearningCommonUIProvider } from './common_ui'; import { MachineLearningCustomUrlsProvider } from './custom_urls'; import { MachineLearningDataFrameAnalyticsProvider } from './data_frame_analytics'; import { MachineLearningDataFrameAnalyticsCreationProvider } from './data_frame_analytics_creation'; @@ -33,10 +34,12 @@ import { MachineLearningSecurityCommonProvider } from './security_common'; import { MachineLearningSecurityUIProvider } from './security_ui'; import { MachineLearningSettingsProvider } from './settings'; import { MachineLearningSingleMetricViewerProvider } from './single_metric_viewer'; +import { MachineLearningTestExecutionProvider } from './test_execution'; import { MachineLearningTestResourcesProvider } from './test_resources'; export function MachineLearningProvider(context: FtrProviderContext) { - const common = MachineLearningCommonProvider(context); + const commonAPI = MachineLearningCommonAPIProvider(context); + const commonUI = MachineLearningCommonUIProvider(context); const anomaliesTable = MachineLearningAnomaliesTableProvider(context); const anomalyExplorer = MachineLearningAnomalyExplorerProvider(context); @@ -45,22 +48,22 @@ export function MachineLearningProvider(context: FtrProviderContext) { const dataFrameAnalytics = MachineLearningDataFrameAnalyticsProvider(context, api); const dataFrameAnalyticsCreation = MachineLearningDataFrameAnalyticsCreationProvider( context, - common, + commonUI, api ); - const dataFrameAnalyticsEdit = MachineLearningDataFrameAnalyticsEditProvider(context, common); + const dataFrameAnalyticsEdit = MachineLearningDataFrameAnalyticsEditProvider(context, commonUI); const dataFrameAnalyticsTable = MachineLearningDataFrameAnalyticsTableProvider(context); const dataVisualizer = MachineLearningDataVisualizerProvider(context); - const dataVisualizerFileBased = MachineLearningDataVisualizerFileBasedProvider(context, common); + const dataVisualizerFileBased = MachineLearningDataVisualizerFileBasedProvider(context, commonUI); const dataVisualizerIndexBased = MachineLearningDataVisualizerIndexBasedProvider(context); const jobManagement = MachineLearningJobManagementProvider(context, api); const jobSelection = MachineLearningJobSelectionProvider(context); const jobSourceSelection = MachineLearningJobSourceSelectionProvider(context); const jobTable = MachineLearningJobTableProvider(context); const jobTypeSelection = MachineLearningJobTypeSelectionProvider(context); - const jobWizardAdvanced = MachineLearningJobWizardAdvancedProvider(context, common); + const jobWizardAdvanced = MachineLearningJobWizardAdvancedProvider(context, commonUI); const jobWizardCategorization = MachineLearningJobWizardCategorizationProvider(context); - const jobWizardCommon = MachineLearningJobWizardCommonProvider(context, common, customUrls); + const jobWizardCommon = MachineLearningJobWizardCommonProvider(context, commonUI, customUrls); const jobWizardMultiMetric = MachineLearningJobWizardMultiMetricProvider(context); const jobWizardPopulation = MachineLearningJobWizardPopulationProvider(context); const navigation = MachineLearningNavigationProvider(context); @@ -68,13 +71,15 @@ export function MachineLearningProvider(context: FtrProviderContext) { const securityUI = MachineLearningSecurityUIProvider(context, securityCommon); const settings = MachineLearningSettingsProvider(context); const singleMetricViewer = MachineLearningSingleMetricViewerProvider(context); + const testExecution = MachineLearningTestExecutionProvider(context); const testResources = MachineLearningTestResourcesProvider(context); return { anomaliesTable, anomalyExplorer, api, - common, + commonAPI, + commonUI, customUrls, dataFrameAnalytics, dataFrameAnalyticsCreation, @@ -98,6 +103,7 @@ export function MachineLearningProvider(context: FtrProviderContext) { securityUI, settings, singleMetricViewer, + testExecution, testResources, }; } diff --git a/x-pack/test/functional/services/ml/job_wizard_advanced.ts b/x-pack/test/functional/services/ml/job_wizard_advanced.ts index e4d2ecf66f646..dbb0c1ceeb14e 100644 --- a/x-pack/test/functional/services/ml/job_wizard_advanced.ts +++ b/x-pack/test/functional/services/ml/job_wizard_advanced.ts @@ -6,11 +6,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { MlCommon } from './common'; +import { MlCommonUI } from './common_ui'; export function MachineLearningJobWizardAdvancedProvider( { getService }: FtrProviderContext, - mlCommon: MlCommon + mlCommonUI: MlCommonUI ) { const comboBox = getService('comboBox'); const testSubjects = getService('testSubjects'); @@ -54,7 +54,7 @@ export function MachineLearningJobWizardAdvancedProvider( }, async setQueryDelay(queryDelay: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputQueryDelay', queryDelay, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputQueryDelay', queryDelay, { clearWithKeyboard: true, typeCharByChar: true, }); @@ -74,7 +74,7 @@ export function MachineLearningJobWizardAdvancedProvider( }, async setFrequency(frequency: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputFrequency', frequency, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputFrequency', frequency, { clearWithKeyboard: true, typeCharByChar: true, }); @@ -94,7 +94,7 @@ export function MachineLearningJobWizardAdvancedProvider( }, async setScrollSize(scrollSize: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputScrollSize', scrollSize, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputScrollSize', scrollSize, { clearWithKeyboard: true, typeCharByChar: true, }); @@ -303,7 +303,7 @@ export function MachineLearningJobWizardAdvancedProvider( }, async setDetectorDescription(description: string) { - await mlCommon.setValueWithChecks('mlAdvancedDetectorDescriptionInput', description, { + await mlCommonUI.setValueWithChecks('mlAdvancedDetectorDescriptionInput', description, { clearWithKeyboard: true, }); await this.assertDetectorDescriptionValue(description); diff --git a/x-pack/test/functional/services/ml/job_wizard_common.ts b/x-pack/test/functional/services/ml/job_wizard_common.ts index 2843c36e08a1d..97253c5f45303 100644 --- a/x-pack/test/functional/services/ml/job_wizard_common.ts +++ b/x-pack/test/functional/services/ml/job_wizard_common.ts @@ -6,12 +6,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { MlCommon } from './common'; +import { MlCommonUI } from './common_ui'; import { MlCustomUrls } from './custom_urls'; export function MachineLearningJobWizardCommonProvider( { getService }: FtrProviderContext, - mlCommon: MlCommon, + mlCommonUI: MlCommonUI, customUrls: MlCustomUrls ) { const comboBox = getService('comboBox'); @@ -128,7 +128,7 @@ export function MachineLearningJobWizardCommonProvider( }, async setBucketSpan(bucketSpan: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputBucketSpan', bucketSpan, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputBucketSpan', bucketSpan, { clearWithKeyboard: true, typeCharByChar: true, }); @@ -148,7 +148,7 @@ export function MachineLearningJobWizardCommonProvider( }, async setJobId(jobId: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputJobId', jobId, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputJobId', jobId, { clearWithKeyboard: true, }); await this.assertJobIdValue(jobId); @@ -169,7 +169,7 @@ export function MachineLearningJobWizardCommonProvider( }, async setJobDescription(jobDescription: string) { - await mlCommon.setValueWithChecks('mlJobWizardInputJobDescription', jobDescription, { + await mlCommonUI.setValueWithChecks('mlJobWizardInputJobDescription', jobDescription, { clearWithKeyboard: true, }); await this.assertJobDescriptionValue(jobDescription); @@ -219,11 +219,11 @@ export function MachineLearningJobWizardCommonProvider( async addCalendar(calendarId: string) { await this.ensureAdditionalSettingsSectionOpen(); - await comboBox.setCustom('mlJobWizardComboBoxCalendars > comboBoxInput', calendarId); + await comboBox.set('mlJobWizardComboBoxCalendars > comboBoxInput', calendarId); const actualCalendarSelection = await this.getSelectedCalendars(); expect(actualCalendarSelection).to.contain( calendarId, - `Expected calendar selection to conatin '${calendarId}' (got '${actualCalendarSelection}')` + `Expected calendar selection to contain '${calendarId}' (got '${actualCalendarSelection}')` ); }, @@ -372,7 +372,7 @@ export function MachineLearningJobWizardCommonProvider( subj = advancedSectionSelector(subj); } await retry.tryForTime(15 * 1000, async () => { - await mlCommon.setValueWithChecks(subj, modelMemoryLimit, { clearWithKeyboard: true }); + await mlCommonUI.setValueWithChecks(subj, modelMemoryLimit, { clearWithKeyboard: true }); await this.assertModelMemoryLimitValue(modelMemoryLimit, { withAdvancedSection: sectionOptions.withAdvancedSection, }); diff --git a/x-pack/test/functional/services/ml/test_execution.ts b/x-pack/test/functional/services/ml/test_execution.ts new file mode 100644 index 0000000000000..230c20b4d2d5a --- /dev/null +++ b/x-pack/test/functional/services/ml/test_execution.ts @@ -0,0 +1,17 @@ +/* + * 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 { FtrProviderContext } from '../../ftr_provider_context'; + +export function MachineLearningTestExecutionProvider({ getService }: FtrProviderContext) { + const log = getService('log'); + + return { + async logTestStep(stepTitle: string) { + await log.debug(`=== TEST STEP === ${stepTitle}`); + }, + }; +} diff --git a/x-pack/test/functional/services/ml/test_resources.ts b/x-pack/test/functional/services/ml/test_resources.ts index 675ec890b9edf..949635964c613 100644 --- a/x-pack/test/functional/services/ml/test_resources.ts +++ b/x-pack/test/functional/services/ml/test_resources.ts @@ -6,7 +6,7 @@ import { ProvidedType } from '@kbn/test/types/ftr'; import { savedSearches, dashboards } from './test_resources_data'; -import { COMMON_REQUEST_HEADERS } from './common'; +import { COMMON_REQUEST_HEADERS } from './common_api'; import { FtrProviderContext } from '../../ftr_provider_context'; export enum SavedObjectType { diff --git a/x-pack/test/functional/services/transform/index.ts b/x-pack/test/functional/services/transform/index.ts index 24091ba773218..83a227ce56604 100644 --- a/x-pack/test/functional/services/transform/index.ts +++ b/x-pack/test/functional/services/transform/index.ts @@ -14,6 +14,7 @@ import { TransformSecurityCommonProvider } from './security_common'; import { TransformSecurityUIProvider } from './security_ui'; import { TransformSourceSelectionProvider } from './source_selection'; import { TransformTableProvider } from './transform_table'; +import { TransformTestExecutionProvider } from './test_execution'; import { TransformWizardProvider } from './wizard'; import { MachineLearningTestResourcesProvider } from '../ml/test_resources'; @@ -27,6 +28,7 @@ export function TransformProvider(context: FtrProviderContext) { const securityUI = TransformSecurityUIProvider(context, securityCommon); const sourceSelection = TransformSourceSelectionProvider(context); const table = TransformTableProvider(context); + const testExecution = TransformTestExecutionProvider(context); const testResources = MachineLearningTestResourcesProvider(context); const wizard = TransformWizardProvider(context); @@ -39,6 +41,7 @@ export function TransformProvider(context: FtrProviderContext) { securityUI, sourceSelection, table, + testExecution, testResources, wizard, }; diff --git a/x-pack/test/functional/services/transform/test_execution.ts b/x-pack/test/functional/services/transform/test_execution.ts new file mode 100644 index 0000000000000..ee27f9ee5194b --- /dev/null +++ b/x-pack/test/functional/services/transform/test_execution.ts @@ -0,0 +1,17 @@ +/* + * 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 { FtrProviderContext } from '../../ftr_provider_context'; + +export function TransformTestExecutionProvider({ getService }: FtrProviderContext) { + const log = getService('log'); + + return { + async logTestStep(stepTitle: string) { + await log.debug(`=== TEST STEP === ${stepTitle}`); + }, + }; +}