@progress/kendo-e2e
Version:
Kendo UI end-to-end test utilities.
57 lines • 2.52 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Input = void 0;
const ui_component_1 = require("./ui-component");
const const_1 = require("./const");
class Input extends ui_component_1.UIComponent {
constructor(browser, locator = Input.SELECTOR, parentElement) {
super(browser, locator, parentElement);
this.parentElement = parentElement;
}
input() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-input-inner:not([style~="none;"])');
});
}
getValue() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.input()).getAttribute('value');
});
}
getPlaceholder() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.input()).getAttribute('placeholder');
});
}
setValue(value_1) {
return __awaiter(this, arguments, void 0, function* (value, { clear = true } = {}) {
yield this.browser.type(yield this.input(), value, { clear: clear });
});
}
clearValue() {
return __awaiter(this, void 0, void 0, function* () {
yield this.setValue('');
});
}
setMaliciousInputs(myInputElement, maliciousInputArray, expectationsArray) {
const _super = Object.create(null, {
setMaliciousInputs: { get: () => super.setMaliciousInputs }
});
return __awaiter(this, void 0, void 0, function* () {
const inputElement = myInputElement || (yield this.input());
yield _super.setMaliciousInputs.call(this, inputElement, maliciousInputArray, expectationsArray);
});
}
}
exports.Input = Input;
Input.SELECTOR = const_1.SELECTORS.INPUT;
//# sourceMappingURL=input.js.map
;