UNPKG

@mmisty/cypress-allure-adapter

Version:

cypress allure adapter to generate allure results during tests execution (Allure TestOps compatible)

35 lines (34 loc) 1.53 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.allureAdapterSetup = void 0; const debug_1 = __importDefault(require("debug")); require("../cypress/cypress"); const register_1 = require("@mmisty/cypress-tags/register"); const commands_1 = require("../commands"); const allure_mocha_reporter_1 = require("./allure-mocha-reporter"); const websocket_1 = require("./websocket"); const common_1 = require("../common"); const setup_gherkin_1 = require("../setup/setup-gherkin"); const process_tags_1 = require("./process-tags"); const debug = (0, debug_1.default)('cypress-allure:setup'); const allureAdapterSetup = () => { var _a; Cypress.env('cyTagsShowTagsInTitle', (_a = Cypress.env('allureShowTagsInTitle')) !== null && _a !== void 0 ? _a : Cypress.env('cyTagsShowTagsInTitle')); (0, register_1.registerTags)(); (0, commands_1.registerCommands)(); const ws = (0, websocket_1.startWsClient)(); if (!ws) { debug(`${common_1.packageLog} No reporting since server could not start`); (0, allure_mocha_reporter_1.registerStubReporter)(); return; } (0, allure_mocha_reporter_1.registerMochaReporter)(ws); (0, setup_gherkin_1.addGherkin)(); Cypress.Allure.on('test:started', test => { (0, process_tags_1.processTagsOnTestStart)(test); }); }; exports.allureAdapterSetup = allureAdapterSetup;