Use setValue with clearing via keyboard
This commit is contained in:
parent
804fb86fef
commit
ceaa6d9102
|
@ -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<void> {
|
||||
public async setValue(
|
||||
selector: string,
|
||||
text: string,
|
||||
options: ClearOptions = { withKeyboard: false }
|
||||
): Promise<void> {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue