import { AllureRuntime } from "./AllureRuntime" ; import { AllureTest } from "./AllureTest" ; import { ExecutableItemWrapper } from "./ExecutableItemWrapper" ; import { AttachmentOptions , Category , LinkType , Status } from "./model" ; import { ContentType } from "./model" ; import { LabelName } from "./model" ; export abstract class Allure { protected abstract get currentTest ( ) : AllureTest ; protected abstract get currentExecutable ( ) : ExecutableItemWrapper ; protected constructor ( protected runtime ) { } public epic ( epic ) { this . label ( LabelName . EPIC , epic ) ; } public feature ( feature ) { this . label ( LabelName . FEATURE , feature ) ; } public story ( story ) { this . label ( LabelName . STORY , story ) ; } public suite ( name ) { this . label ( LabelName . SUITE , name ) ; } public parentSuite ( name ) { this . label ( LabelName . PARENT_SUITE , name ) ; } public subSuite ( name ) { this . label ( LabelName . SUB_SUITE , name ) ; } public label ( name , value ) { this . currentTest . addLabel ( name , value ) ; } public parameter ( name , value ) { this . currentExecutable . addParameter ( name , value ) ; } public link ( url , name ? , type ? ) { this . currentTest . addLink ( url , name , type ) ; } public issue ( name , url ) { this . link ( url , name , LinkType . ISSUE ) ; } public tms ( name , url ) { this . link ( url , name , LinkType . TMS ) ; } public description ( markdown ) { this . currentExecutable . description = markdown ; } public descriptionHtml ( html ) { this . currentExecutable . descriptionHtml = html ; } public owner ( owner ) { this . label ( LabelName . OWNER , owner ) ; } public severity ( severity ) { this . label ( LabelName . SEVERITY , severity ) ; } public tag ( tag ) { this . label ( LabelName . TAG , tag ) ; } public writeEnvironmentInfo ( info ) { this . runtime . writeEnvironmentInfo ( info ) ; } public writeCategoriesDefinitions ( categories ) { this . runtime . writeCategoriesDefinitions ( categories ) ; } public abstract attachment ( name , content , options ) ; public abstract logStep ( name , status ? ) ; public abstract step < T > ( name , body ) ; deprecated public createStep ( name , stepFunction ) { return ( ... args ) : any => this . step ( name , ( ) => stepFunction . apply ( this , args ) ) ; } deprecated public createAttachment ( name , content , type ) { if ( typeof content === "function" ) { return ( ... args ) : void => { this . attachment ( name , content . apply ( this , args ) , type ) ; } ; } else { this . attachment ( name , content , type ) ; } } } export interface StepInterface { parameter ( name , value ) : void ; name ( name ) : void ; }