import Allure from "allure-js-commons" ; export enum Status { Passed = "passed" , Pending = "pending" , Skipped = "skipped" , Failed = "failed" , Broken = "broken" } export enum Severity { Blocker = 'blocker' , Critical = 'critical' , Normal = 'normal' , Minor = 'minor' , Trivial = 'trivial' } export class Reporter { private allure : Allure ; constructor ( allure ) { this . allure = allure ; } public description ( description ) { this . allure . setDescription ( description ) ; return this ; } public severity ( severity ) { this . addLabel ( 'severity' , severity ) ; return this ; } public epic ( epic ) { this . addLabel ( 'epic' , epic ) ; return this ; } public feature ( feature ) { this . addLabel ( 'feature' , feature ) ; return this ; } public story ( story ) { this . addLabel ( 'story' , story ) ; return this ; } public testId ( testId ) { this . addLabel ( 'testId' , testId ) ; return this ; } public startStep ( name ) { this . allure . startStep ( name ) ; return this ; } public endStep ( status = Status . Passed ) { this . allure . endStep ( status ) ; return this ; } public addArgument ( name ) { this . allure . startStep ( name ) ; return this ; } public addEnvironment ( name , value ) { this . allure . getCurrentTest ( ) . addParameter ( 'environment-variable' , name , value ) ; return this ; } public addAttachment ( name , buffer , type ) { this . allure . addAttachment ( name , buffer , type ) ; return this ; } public addLabel ( name , value ) { this . allure . getCurrentTest ( ) . addLabel ( name , value ) ; return this ; } ; public addParameter ( paramName , name , value ) { this . allure . getCurrentTest ( ) . addParameter ( paramName , name , value ) ; return this ; } ; }