-
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.
Browse files
Browse the repository at this point in the history
* add edit analytics functional test * adds edit test service * update edit test wording for clarity * check flyout closes after edit * rename testSubj for consitency
- Loading branch information
1 parent
c804f59
commit 7aa3cb2
Showing
8 changed files
with
176 additions
and
2 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
71 changes: 71 additions & 0 deletions
71
x-pack/test/functional/services/ml/data_frame_analytics_edit.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,71 @@ | ||
/* | ||
* 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 expect from '@kbn/expect'; | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
import { MlCommon } from './common'; | ||
|
||
export function MachineLearningDataFrameAnalyticsEditProvider( | ||
{ getService }: FtrProviderContext, | ||
mlCommon: MlCommon | ||
) { | ||
const testSubjects = getService('testSubjects'); | ||
const retry = getService('retry'); | ||
|
||
return { | ||
async assertJobDescriptionEditInputExists() { | ||
await testSubjects.existOrFail('mlAnalyticsEditFlyoutDescriptionInput'); | ||
}, | ||
async assertJobDescriptionEditValue(expectedValue: string) { | ||
const actualJobDescription = await testSubjects.getAttribute( | ||
'mlAnalyticsEditFlyoutDescriptionInput', | ||
'value' | ||
); | ||
expect(actualJobDescription).to.eql( | ||
expectedValue, | ||
`Job description edit should be '${expectedValue}' (got '${actualJobDescription}')` | ||
); | ||
}, | ||
async assertJobMmlEditInputExists() { | ||
await testSubjects.existOrFail('mlAnalyticsEditFlyoutmodelMemoryLimitInput'); | ||
}, | ||
async assertJobMmlEditValue(expectedValue: string) { | ||
const actualMml = await testSubjects.getAttribute( | ||
'mlAnalyticsEditFlyoutmodelMemoryLimitInput', | ||
'value' | ||
); | ||
expect(actualMml).to.eql( | ||
expectedValue, | ||
`Job model memory limit edit should be '${expectedValue}' (got '${actualMml}')` | ||
); | ||
}, | ||
async setJobDescriptionEdit(jobDescription: string) { | ||
await mlCommon.setValueWithChecks('mlAnalyticsEditFlyoutDescriptionInput', jobDescription, { | ||
clearWithKeyboard: true, | ||
}); | ||
await this.assertJobDescriptionEditValue(jobDescription); | ||
}, | ||
|
||
async setJobMmlEdit(mml: string) { | ||
await mlCommon.setValueWithChecks('mlAnalyticsEditFlyoutmodelMemoryLimitInput', mml, { | ||
clearWithKeyboard: true, | ||
}); | ||
await this.assertJobMmlEditValue(mml); | ||
}, | ||
|
||
async assertAnalyticsEditFlyoutMissing() { | ||
await testSubjects.missingOrFail('mlAnalyticsEditFlyout'); | ||
}, | ||
|
||
async updateAnalyticsJob() { | ||
await testSubjects.existOrFail('mlAnalyticsEditFlyoutUpdateButton'); | ||
await testSubjects.click('mlAnalyticsEditFlyoutUpdateButton'); | ||
await retry.tryForTime(5000, async () => { | ||
await this.assertAnalyticsEditFlyoutMissing(); | ||
}); | ||
}, | ||
}; | ||
} |
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