UNPKG

@serenity-js/cucumber

Version:

Serenity/JS test runner adapter for seamless integration with any version of Cucumber.js, facilitating BDD-style test automation and leveraging Serenity/JS reporting capabilities

27 lines 1.12 kB
"use strict"; const model_1 = require("@serenity-js/core/lib/model"); const CucumberEventProtocolAdapter_1 = require("./CucumberEventProtocolAdapter"); module.exports = function (dependencies) { dependencies.cucumber.defineSupportCode(({ BeforeAll, After, AfterAll }) => { BeforeAll(function () { dependencies.notifier.testRunStarts(); }); After(function () { dependencies.notifier.scenarioFinishes(); return dependencies.serenity.waitForNextCue(); }); AfterAll(async function () { dependencies.notifier.testRunFinishes(); try { await dependencies.serenity.waitForNextCue(); dependencies.notifier.testRunFinished(new model_1.ExecutionSuccessful()); } catch (error) { dependencies.notifier.testRunFinished(new model_1.ExecutionFailedWithError(error)); throw error; } }); }); return (0, CucumberEventProtocolAdapter_1.cucumberEventProtocolAdapter)(dependencies); }; //# sourceMappingURL=cucumber-3.js.map