diff --git a/test/functional/services/test_subjects.ts b/test/functional/services/test_subjects.ts index c5e360d09395..b0c4e8732c26 100644 --- a/test/functional/services/test_subjects.ts +++ b/test/functional/services/test_subjects.ts @@ -27,6 +27,10 @@ interface ExistsOptions { allowHidden?: boolean; } +interface ClearOptions { + withKeyboard: boolean; +} + export function TestSubjectsProvider({ getService }: FtrProviderContext) { const log = getService('log'); const retry = getService('retry'); @@ -151,7 +155,11 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { }); } - public async setValue(selector: string, text: string): Promise { + public async setValue( + selector: string, + text: string, + options: ClearOptions = { withKeyboard: false } + ): Promise { return await retry.try(async () => { log.debug(`TestSubjects.setValue(${selector}, ${text})`); await this.click(selector); @@ -159,7 +167,11 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { // call clearValue() and type() on the element that is focused after // clicking on the testSubject const input = await find.activeElement(); - await input.clearValue(); + if (options.withKeyboard === true) { + await input.clearValueWithKeyboard(); + } else { + await input.clearValue(); + } await input.type(text); }); } diff --git a/x-pack/test/functional/apps/machine_learning/index.ts b/x-pack/test/functional/apps/machine_learning/index.ts index fbd7de66d552..5ddbfe59fb64 100644 --- a/x-pack/test/functional/apps/machine_learning/index.ts +++ b/x-pack/test/functional/apps/machine_learning/index.ts @@ -6,8 +6,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { - // FLAKY: https://github.com/elastic/kibana/issues/46674 - describe.skip('machine learning', function() { + describe('machine learning', function() { this.tags('ciGroup3'); loadTestFile(require.resolve('./feature_controls')); diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts index d6e09e8c818f..19a270cdab5f 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_common.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_common.ts @@ -181,15 +181,17 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid }, async setBucketSpan(bucketSpan: string) { - await testSubjects.setValue('mlJobWizardInputBucketSpan', bucketSpan); + await testSubjects.setValue('mlJobWizardInputBucketSpan', bucketSpan, { withKeyboard: true }); }, async setJobId(jobId: string) { - await testSubjects.setValue('mlJobWizardInputJobId', jobId); + await testSubjects.setValue('mlJobWizardInputJobId', jobId, { withKeyboard: true }); }, async setJobDescription(jobDescription: string) { - await testSubjects.setValue('mlJobWizardInputJobDescription', jobDescription); + await testSubjects.setValue('mlJobWizardInputJobDescription', jobDescription, { + withKeyboard: true, + }); }, async addJobGroup(jobGroup: string) { @@ -216,7 +218,9 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid }, async setModelMemoryLimit(modelMemoryLimit: string) { - await testSubjects.setValue('mlJobWizardInputModelMemoryLimit', modelMemoryLimit); + await testSubjects.setValue('mlJobWizardInputModelMemoryLimit', modelMemoryLimit, { + withKeyboard: true, + }); }, async createJobAndWaitForCompletion() {