[ML] Functional tests - stabilize DFA dependent variable input (#74829)
This PR stabilizes the dependent variable input during tests by explicitly waiting for the options to load.
This commit is contained in:
parent
21b9b36c94
commit
178afd71fc
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue