UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

62 lines 3.26 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.ColumnMenu = void 0; const selenium_1 = require("../selenium"); const ui_component_1 = require("./ui-component"); const filtermenu_1 = require("./filtermenu"); class ColumnMenu extends ui_component_1.UIComponent { constructor(browser, locator, parentElement) { super(browser, locator, parentElement); this.parentElement = parentElement; } sortAsc() { return __awaiter(this, void 0, void 0, function* () { const ascMenu = yield this.findChild(".k-sort-asc"); yield this.browser.waitForAnimationAndClick(ascMenu); yield this.browser.wait(selenium_1.EC.notVisible(ascMenu), { timeout: 3000, message: 'Failed to close popup on sort asc.' }); }); } sortDesc() { return __awaiter(this, void 0, void 0, function* () { const descMenu = yield this.findChild(".k-sort-desc"); yield this.browser.waitForAnimationAndClick(descMenu); yield this.browser.wait(selenium_1.EC.notVisible(descMenu), { timeout: 3000, message: 'Failed to close popup on sort asc.' }); }); } openShowHideColumnsMenu() { return __awaiter(this, void 0, void 0, function* () { const columnsMenu = yield this.browser.findChild(yield this.root(), ".k-columns-item"); yield this.browser.waitForAnimation(columnsMenu); yield this.browser.hover(columnsMenu); const popup = yield this.browser.findChild(columnsMenu, ".k-animation-container"); yield this.browser.waitForAnimation(popup); }); } selectShowHideMenuItem(title) { return __awaiter(this, void 0, void 0, function* () { const columnsItem = yield this.browser.findChild(yield this.root(), `input[title="${title}"]`); yield this.browser.waitForAnimationAndClick(columnsItem); }); } openFilterMenu() { return __awaiter(this, void 0, void 0, function* () { const filterMenu = yield this.browser.findChild(yield this.root(), ".k-filter-item"); yield this.browser.waitForAnimation(filterMenu); yield this.browser.hover(filterMenu); const popup = yield this.browser.findChild(filterMenu, ".k-animation-container"); yield this.browser.waitForAnimation(popup); return new filtermenu_1.FilterMenu(this.browser, '.k-filter-menu', popup); }); } } exports.ColumnMenu = ColumnMenu; //# sourceMappingURL=columnmenu.js.map