@progress/kendo-e2e
Version:
Kendo UI end-to-end test utilities.
67 lines • 3.13 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.Chat = void 0;
const const_1 = require("./const");
const ui_component_1 = require("./ui-component");
class Chat extends ui_component_1.UIComponent {
constructor(browser, locator = Chat.SELECTOR, parentElement) {
super(browser, locator, parentElement);
this.parentElement = parentElement;
}
sendButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild(".k-chat-send");
});
}
messageInput() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild(".k-input input");
});
}
lastMessage() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild("div.k-last > .k-chat-bubble");
});
}
message(index) {
return __awaiter(this, void 0, void 0, function* () {
const locator = ".k-message > .k-chat-bubble";
yield this.browser.wait(() => __awaiter(this, void 0, void 0, function* () { return (yield this.findChildren(locator)).length > index; }), {
timeout: 10000,
message: `Failed to find message with index ${index}.`,
});
return (yield this.findChildren(locator))[index];
});
}
quickReply(index) {
return __awaiter(this, void 0, void 0, function* () {
const locator = ".k-quick-reply";
yield this.browser.wait(() => __awaiter(this, void 0, void 0, function* () { return (yield this.findChildren(locator)).length > index; }), {
timeout: 10000,
message: `Failed to find quick message with index ${index}.`,
});
return (yield this.findChildren(locator))[index];
});
}
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.messageInput());
yield _super.setMaliciousInputs.call(this, inputElement, maliciousInputArray, expectationsArray);
});
}
}
exports.Chat = Chat;
Chat.SELECTOR = const_1.SELECTORS.CHAT;
//# sourceMappingURL=chat.js.map
;