-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Memory Usage and Notifications pages serverless functional tests (…
…#205898) Part of: #201813 - [x] Memory Usage. Check ML entities are filtered according to the project type. - [x] Notifications page. Check ML entities are filtered according to the project type.
- Loading branch information
Showing
10 changed files
with
183 additions
and
0 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
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
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
37 changes: 37 additions & 0 deletions
37
x-pack/test_serverless/functional/test_suites/observability/ml/memory_usage.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,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const ml = getService('ml'); | ||
const svlMl = getService('svlMl'); | ||
const PageObjects = getPageObjects(['svlCommonPage']); | ||
|
||
const availableMLObjectTypes = ['Anomaly detection jobs', 'Trained models']; | ||
|
||
describe('Memory usage page', function () { | ||
before(async () => { | ||
await PageObjects.svlCommonPage.loginWithPrivilegedRole(); | ||
}); | ||
|
||
it('opens page with all available ML object types for Observability', async () => { | ||
await ml.navigation.navigateToMl(); | ||
await svlMl.navigation.observability.navigateToMemoryUsage(); | ||
|
||
await ml.memoryUsage.assertJobTreeComboBoxExists(); | ||
|
||
const selectedItems = await ml.memoryUsage.getSelectedChartItems(); | ||
expect(selectedItems).to.eql(availableMLObjectTypes); | ||
|
||
// Make sure there are no other available indicies | ||
const options = await ml.memoryUsage.getJobTreeComboBoxOptions(); | ||
expect(options).empty(); | ||
}); | ||
}); | ||
} |
30 changes: 30 additions & 0 deletions
30
x-pack/test_serverless/functional/test_suites/observability/ml/notifications.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,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const ml = getService('ml'); | ||
const svlMl = getService('svlMl'); | ||
const PageObjects = getPageObjects(['svlCommonPage']); | ||
|
||
const expectedObservabilityTypeFilters = ['Anomaly Detection', 'Inference', 'System']; | ||
|
||
describe('Notifications page', function () { | ||
before(async () => { | ||
await PageObjects.svlCommonPage.loginWithPrivilegedRole(); | ||
}); | ||
|
||
it('displays only notification types for observability projects', async () => { | ||
await svlMl.navigation.observability.navigateToNotifications(); | ||
const availableTypeFilters = await ml.notifications.getAvailableTypeFilters(); | ||
|
||
expect(availableTypeFilters).to.eql(expectedObservabilityTypeFilters); | ||
}); | ||
}); | ||
} |
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
41 changes: 41 additions & 0 deletions
41
x-pack/test_serverless/functional/test_suites/security/ml/memory_usage.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,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const ml = getService('ml'); | ||
const svlMl = getService('svlMl'); | ||
const PageObjects = getPageObjects(['svlCommonPage']); | ||
|
||
const availableMLObjectTypes = [ | ||
'Anomaly detection jobs', | ||
'Data frame analytics jobs', | ||
'Trained models', | ||
]; | ||
|
||
describe('Memory usage page', function () { | ||
before(async () => { | ||
await PageObjects.svlCommonPage.loginWithPrivilegedRole(); | ||
}); | ||
|
||
it('opens page with all available ML object types for Security', async () => { | ||
await ml.navigation.navigateToMl(); | ||
await svlMl.navigation.security.navigateToMemoryUsage(); | ||
|
||
await ml.memoryUsage.assertJobTreeComboBoxExists(); | ||
|
||
const selectedItems = await ml.memoryUsage.getSelectedChartItems(); | ||
expect(selectedItems).to.eql(availableMLObjectTypes); | ||
|
||
// Make sure there are no other available indicies | ||
const options = await ml.memoryUsage.getJobTreeComboBoxOptions(); | ||
expect(options).empty(); | ||
}); | ||
}); | ||
} |
35 changes: 35 additions & 0 deletions
35
x-pack/test_serverless/functional/test_suites/security/ml/notifications.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,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const ml = getService('ml'); | ||
const svlMl = getService('svlMl'); | ||
const PageObjects = getPageObjects(['svlCommonPage']); | ||
|
||
const expectedSecurityTypeFilters = [ | ||
'Anomaly Detection', | ||
'Data Frame Analytics', | ||
'Inference', | ||
'System', | ||
]; | ||
|
||
describe('Notifications page', function () { | ||
before(async () => { | ||
await PageObjects.svlCommonPage.loginWithPrivilegedRole(); | ||
}); | ||
|
||
it('displays only notification types for security projects', async () => { | ||
await svlMl.navigation.security.navigateToNotifications(); | ||
const availableTypeFilters = await ml.notifications.getAvailableTypeFilters(); | ||
|
||
expect(availableTypeFilters).to.eql(expectedSecurityTypeFilters); | ||
}); | ||
}); | ||
} |