systelab-components-test
Version:
Widgets to be use in the E2E Tests based in Protractor
63 lines (62 loc) • 2.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var protractor_1 = require("protractor");
var widget_1 = require("./widget");
var button_1 = require("./button");
var message_popup_1 = require("./message-popup");
var Dialog = /** @class */ (function (_super) {
tslib_1.__extends(Dialog, _super);
function Dialog() {
return _super !== null && _super.apply(this, arguments) || this;
}
Dialog.prototype.getNumberOfButtons = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.elem
.element(protractor_1.by.tagName('systelab-dialog-bottom'))
.all(protractor_1.by.tagName('button')).count()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
Dialog.prototype.getTitle = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.elem
.element(protractor_1.by.tagName('systelab-dialog-header'))
.element(protractor_1.by.className('slab-dialog-header')).getText()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
Dialog.prototype.getButtonClose = function () {
return new button_1.Button(this.elem
.element(protractor_1.by.className('slab-dialog-close')));
};
Dialog.prototype.close = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.getButtonClose().click()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
Dialog.prototype.getButtonByName = function (name) {
return new button_1.Button(this.elem
.element(protractor_1.by.buttonText(name)));
};
Dialog.prototype.getMessagePopup = function () {
return new message_popup_1.MessagePopup();
};
return Dialog;
}(widget_1.Widget));
exports.Dialog = Dialog;