Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Functional tests - stabilize typing during df analytics creation #58227

Merged
merged 2 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../ftr_provider_context';
import { MlCommon } from './common';

export function MachineLearningDataFrameAnalyticsCreationProvider({
getService,
}: FtrProviderContext) {
export function MachineLearningDataFrameAnalyticsCreationProvider(
{ getService }: FtrProviderContext,
mlCommon: MlCommon
) {
const testSubjects = getService('testSubjects');
const comboBox = getService('comboBox');
const retry = getService('retry');
Expand Down Expand Up @@ -85,14 +87,14 @@ export function MachineLearningDataFrameAnalyticsCreationProvider({
},

async setJobId(jobId: string) {
await testSubjects.setValue('mlAnalyticsCreateJobFlyoutJobIdInput', jobId, {
await mlCommon.setValueWithChecks('mlAnalyticsCreateJobFlyoutJobIdInput', jobId, {
clearWithKeyboard: true,
});
await this.assertJobIdValue(jobId);
},

async setJobDescription(jobDescription: string) {
await testSubjects.setValue('mlDFAnalyticsJobCreationJobDescription', jobDescription, {
await mlCommon.setValueWithChecks('mlDFAnalyticsJobCreationJobDescription', jobDescription, {
clearWithKeyboard: true,
});
await this.assertJobDescriptionValue(jobDescription);
Expand Down Expand Up @@ -136,9 +138,13 @@ export function MachineLearningDataFrameAnalyticsCreationProvider({
},

async setDestIndex(destIndex: string) {
await testSubjects.setValue('mlAnalyticsCreateJobFlyoutDestinationIndexInput', destIndex, {
clearWithKeyboard: true,
});
await mlCommon.setValueWithChecks(
'mlAnalyticsCreateJobFlyoutDestinationIndexInput',
destIndex,
{
clearWithKeyboard: true,
}
);
await this.assertDestIndexValue(destIndex);
},

Expand Down Expand Up @@ -248,7 +254,7 @@ export function MachineLearningDataFrameAnalyticsCreationProvider({
},

async setModelMemory(modelMemory: string) {
await testSubjects.setValue('mlAnalyticsCreateJobFlyoutModelMemoryInput', modelMemory, {
await mlCommon.setValueWithChecks('mlAnalyticsCreateJobFlyoutModelMemoryInput', modelMemory, {
clearWithKeyboard: true,
});
await this.assertModelMemoryValue(modelMemory);
Expand Down
5 changes: 4 additions & 1 deletion x-pack/test/functional/services/ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export function MachineLearningProvider(context: FtrProviderContext) {
const api = MachineLearningAPIProvider(context);
const customUrls = MachineLearningCustomUrlsProvider(context);
const dataFrameAnalytics = MachineLearningDataFrameAnalyticsProvider(context, api);
const dataFrameAnalyticsCreation = MachineLearningDataFrameAnalyticsCreationProvider(context);
const dataFrameAnalyticsCreation = MachineLearningDataFrameAnalyticsCreationProvider(
context,
common
);
const dataFrameAnalyticsTable = MachineLearningDataFrameAnalyticsTableProvider(context);
const dataVisualizer = MachineLearningDataVisualizerProvider(context);
const dataVisualizerIndexBased = MachineLearningDataVisualizerIndexBasedProvider(context);
Expand Down