UNPKG

cucumber-html-report-generator

Version:

Generate beautiful cucumberjs html reports for multiple instances (browsers / devices)

50 lines 2.73 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var FeaturesOverviewPage_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.FeaturesOverviewPage = void 0; const base_page_1 = require("../common/base-page"); const tsyringe_1 = require("tsyringe"); let FeaturesOverviewPage = FeaturesOverviewPage_1 = class FeaturesOverviewPage extends base_page_1.BasePage { constructor() { super(FeaturesOverviewPage_1.mainObjectXpath); } async getMainObject() { const mainObject = this.mainObjectXpath ? await $(this.mainObjectXpath) : null; return mainObject; } async isGraphDisplayed(graphName) { const graph = await (await this.getMainObject())?.$(`.//*[@id='${graphName}']`); return graph ? graph.isElementDisplayed() : false; } async getAdditionalDataTitleText() { const additionalDataTitle = await (await this.getMainObject())?.$(".//*[@test-id='additional-data.title']"); const additionalDataTitleText = await additionalDataTitle?.getText(); return additionalDataTitleText; } async getAdditionalDataPropertyValue(propertyName) { const propertyCell = await (await this.getMainObject())?.$(`.//*[@test-id='additional-data.table']//td[contains(text(),'${propertyName}')]//ancestor::tr//td[2]`); const propertyCellText = await propertyCell?.getText(); return propertyCellText; } async clickOnFeatureLink(featureName) { const link = await (await this.getMainObject())?.$(`.//*[@id='features-table']//td[contains(.,'${featureName}')]//a`); await link?.scrollIntoView(); await link?.click(); } }; FeaturesOverviewPage.mainObjectXpath = ".//*[@class='features-overview-report']"; FeaturesOverviewPage = FeaturesOverviewPage_1 = __decorate([ (0, tsyringe_1.injectable)(), __metadata("design:paramtypes", []) ], FeaturesOverviewPage); exports.FeaturesOverviewPage = FeaturesOverviewPage; //# sourceMappingURL=features-overview-page.js.map