forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Enable change point detection functional tests (elastic#201612)
## Summary Fixes elastic#200091 Fixes elastic#200836 - Splits change point detection functional tests into separate groups for dashboard and cases integrations. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed
- Loading branch information
Showing
5 changed files
with
113 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
x-pack/test/functional/apps/aiops/change_point_detection_cases.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
import { USER } from '../../services/ml/security_common'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const elasticChart = getService('elasticChart'); | ||
const esArchiver = getService('esArchiver'); | ||
const aiops = getService('aiops'); | ||
const cases = getService('cases'); | ||
|
||
// aiops lives in the ML UI so we need some related services. | ||
const ml = getService('ml'); | ||
|
||
describe('change point detection in cases', function () { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce'); | ||
await ml.testResources.createDataViewIfNeeded('ft_ecommerce', 'order_date'); | ||
await ml.testResources.setKibanaTimeZoneToUTC(); | ||
await ml.securityUI.loginAsMlPowerUser(); | ||
}); | ||
|
||
after(async () => { | ||
await ml.testResources.deleteDataViewByTitle('ft_ecommerce'); | ||
await cases.api.deleteAllCases(); | ||
}); | ||
|
||
it('attaches change point charts to a case', async () => { | ||
await ml.navigation.navigateToMl(); | ||
await elasticChart.setNewChartUiDebugFlag(true); | ||
await aiops.changePointDetectionPage.navigateToDataViewSelection(); | ||
await ml.jobSourceSelection.selectSourceForChangePointDetection('ft_ecommerce'); | ||
await aiops.changePointDetectionPage.assertChangePointDetectionPageExists(); | ||
|
||
await aiops.changePointDetectionPage.clickUseFullDataButton(); | ||
await aiops.changePointDetectionPage.selectMetricField(0, 'products.discount_amount'); | ||
|
||
const caseParams = { | ||
title: 'ML Change Point Detection case', | ||
description: 'Case with a change point detection attachment', | ||
tag: 'ml_change_point_detection', | ||
reporter: USER.ML_POWERUSER, | ||
}; | ||
|
||
await ml.testExecution.logTestStep('attaches chart to a case'); | ||
await aiops.changePointDetectionPage.attachChartsToCases(0, caseParams); | ||
|
||
await ml.testExecution.logTestStep('checks if attachment is present in the case'); | ||
await ml.cases.assertCaseWithChangePointDetectionChartsAttachment(caseParams); | ||
}); | ||
}); | ||
} |
48 changes: 48 additions & 0 deletions
48
x-pack/test/functional/apps/aiops/change_point_detection_dashboard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const elasticChart = getService('elasticChart'); | ||
const esArchiver = getService('esArchiver'); | ||
const aiops = getService('aiops'); | ||
|
||
// aiops lives in the ML UI so we need some related services. | ||
const ml = getService('ml'); | ||
|
||
describe('change point detection in dashboard', function () { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce'); | ||
await ml.testResources.createDataViewIfNeeded('ft_ecommerce', 'order_date'); | ||
await ml.testResources.setKibanaTimeZoneToUTC(); | ||
await ml.securityUI.loginAsMlPowerUser(); | ||
}); | ||
|
||
after(async () => { | ||
await ml.testResources.deleteDataViewByTitle('ft_ecommerce'); | ||
}); | ||
|
||
it('attaches change point charts to a dashboard from the ML app', async () => { | ||
await ml.navigation.navigateToMl(); | ||
await elasticChart.setNewChartUiDebugFlag(true); | ||
await aiops.changePointDetectionPage.navigateToDataViewSelection(); | ||
await ml.jobSourceSelection.selectSourceForChangePointDetection('ft_ecommerce'); | ||
await aiops.changePointDetectionPage.assertChangePointDetectionPageExists(); | ||
|
||
await aiops.changePointDetectionPage.clickUseFullDataButton(); | ||
await aiops.changePointDetectionPage.selectMetricField(0, 'products.discount_amount'); | ||
await aiops.changePointDetectionPage.selectSplitField(0, 'geoip.city_name'); | ||
|
||
await aiops.changePointDetectionPage.assertPanelExist(0); | ||
await aiops.changePointDetectionPage.attachChartsToDashboard(0, { | ||
applyTimeRange: true, | ||
maxSeries: 1, | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters