@progress/kendo-e2e
Version:
Kendo UI end-to-end test utilities.
134 lines • 5.85 kB
JavaScript
"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.ImageEditor = void 0;
const dropdownlist_1 = require("./dropdownlist");
const numerictextbox_1 = require("./numerictextbox");
const ui_component_1 = require("./ui-component");
class ImageEditor extends ui_component_1.UIComponent {
constructor(browser, locator = ImageEditor.SELECTOR, parentElement) {
super(browser, locator, parentElement);
this.parentElement = parentElement;
}
canvas() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-content canvas');
});
}
uploadButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Open Image"]');
});
}
downloadButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Save Image"]');
});
}
actionPane() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane');
});
}
ratioDropDown() {
return __awaiter(this, void 0, void 0, function* () {
const locator = '.k-dropdownlist[aria-controls="aspectRatio_listbox"]';
return new dropdownlist_1.DropDownList(this.browser, locator, yield this.root());
});
}
undoButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Undo"]');
});
}
redoButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Redo"]');
});
}
cropButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Crop"]');
});
}
resizeButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Resize"]');
});
}
zoomInButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Zoom In"]');
});
}
zoomOutButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-toolbar button[title="Zoom Out"]');
});
}
zoomOptionsDropDown() {
return __awaiter(this, void 0, void 0, function* () {
return new dropdownlist_1.DropDownList(this.browser, ".k-toolbar-item .k-dropdownlist", yield this.root());
});
}
actionPanePortraitButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane .k-button-group .k-button:nth-of-type(1)');
});
}
actionPaneLandscapeButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane .k-button-group .k-button:nth-of-type(2)');
});
}
widthNumeric() {
return __awaiter(this, void 0, void 0, function* () {
const locator = 'div[data-container-for="width"] .k-numerictextbox';
return new numerictextbox_1.NumericTextBox(this.browser, locator, yield this.root());
});
}
heightNumeric() {
return __awaiter(this, void 0, void 0, function* () {
const locator = 'div[data-container-for="height"] .k-numerictextbox';
return new numerictextbox_1.NumericTextBox(this.browser, locator, yield this.root());
});
}
measureWidthDopDown() {
return __awaiter(this, void 0, void 0, function* () {
const locator = 'div[data-container-for="measureW"] .k-dropdownlist';
return new dropdownlist_1.DropDownList(this.browser, locator, yield this.root());
});
}
measureHeightDopDown() {
return __awaiter(this, void 0, void 0, function* () {
const locator = 'div[data-container-for="measureH"] .k-dropdownlist';
return new dropdownlist_1.DropDownList(this.browser, locator, yield this.root());
});
}
lockAspectRatio() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane input[id="lockAspectRatio"]');
});
}
cancelButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane button[data-action="cancel"]');
});
}
confirmButton() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.findChild('.k-imageeditor-action-pane button[data-action="confirm"]');
});
}
}
exports.ImageEditor = ImageEditor;
ImageEditor.SELECTOR = '.k-imageeditor';
//# sourceMappingURL=imagedditor.js.map