import { AllureStep , StepInterface } from "allure-js-commons" ; import { AllureReporter } from "./AllureReporter" ; export class StepWrapper { constructor ( private readonly reporter , private readonly step ) { } public startStep ( name ) { const step = this . step . startStep ( name ) ; this . reporter . pushStep ( step ) ; return new StepWrapper ( this . reporter , step ) ; } public endStep ( ) { this . reporter . popStep ( ) ; this . step . endStep ( ) ; } public run < T > ( body ) { return this . step . wrap ( body ) ( ) ; } }