UNPKG

systelab-components-test

Version:

Widgets to be use in the E2E Tests based in Protractor

72 lines (71 loc) 2.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var protractor_1 = require("protractor"); var widget_1 = require("./widget"); var Spinner = /** @class */ (function (_super) { tslib_1.__extends(Spinner, _super); function Spinner() { return _super !== null && _super.apply(this, arguments) || this; } Spinner.prototype.clear = 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('input')).clear()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; Spinner.prototype.setText = function (text) { 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('input')).sendKeys(text)]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; Spinner.prototype.getText = 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('input')).getAttribute('value')]; case 1: return [2 /*return*/, _a.sent()]; } }); }); }; Spinner.prototype.increase = 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.className('input-group-append')).click()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; Spinner.prototype.decrease = 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.className('input-group-prepend')).click()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; return Spinner; }(widget_1.Widget)); exports.Spinner = Spinner;