@progress/kendo-e2e
Version:
Kendo UI end-to-end test utilities.
53 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.DropDownTree = void 0;
const selenium_1 = require("../selenium");
const const_1 = require("./const");
const dropdownlist_1 = require("./dropdownlist");
class DropDownTree extends dropdownlist_1.DropDownList {
constructor(browser, locator = DropDownTree.SELECTOR, rootElement) {
super(browser, locator, rootElement);
}
getItemByIndex(index) {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.browser.findChildren(yield this.popup(), '.k-treeview-leaf'))[index];
});
}
getItemByText(text) {
return __awaiter(this, void 0, void 0, function* () {
const locator = selenium_1.By.xpath(`.//span[contains(@class, "k-treeview-leaf") and .="${text}"]`);
return this.browser.findChild(yield this.popup(), locator);
});
}
getIconByText(text) {
return __awaiter(this, void 0, void 0, function* () {
const label = yield this.getItemByText(text);
return yield label.findElement(selenium_1.By.xpath('./..')).findElement(selenium_1.By.css('.k-icon'));
});
}
getItemCheckbox(text) {
return __awaiter(this, void 0, void 0, function* () {
const label = yield this.getItemByText(text);
return yield label.findElement(selenium_1.By.xpath('./..')).findElement(selenium_1.By.css('.k-checkbox-wrap input'));
});
}
expand() {
return __awaiter(this, void 0, void 0, function* () {
const root = yield this.root();
yield root.click();
yield this.waitToExpand();
});
}
}
exports.DropDownTree = DropDownTree;
DropDownTree.SELECTOR = const_1.SELECTORS.DROPDOWN_TREE;
//# sourceMappingURL=dropdowntree.js.map