Skip to content

Commit e412d7b

Browse files
committed
Use clearCharByChar option for input fields
1 parent a9ad526 commit e412d7b

6 files changed

Lines changed: 20 additions & 2 deletions

File tree

test/functional/services/test_subjects.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface ExistsOptions {
2929

3030
interface SetValueOptions {
3131
clearWithKeyboard?: boolean;
32+
clearCharByChar?: boolean;
3233
typeCharByChar?: boolean;
3334
}
3435

@@ -183,15 +184,19 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) {
183184
options: SetValueOptions = {}
184185
): Promise<void> {
185186
return await retry.try(async () => {
186-
const { clearWithKeyboard = false, typeCharByChar = false } = options;
187+
const {
188+
clearWithKeyboard = false,
189+
clearCharByChar = false,
190+
typeCharByChar = false,
191+
} = options;
187192
log.debug(`TestSubjects.setValue(${selector}, ${text})`);
188193
await this.click(selector);
189194
// in case the input element is actually a child of the testSubject, we
190195
// call clearValue() and type() on the element that is focused after
191196
// clicking on the testSubject
192197
const input = await find.activeElement();
193198
if (clearWithKeyboard === true) {
194-
await input.clearValueWithKeyboard();
199+
await input.clearValueWithKeyboard({ charByChar: clearCharByChar });
195200
} else {
196201
await input.clearValue();
197202
}

x-pack/test/functional/services/machine_learning/job_source_selection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function MachineLearningJobSourceSelectionProvider({ getService }: FtrPro
1818
async filterSourceSelection(sourceName: string) {
1919
await testSubjects.setValue('savedObjectFinderSearchInput', sourceName, {
2020
clearWithKeyboard: true,
21+
clearCharByChar: true,
2122
typeCharByChar: true,
2223
});
2324
await this.assertSourceListContainsEntry(sourceName);

x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function MachineLearningJobWizardAdvancedProvider({
4949
async setQueryDelay(queryDelay: string) {
5050
await testSubjects.setValue('mlJobWizardInputQueryDelay', queryDelay, {
5151
clearWithKeyboard: true,
52+
clearCharByChar: true,
5253
typeCharByChar: true,
5354
});
5455
await this.assertQueryDelayValue(queryDelay);
@@ -66,6 +67,7 @@ export function MachineLearningJobWizardAdvancedProvider({
6667
async setFrequency(frequency: string) {
6768
await testSubjects.setValue('mlJobWizardInputFrequency', frequency, {
6869
clearWithKeyboard: true,
70+
clearCharByChar: true,
6971
typeCharByChar: true,
7072
});
7173
await this.assertFrequencyValue(frequency);
@@ -83,6 +85,7 @@ export function MachineLearningJobWizardAdvancedProvider({
8385
async setScrollSize(scrollSize: string) {
8486
await testSubjects.setValue('mlJobWizardInputScrollSize', scrollSize, {
8587
clearWithKeyboard: true,
88+
clearCharByChar: true,
8689
typeCharByChar: true,
8790
});
8891
await this.assertScrollSizeValue(scrollSize);
@@ -262,6 +265,7 @@ export function MachineLearningJobWizardAdvancedProvider({
262265
async setDetectorDescription(description: string) {
263266
await testSubjects.setValue('mlAdvancedDetectorDescriptionInput', description, {
264267
clearWithKeyboard: true,
268+
clearCharByChar: true,
265269
typeCharByChar: true,
266270
});
267271
await this.assertDetectorDescriptionValue(description);

x-pack/test/functional/services/machine_learning/job_wizard_common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid
110110
async setBucketSpan(bucketSpan: string) {
111111
await testSubjects.setValue('mlJobWizardInputBucketSpan', bucketSpan, {
112112
clearWithKeyboard: true,
113+
clearCharByChar: true,
113114
typeCharByChar: true,
114115
});
115116
await this.assertBucketSpanValue(bucketSpan);
@@ -127,6 +128,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid
127128
async setJobId(jobId: string) {
128129
await testSubjects.setValue('mlJobWizardInputJobId', jobId, {
129130
clearWithKeyboard: true,
131+
clearCharByChar: true,
130132
typeCharByChar: true,
131133
});
132134
await this.assertJobIdValue(jobId);
@@ -146,6 +148,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid
146148
async setJobDescription(jobDescription: string) {
147149
await testSubjects.setValue('mlJobWizardInputJobDescription', jobDescription, {
148150
clearWithKeyboard: true,
151+
clearCharByChar: true,
149152
typeCharByChar: true,
150153
});
151154
await this.assertJobDescriptionValue(jobDescription);
@@ -291,6 +294,7 @@ export function MachineLearningJobWizardCommonProvider({ getService }: FtrProvid
291294
}
292295
await testSubjects.setValue(subj, modelMemoryLimit, {
293296
clearWithKeyboard: true,
297+
clearCharByChar: true,
294298
typeCharByChar: true,
295299
});
296300
await this.assertModelMemoryLimitValue(modelMemoryLimit, {

x-pack/test/functional/services/transform_ui/source_selection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function TransformSourceSelectionProvider({ getService }: FtrProviderCont
1717
async filterSourceSelection(sourceName: string) {
1818
await testSubjects.setValue('savedObjectFinderSearchInput', sourceName, {
1919
clearWithKeyboard: true,
20+
clearCharByChar: true,
2021
typeCharByChar: true,
2122
});
2223
await this.assertSourceListContainsEntry(sourceName);

x-pack/test/functional/services/transform_ui/wizard.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) {
302302
async setTransformId(transformId: string) {
303303
await testSubjects.setValue('transformIdInput', transformId, {
304304
clearWithKeyboard: true,
305+
clearCharByChar: true,
305306
typeCharByChar: true,
306307
});
307308
await this.assertTransformIdValue(transformId);
@@ -325,6 +326,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) {
325326
async setTransformDescription(transformDescription: string) {
326327
await testSubjects.setValue('transformDescriptionInput', transformDescription, {
327328
clearWithKeyboard: true,
329+
clearCharByChar: true,
328330
typeCharByChar: true,
329331
});
330332
await this.assertTransformDescriptionValue(transformDescription);
@@ -348,6 +350,7 @@ export function TransformWizardProvider({ getService }: FtrProviderContext) {
348350
async setDestinationIndex(destinationIndex: string) {
349351
await testSubjects.setValue('transformDestinationIndexInput', destinationIndex, {
350352
clearWithKeyboard: true,
353+
clearCharByChar: true,
351354
typeCharByChar: true,
352355
});
353356
await this.assertDestinationIndexValue(destinationIndex);

0 commit comments

Comments
 (0)