From e412d7bc641e0eedeeaea28b357709e9be36ac61 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Thu, 5 Dec 2019 11:20:57 +0100 Subject: [PATCH] Use clearCharByChar option for input fields --- test/functional/services/test_subjects.ts | 9 +++++++-- .../services/machine_learning/job_source_selection.ts | 1 + .../services/machine_learning/job_wizard_advanced.ts | 4 ++++ .../services/machine_learning/job_wizard_common.ts | 4 ++++ .../functional/services/transform_ui/source_selection.ts | 1 + x-pack/test/functional/services/transform_ui/wizard.ts | 3 +++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test/functional/services/test_subjects.ts b/test/functional/services/test_subjects.ts index a3f64e6f96cc8..d31fa787351ee 100644 --- a/test/functional/services/test_subjects.ts +++ b/test/functional/services/test_subjects.ts @@ -29,6 +29,7 @@ interface ExistsOptions { interface SetValueOptions { clearWithKeyboard?: boolean; + clearCharByChar?: boolean; typeCharByChar?: boolean; } @@ -183,7 +184,11 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { options: SetValueOptions = {} ): Promise { return await retry.try(async () => { - const { clearWithKeyboard = false, typeCharByChar = false } = options; + const { + clearWithKeyboard = false, + clearCharByChar = false, + typeCharByChar = false, + } = options; log.debug(`TestSubjects.setValue(${selector}, ${text})`); await this.click(selector); // in case the input element is actually a child of the testSubject, we @@ -191,7 +196,7 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { // clicking on the testSubject const input = await find.activeElement(); if (clearWithKeyboard === true) { - await input.clearValueWithKeyboard(); + await input.clearValueWithKeyboard({ charByChar: clearCharByChar }); } else { await input.clearValue(); } diff --git a/x-pack/test/functional/services/machine_learning/job_source_selection.ts b/x-pack/test/functional/services/machine_learning/job_source_selection.ts index e11ec55728f7a..27b7d27bb1878 100644 --- a/x-pack/test/functional/services/machine_learning/job_source_selection.ts +++ b/x-pack/test/functional/services/machine_learning/job_source_selection.ts @@ -18,6 +18,7 @@ export function MachineLearningJobSourceSelectionProvider({ getService }: FtrPro async filterSourceSelection(sourceName: string) { await testSubjects.setValue('savedObjectFinderSearchInput', sourceName, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertSourceListContainsEntry(sourceName); diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts b/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts index 09d5644f35a11..e3f63fac7cbb9 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts @@ -49,6 +49,7 @@ export function MachineLearningJobWizardAdvancedProvider({ async setQueryDelay(queryDelay: string) { await testSubjects.setValue('mlJobWizardInputQueryDelay', queryDelay, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertQueryDelayValue(queryDelay); @@ -66,6 +67,7 @@ export function MachineLearningJobWizardAdvancedProvider({ async setFrequency(frequency: string) { await testSubjects.setValue('mlJobWizardInputFrequency', frequency, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertFrequencyValue(frequency); @@ -83,6 +85,7 @@ export function MachineLearningJobWizardAdvancedProvider({ async setScrollSize(scrollSize: string) { await testSubjects.setValue('mlJobWizardInputScrollSize', scrollSize, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertScrollSizeValue(scrollSize); @@ -262,6 +265,7 @@ export function MachineLearningJobWizardAdvancedProvider({ async setDetectorDescription(description: string) { await testSubjects.setValue('mlAdvancedDetectorDescriptionInput', description, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertDetectorDescriptionValue(description); 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 18cf2cc0dbee3..eb3a5e63eb3c3 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 @@ -110,6 +110,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid async setBucketSpan(bucketSpan: string) { await testSubjects.setValue('mlJobWizardInputBucketSpan', bucketSpan, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertBucketSpanValue(bucketSpan); @@ -127,6 +128,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid async setJobId(jobId: string) { await testSubjects.setValue('mlJobWizardInputJobId', jobId, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertJobIdValue(jobId); @@ -146,6 +148,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid async setJobDescription(jobDescription: string) { await testSubjects.setValue('mlJobWizardInputJobDescription', jobDescription, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertJobDescriptionValue(jobDescription); @@ -291,6 +294,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid } await testSubjects.setValue(subj, modelMemoryLimit, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertModelMemoryLimitValue(modelMemoryLimit, { diff --git a/x-pack/test/functional/services/transform_ui/source_selection.ts b/x-pack/test/functional/services/transform_ui/source_selection.ts index 59342bed5f319..4beb6b6a5c90a 100644 --- a/x-pack/test/functional/services/transform_ui/source_selection.ts +++ b/x-pack/test/functional/services/transform_ui/source_selection.ts @@ -17,6 +17,7 @@ export function TransformSourceSelectionProvider({ getService }: FtrProviderCont async filterSourceSelection(sourceName: string) { await testSubjects.setValue('savedObjectFinderSearchInput', sourceName, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertSourceListContainsEntry(sourceName); diff --git a/x-pack/test/functional/services/transform_ui/wizard.ts b/x-pack/test/functional/services/transform_ui/wizard.ts index 9f36543d888c2..ff9dd1ba0595a 100644 --- a/x-pack/test/functional/services/transform_ui/wizard.ts +++ b/x-pack/test/functional/services/transform_ui/wizard.ts @@ -302,6 +302,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) { async setTransformId(transformId: string) { await testSubjects.setValue('transformIdInput', transformId, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertTransformIdValue(transformId); @@ -325,6 +326,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) { async setTransformDescription(transformDescription: string) { await testSubjects.setValue('transformDescriptionInput', transformDescription, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertTransformDescriptionValue(transformDescription); @@ -348,6 +350,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) { async setDestinationIndex(destinationIndex: string) { await testSubjects.setValue('transformDestinationIndexInput', destinationIndex, { clearWithKeyboard: true, + clearCharByChar: true, typeCharByChar: true, }); await this.assertDestinationIndexValue(destinationIndex);