allure-cucumberjs
Version:
Allure Cucumber.JS integration
48 lines (47 loc) • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AllureCucumberTestRuntime", {
enumerable: true,
get: function get() {
return _runtime2.AllureCucumberTestRuntime;
}
});
Object.defineProperty(exports, "AllureCucumberWorld", {
enumerable: true,
get: function get() {
return _legacy.AllureCucumberWorld;
}
});
var _cucumber = require("@cucumber/cucumber");
var _reporter = require("allure-js-commons/sdk/reporter");
var _runtime = require("allure-js-commons/sdk/runtime");
var _legacy = require("./legacy.js");
var _runtime2 = require("./runtime.js");
var _utils = require("./utils.js");
(0, _cucumber.BeforeAll)(() => {
(0, _runtime.setGlobalTestRuntime)(new _runtime2.AllureCucumberTestRuntime());
});
(0, _cucumber.Before)({
name: "ALLURE_FIXTURE_IGNORE"
}, scenario => {
var testPlan = (0, _reporter.parseTestPlan)();
if (!testPlan) {
return;
}
var pickle = scenario.pickle;
var posixPath = (0, _utils.getPosixPathRelativeToProjectRoot)(pickle);
var fullName = "".concat(posixPath, "#").concat(pickle.name);
var tags = pickle.tags.map(tag => tag.name);
if (!(0, _reporter.includedInTestPlan)(testPlan, {
fullName,
tags
})) {
// we can't use regular message or Allure facade since we need label to be added
// to test, not fixture
_cucumber.world.attach(Buffer.from("allure-skip"), "application/vnd.allure.skipcucumber+json");
return "skipped";
}
});
//# sourceMappingURL=index.js.map