UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

89 lines 3.43 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.Calendar = void 0; const ui_component_1 = require("./ui-component"); const const_1 = require("./const"); class Calendar extends ui_component_1.UIComponent { constructor(browser, locator = Calendar.SELECTOR, parentElement) { super(browser, locator, parentElement); this.parentElement = parentElement; } getTitle() { return __awaiter(this, void 0, void 0, function* () { const title = yield this.findChild('.k-calendar-title'); return yield title.getText(); }); } title() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild('.k-calendar-title'); }); } fastNavigation() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild('.k-calendar-nav-fast'); }); } focusedDate() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-focus span.k-link"); }); } selectedDate() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-selected span.k-link"); }); } selectedDates() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChildren(".k-selected span.k-link"); }); } selectedDateByIndex(index) { return __awaiter(this, void 0, void 0, function* () { return (yield this.selectedDates())[index]; }); } midRangeDates() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChildren(".k-range-mid span.k-link"); }); } midRangeDateByIndex(index) { return __awaiter(this, void 0, void 0, function* () { return (yield this.midRangeDates())[index]; }); } selectedDateText() { return __awaiter(this, void 0, void 0, function* () { return yield (yield this.selectedDate()).getText(); }); } todayDateButton() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-calendar-nav-today"); }); } nextButton() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-calendar-nav-next"); }); } previousButton() { return __awaiter(this, void 0, void 0, function* () { return yield this.findChild(".k-calendar-nav-prev"); }); } } exports.Calendar = Calendar; Calendar.SELECTOR = const_1.SELECTORS.CALENDAR; //# sourceMappingURL=calendar.js.map