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] Add AD job validation UI tests #179358

Merged
merged 83 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4f9a588
[ML] Add AD job validation UI tests
wayneseymour Mar 25, 2024
215d757
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Mar 27, 2024
49c3901
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Mar 27, 2024
057da93
Truncate test subj for validation callout, from msg contents.
wayneseymour Mar 27, 2024
2667c93
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Mar 27, 2024
d5bc5a5
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 1, 2024
433aad8
Graft it block to existing suite, per cr.
wayneseymour Apr 2, 2024
21c1f50
Graft next it block to exisiting suite, per cr.
wayneseymour Apr 2, 2024
f1bb227
Graft next it block to existing suite.
wayneseymour Apr 2, 2024
30a59c6
Drop new suite.
wayneseymour Apr 2, 2024
affd426
Update x-pack/test/functional/services/ml/job_wizard_common.ts
wayneseymour Apr 2, 2024
9dc3b15
Merge branch 'ml-add-job-validation-ui-tests' of github.com:wayneseym…
wayneseymour Apr 2, 2024
f5cd43b
Change symbol name, per cr.
wayneseymour Apr 2, 2024
6602b29
More cr fixups
wayneseymour Apr 2, 2024
ef73e43
Update x-pack/plugins/ml/public/application/components/callout/callou…
wayneseymour Apr 2, 2024
e1e75d1
Merge branch 'ml-add-job-validation-ui-tests' of github.com:wayneseym…
wayneseymour Apr 2, 2024
bdd577b
Change for test subjs, per cr.
wayneseymour Apr 3, 2024
57ed9df
Fixup assertions, per cr.
wayneseymour Apr 3, 2024
b33540c
assert test subj and text
wayneseymour Apr 3, 2024
b1385ce
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 3, 2024
5a8d112
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 4, 2024
4e73965
Update x-pack/plugins/ml/public/application/jobs/new_job/pages/new_jo…
wayneseymour Apr 5, 2024
d0eab64
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 11, 2024
28b0228
Merge branch 'ml-add-job-validation-ui-tests' of github.com:wayneseym…
wayneseymour Apr 11, 2024
a859e3d
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 11, 2024
0fca96c
fixup test subjects && make tsc happy with adding a test subj to the …
wayneseymour Apr 11, 2024
3664a94
Use optional chaining to make tsc happy.
wayneseymour Apr 11, 2024
347173a
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 12, 2024
01be0f4
switch to regex as some of the numbers vary
wayneseymour Apr 12, 2024
2c17a27
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 12, 2024
d57bc59
Use an inline level element instead and
wayneseymour Apr 12, 2024
0973dce
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 15, 2024
9ea07a3
switch to method
wayneseymour Apr 15, 2024
db7ff28
Fixup test subj
wayneseymour Apr 15, 2024
e3d5652
update test subj
wayneseymour Apr 15, 2024
1bfe1b3
change name
wayneseymour Apr 15, 2024
4fcc3b9
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 16, 2024
2204171
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 17, 2024
1f9611a
Use popper props per Lene G.
wayneseymour Apr 17, 2024
6c22755
cleanup
wayneseymour Apr 17, 2024
2af4109
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 18, 2024
1937d40
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 18, 2024
97995c1
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 22, 2024
18d214c
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 22, 2024
3d2720a
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 24, 2024
c30644a
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine Apr 26, 2024
bee8109
Merge branch 'ml-add-job-validation-ui-tests' of github.com:wayneseym…
wayneseymour Apr 29, 2024
aabfc04
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 29, 2024
894de3d
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 29, 2024
43d2b26
drop togglingModelChangeAnnotationsShowsCalloutAndRemovesCallout meth…
wayneseymour Apr 29, 2024
9ac5448
drop cloneJob method per cr
wayneseymour Apr 29, 2024
e0ad466
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour Apr 30, 2024
7ec5b38
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour May 6, 2024
82afd94
Drop ts ignore.
wayneseymour May 6, 2024
969bf50
drop unused method
wayneseymour May 6, 2024
dfa29d5
drop assertShortDurationTimeRange
wayneseymour May 6, 2024
bf81eee
Merge branch 'main' of github.com:elastic/kibana into ml-add-job-vali…
wayneseymour May 7, 2024
c5237ca
wrap in retry
wayneseymour May 7, 2024
66488da
Update x-pack/test/functional/services/ml/job_wizard_common.ts
wayneseymour May 8, 2024
a7a75e3
Update x-pack/test/functional/services/ml/job_wizard_common.ts
wayneseymour May 8, 2024
ea3e6dc
final fixups?
wayneseymour May 8, 2024
38a829b
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 9, 2024
ac47e74
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 10, 2024
ecbd487
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 13, 2024
268e403
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 15, 2024
60cb125
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 16, 2024
b8c45d7
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 22, 2024
ab3b025
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 23, 2024
afa90d7
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 24, 2024
e53e9d9
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
a1fe7e4
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
0f62a46
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
d8edc00
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
9d7a2a2
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
a0e5557
Update x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_m…
wayneseymour May 24, 2024
4be34ab
Update x-pack/test/functional/services/ml/job_wizard_common.ts
wayneseymour May 24, 2024
820e96c
Update x-pack/test/functional/services/ml/job_wizard_common.ts
wayneseymour May 24, 2024
0355263
Update x-pack/test/functional/services/ml/common_ui.ts
wayneseymour May 24, 2024
dd28646
fixups per cr
wayneseymour May 24, 2024
1ee9dee
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 24, 2024
d4bea26
add assertion per cr
wayneseymour May 24, 2024
528d151
Merge branch 'ml-add-job-validation-ui-tests' of github.com:wayneseym…
wayneseymour May 24, 2024
31f5136
Merge branch 'main' into ml-add-job-validation-ui-tests
kibanamachine May 27, 2024
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 @@ -55,7 +55,7 @@ const Message: FC<Pick<CalloutMessage, 'text' | 'url'>> = ({ text, url }) => (
export const Callout: FC<CalloutMessage> = ({ heading, status, text, url }) => (
<>
<EuiCallOut
data-test-subj={'mlValidationCallout'}
data-test-subj={`mlValidationCallout-${statusToEuiColor(status)}-${text.substring(0, 30)}`}
wayneseymour marked this conversation as resolved.
Show resolved Hide resolved
// @ts-ignore
color={statusToEuiColor(status)}
size="s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,23 @@ export const TimeRangePicker: FC<Props> = ({ setTimeRange, timeRange }) => {
/>
}
endDateControl={
<EuiDatePicker
selected={endMoment}
onChange={handleChangeEnd}
startDate={startMoment}
endDate={endMoment}
aria-label={i18n.translate(
'xpack.ml.newJob.wizard.timeRangeStep.timeRangePicker.endDateLabel',
{
defaultMessage: 'End date',
}
)}
showTimeSelect
dateFormat={dateFormat}
minDate={startMoment}
/>
<div data-test-subj="mlJobWizardDatePickerRangeEndDate">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://eui.elastic.co/#/forms/date-picker supports data-test-subj, hence you do not need a wrapper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it, following the docs per our zoom, but it did not work. I'll try again though!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-04-04 at 10 38 42
@darnautov perhaps a longer timeout?

Copy link
Contributor

@darnautov darnautov Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI adding a div wrapper also braked styles.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wayneseymour you set a data-test-subj prop in the wrong place. It should be for EuiDatePickerRange, not endDateControl

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, so many dates lol. Thanks @darnautov 🙉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I dont think either of those work, so I've switched it to a span

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no more span!
1f9611a

<EuiDatePicker
selected={endMoment}
onChange={handleChangeEnd}
startDate={startMoment}
endDate={endMoment}
aria-label={i18n.translate(
'xpack.ml.newJob.wizard.timeRangeStep.timeRangePicker.endDateLabel',
{
defaultMessage: 'End date',
}
)}
showTimeSelect
dateFormat={dateFormat}
minDate={startMoment}
/>
</div>
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const AnnotationsSwitch: FC = () => {
</Description>
{showCallOut && (
<EuiCallOut
data-test-subj="mlJobWizardAlsoEnableAnnotationsRecommendationCallout"
title={
<FormattedMessage
id="xpack.ml.newJob.wizard.jobDetailsStep.advancedSection.annotationsSwitchCallout.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export const WizardHorizontalSteps: FC<Props> = ({
}

function createStepProps(step: WIZARD_STEPS) {
let testSubj: string = '';
if (step === WIZARD_STEPS.TIME_RANGE) testSubj = 'mlJobWizardTimeRangeStep';
if (step === WIZARD_STEPS.JOB_DETAILS) testSubj = 'mlJobWizardJobDetailsStep';

wayneseymour marked this conversation as resolved.
Show resolved Hide resolved
return {
onClick: () => jumpToStep(step),
status: (currentStep === step
Expand All @@ -87,6 +91,7 @@ export const WizardHorizontalSteps: FC<Props> = ({
? 'complete'
: 'incomplete') as EuiStepStatus,
disabled: disableSteps || highestStep < step,
'data-test-subj': testSubj,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./single_metric_job'));

if (!isCcs) {
loadTestFile(require.resolve('./job_wizard_validation'));
loadTestFile(require.resolve('./single_metric_job_without_datafeed_start'));
loadTestFile(require.resolve('./multi_metric_job'));
loadTestFile(require.resolve('./population_job'));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*
* 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 type { FtrProviderContext } from '../../../ftr_provider_context';
import type { FieldStatsType } from '../common/types';

export default function ({ getService }: FtrProviderContext) {
const config = getService('config');
const esNode = config.get('esTestCluster.ccs')
? getService('remoteEsArchiver' as 'esArchiver')
: getService('esArchiver');
const ml = getService('ml');

const jobId = `fq_single_1_${Date.now()}`;
const jobGroups = ['automated', 'farequote', 'single-metric'];
const aggAndFieldIdentifier = 'Mean(responsetime)';
const bucketSpan = '30m';

const remoteName = 'ftr-remote:';
const esIndexPatternName = 'ft_farequote';
const esIndexPatternString = config.get('esTestCluster.ccs')
? remoteName + esIndexPatternName
: esIndexPatternName;

const fieldStatsEntries = [
{
fieldName: '@version.keyword',
type: 'keyword' as FieldStatsType,
expectedValues: ['1'],
},
];

describe('job wizard validation', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon you should not create a dedicated test suite for that, and go through all the wizard steps again.
We already have multiple tests for job wizards. Simply add a test suite to assert job validation.

For instance in the multi-metric wizards tests:

      await ml.testExecution.logTestStep('job creation displays the validation step');
      await ml.jobWizardCommon.advanceToValidationSection();

Add your assertion after these lines

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darnautov One of the reasons I created this is not have a nested suite.
I'll see if I can fit these in elsewhere without a nested suite.

this.tags(['ml']);
before(async () => {
await esNode.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createDataViewIfNeeded(esIndexPatternString, '@timestamp');
await ml.testResources.setKibanaTimeZoneToUTC();

await ml.securityUI.loginAsMlPowerUser();

await ml.testExecution.logTestStep('job creation loads the job management page');
await ml.navigation.navigateToMl();
await ml.navigation.navigateToJobManagement();

await ml.testExecution.logTestStep('job creation loads the new job source selection page');
await ml.jobManagement.navigateToNewJobSourceSelection();

await ml.testExecution.logTestStep('job creation loads the job type selection page');
await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob(esIndexPatternString);

await ml.testExecution.logTestStep('job creation loads the single metric job wizard page');
await ml.jobTypeSelection.selectSingleMetricJob();
await ml.testExecution.logTestStep('job creation displays the time range step');
await ml.jobWizardCommon.assertTimeRangeSectionExists();

await ml.testExecution.logTestStep('job creation sets the time range');
await ml.jobWizardCommon.clickUseFullDataButton(
'Feb 7, 2016 @ 00:00:00.000',
'Feb 11, 2016 @ 23:59:54.000'
);

await ml.testExecution.logTestStep('job creation displays the event rate chart');
await ml.jobWizardCommon.assertEventRateChartExists();
await ml.jobWizardCommon.assertEventRateChartHasData();

await ml.testExecution.logTestStep('job creation displays the pick fields step');
await ml.jobWizardCommon.advanceToPickFieldsSection();

await ml.testExecution.logTestStep('job creation opens field stats flyout from agg input');
await ml.jobWizardCommon.assertAggAndFieldInputExists();
for (const { fieldName, type: fieldType, expectedValues } of fieldStatsEntries) {
await ml.jobWizardCommon.assertFieldStatFlyoutContentFromAggSelectionInputTrigger(
fieldName,
fieldType,
expectedValues
);
}

await ml.testExecution.logTestStep('job creation selects field and aggregation');
await ml.jobWizardCommon.selectAggAndField(aggAndFieldIdentifier, true);
await ml.jobWizardCommon.assertAnomalyChartExists('LINE');

await ml.testExecution.logTestStep('job creation inputs the bucket span');
await ml.jobWizardCommon.assertBucketSpanInputExists();
await ml.jobWizardCommon.setBucketSpan(bucketSpan);

await ml.testExecution.logTestStep('job creation displays the job details step');
await ml.jobWizardCommon.advanceToJobDetailsSection();

await ml.testExecution.logTestStep('job creation inputs the job id');
await ml.jobWizardCommon.assertJobIdInputExists();
await ml.jobWizardCommon.setJobId(jobId);

await ml.testExecution.logTestStep('job creation inputs job groups');
await ml.jobWizardCommon.assertJobGroupInputExists();
for (const jobGroup of jobGroups) {
await ml.jobWizardCommon.addJobGroup(jobGroup);
}
await ml.jobWizardCommon.assertJobGroupSelection(jobGroups);

await ml.testExecution.logTestStep('job creation opens the additional settings section');
await ml.jobWizardCommon.ensureAdditionalSettingsSectionOpen();

await ml.testExecution.logTestStep('job creation opens the advanced section');
await ml.jobWizardCommon.ensureAdvancedSectionOpen();

await ml.testExecution.logTestStep('job creation displays the model plot switch');
await ml.jobWizardCommon.assertModelPlotSwitchExists();

await ml.testExecution.logTestStep('job creation enables the dedicated index switch');
await ml.jobWizardCommon.assertDedicatedIndexSwitchExists();
await ml.jobWizardCommon.activateDedicatedIndexSwitch();

await ml.testExecution.logTestStep('job creation inputs the model memory limit');
await ml.jobWizardCommon.assertModelMemoryLimitInputExists();
});

after(async () => {
await ml.api.cleanMlIndices();
await ml.testResources.deleteDataViewByTitle(esIndexPatternString);
});

it('job creation and toggling model change annotation triggers enable annotation recommendation callout', async () => {
await ml.jobWizardCommon.togglingModelChangeAnnotationsShowsCalloutAndRemovesCallout();
});

it('too short of a job creation time range results in validation callouts', async () => {
await ml.jobWizardCommon.goBackToTimeRange();

const tooShort = 'Feb 7, 2016 @ 00:01:00.000';
await ml.jobWizardCommon.setEndDate(tooShort);

await ml.testExecution.logTestStep('job creation displays the validation step');
await ml.jobWizardCommon.goBackToJobDetailsSection();
await ml.jobWizardCommon.advanceToValidationSection();
await ml.jobWizardCommon.assertValidationCallouts([
'mlValidationCallout-warning-The selected or available time',
'mlValidationCallout-danger-The datafeed preview failed. T',
'mlValidationCallout-warning-Job validation has failed, but',
]);

await ml.jobWizardCommon.goBackToTimeRange();
await ml.jobWizardCommon.clickUseFullDataButton(
'Feb 7, 2016 @ 00:00:00.000',
'Feb 11, 2016 @ 23:59:54.000'
);
await ml.jobWizardCommon.advanceToValidationSection();
await ml.jobWizardCommon.assertValidationCallouts([
'mlValidationCallout-success-Valid and long enough to model',
'mlValidationCallout-success-Valid and within the estimated',
]);
});

it('job creation memory limit too large results in validation callout', async () => {
await ml.jobWizardCommon.goBackToJobDetailsSection();

const tooLarge = '100000000MB';
await ml.jobWizardCommon.setModelMemoryLimit(tooLarge);

await ml.jobWizardCommon.clickNextButton();
await ml.jobWizardCommon.assertValidationCallouts([
'mlValidationCallout-warning-Job will not be able to run in',
]);
});
});
}
62 changes: 62 additions & 0 deletions x-pack/test/functional/services/ml/job_wizard_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,5 +619,67 @@ export function MachineLearningJobWizardCommonProvider(
await testSubjects.existOrFail(expectedSelector);
});
},

async getAnnotationSwitchCheckedState(): Promise<boolean> {
const subj = 'mlJobWizardSwitchAnnotations';
const isSelected = await testSubjects.getAttribute(subj, 'aria-checked');
return isSelected === 'true';
},

async getAnnotationsSwitchCheckedState(expectedValue: boolean) {
const actualCheckedState = await this.getAnnotationSwitchCheckedState();
expect(actualCheckedState).to.eql(
expectedValue,
`Expected annotations switch to be '${expectedValue ? 'enabled' : 'disabled'}' (got '${
actualCheckedState ? 'enabled' : 'disabled'
}')`
);
},

async toggleAnnotationSwitch(toggle: boolean) {
const subj = 'mlJobWizardSwitchAnnotations';
if ((await this.getAnnotationSwitchCheckedState()) !== toggle) {
await retry.tryForTime(5 * 1000, async () => {
await testSubjects.clickWhenNotDisabledWithoutRetry(subj);
await this.getAnnotationSwitchCheckedState();
});
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a similar code snippet copy-pasted in so many places. Can you please create reusable methods in x-pack/test/functional/services/ml/common_ui.ts?

  • getSwitchChechedState(testSubj: string)
  • toggleSwitchIfNeeded(testSubj: string, targetState: boolean)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


async togglingModelChangeAnnotationsShowsCalloutAndRemovesCallout() {
await this.toggleAnnotationSwitch(false);
await testSubjects.existOrFail('mlJobWizardAlsoEnableAnnotationsRecommendationCallout', {
timeout: 3_000,
});
await this.toggleAnnotationSwitch(true);
await testSubjects.missingOrFail('mlJobWizardAlsoEnableAnnotationsRecommendationCallout', {
timeout: 3_000,
});
},

async goBackToTimeRange() {
wayneseymour marked this conversation as resolved.
Show resolved Hide resolved
await testSubjects.existOrFail('mlJobWizardTimeRangeStep', {
timeout: 3_000,
});
await testSubjects.click('mlJobWizardTimeRangeStep');
darnautov marked this conversation as resolved.
Show resolved Hide resolved
},

async setEndDate(input: string) {
await testSubjects.setValue('mlJobWizardDatePickerRangeEndDate', input);
darnautov marked this conversation as resolved.
Show resolved Hide resolved
},

async goBackToJobDetailsSection() {
await testSubjects.existOrFail('mlJobWizardJobDetailsStep', {
timeout: 3_000,
});
await testSubjects.click('mlJobWizardJobDetailsStep');
darnautov marked this conversation as resolved.
Show resolved Hide resolved
},

async assertValidationCallouts(expectedCallOutSelectors: string[]) {
darnautov marked this conversation as resolved.
Show resolved Hide resolved
for await (const sel of expectedCallOutSelectors)
await testSubjects.existOrFail(sel, {
timeout: 3_000,
});
},
};
}