optionally type char by char (#72666)

This commit is contained in:
Dmitry Lemeshko 2020-07-21 19:17:49 +02:00 committed by GitHub
parent 01c686cb8d
commit e8fa2dc9c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -321,7 +321,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
log.debug(`setIndexPatternField(${indexPatternName})`);
const field = await this.getIndexPatternField();
await field.clearValue();
await field.type(indexPatternName);
await field.type(indexPatternName, { charByChar: true });
const currentName = await field.getAttribute('value');
log.debug(`setIndexPatternField set to ${currentName}`);
expect(currentName).to.eql(`${indexPatternName}${expectWildcard ? '*' : ''}`);

View file

@ -112,8 +112,15 @@ export class LeadfootElementWrapper {
* @param {string|string[]} value
* @return {Promise<void>}
*/
async type(value) {
await this._leadfootElement.type(value);
async type(value, options = { charByChar: false }) {
if (options.charByChar) {
for (const char of value) {
await this._leadfootElement.type(char);
await delay(100);
}
} else {
await this._leadfootElement.type(value);
}
}
/**