UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

65 lines 2.83 kB
"use strict"; 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.Captcha = void 0; const ui_component_1 = require("./ui-component"); const selenium_1 = require("../selenium"); class Captcha extends ui_component_1.UIComponent { constructor(browser, locator = Captcha.SELECTOR, parentElement) { super(browser, locator, parentElement); this.parentElement = parentElement; } input() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-input"); }); } setValue(value) { return __awaiter(this, void 0, void 0, function* () { yield (yield this.input()).click(); yield this.browser.sendKey(selenium_1.Key.HOME); yield this.browser.sendKey(value); yield this.browser.sendKey(selenium_1.Key.TAB); }); } successMessage() { return __awaiter(this, void 0, void 0, function* () { const parent = yield (yield this.root()).findElement(selenium_1.By.xpath('./..')); return yield this.browser.findChild(parent, ".k-captcha-validation-message.k-text-success"); }); } errorMessage() { return __awaiter(this, void 0, void 0, function* () { const parent = yield (yield this.root()).findElement(selenium_1.By.xpath('./..')); return yield this.browser.findChild(parent, ".k-form-error.k-invalid-msg"); }); } refresh() { return __awaiter(this, void 0, void 0, function* () { const refreshButton = yield this.findChild('[title="Reset captcha"]'); yield refreshButton.click(); }); } speak() { return __awaiter(this, void 0, void 0, function* () { const speakButton = yield this.findChild('[title="Speak captcha"]'); yield speakButton.click(); }); } slider() { return __awaiter(this, void 0, void 0, function* () { return this.findChild(".k-slider-selection"); }); } } exports.Captcha = Captcha; Captcha.SELECTOR = '.k-captcha'; //# sourceMappingURL=captcha.js.map