systelab-components-test
Version:
Widgets to be use in the E2E Tests based in Protractor
40 lines (39 loc) • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var js_console_1 = require("./js-console");
var protractor_1 = require("protractor");
var TestUtil = /** @class */ (function () {
function TestUtil() {
}
TestUtil.init = function (tms, feature, version, user) {
allure.addLabel('tms', tms);
allure.addLabel('feature', feature);
var capabilities = protractor_1.browser.driver.getCapabilities()
.then(function (caps) {
protractor_1.browser.browserName = caps.get('browserName');
allure.addLabel('browser', protractor_1.browser.browserName);
});
if (version) {
allure.addLabel('appVersion', version);
}
if (user) {
allure.addLabel('tester', user);
}
allure.addLabel('testExecutionDateTime', new Date().toLocaleString());
this.console.clear();
};
TestUtil.hasErrorsInConsole = 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.console.hasErrors()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
TestUtil.console = new js_console_1.JSConsole();
return TestUtil;
}());
exports.TestUtil = TestUtil;