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

[7.x] [ML] Functional tests - stabilize DFA dependent variable input (#74829) #74845

Merged
merged 1 commit into from
Aug 12, 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 @@ -397,7 +397,9 @@ export const ConfigurationStepForm: FC<CreateAnalyticsStepProps> = ({
}
isClearable={false}
isInvalid={dependentVariable === ''}
data-test-subj="mlAnalyticsCreateJobWizardDependentVariableSelect"
data-test-subj={`mlAnalyticsCreateJobWizardDependentVariableSelect${
loadingDepVarOptions ? ' loading' : ' loaded'
}`}
/>
</EuiFormRow>
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,33 @@ export function MachineLearningDataFrameAnalyticsCreationProvider(
await this.assertDestIndexValue(destIndex);
},

async waitForDependentVariableInputLoaded() {
await testSubjects.existOrFail('~mlAnalyticsCreateJobWizardDependentVariableSelect', {
timeout: 5 * 1000,
});
await testSubjects.existOrFail('mlAnalyticsCreateJobWizardDependentVariableSelect loaded', {
timeout: 30 * 1000,
});
},

async assertDependentVariableInputExists() {
await retry.tryForTime(8000, async () => {
await testSubjects.existOrFail(
'mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
'~mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
);
});
},

async assertDependentVariableInputMissing() {
await testSubjects.missingOrFail(
'mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
'~mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
);
},

async assertDependentVariableSelection(expectedSelection: string[]) {
await this.waitForDependentVariableInputLoaded();
const actualSelection = await comboBox.getComboBoxSelectedOptions(
'mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
'~mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput'
);
expect(actualSelection).to.eql(
expectedSelection,
Expand All @@ -253,8 +263,9 @@ export function MachineLearningDataFrameAnalyticsCreationProvider(
},

async selectDependentVariable(dependentVariable: string) {
await this.waitForDependentVariableInputLoaded();
await comboBox.set(
'mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput',
'~mlAnalyticsCreateJobWizardDependentVariableSelect > comboBoxInput',
dependentVariable
);
await this.assertDependentVariableSelection([dependentVariable]);
Expand Down