import {SerenityBDDReporter} from '@serenity-js/serenity-bdd/lib/stage/crew/serenity-bdd-reporter'
public class | source

SerenityBDDReporter

Produces Serenity BDD-standard JSON reports that Serenity BDD CLI Reporter can parse to produce HTML reports and living documentation.

Implements:

Examples:

Registering the reporter programmatically
 import { ArtifactArchiver, configure } from '@serenity-js/core';
 import { SerenityBDDReporter } from '@serenity-js/serenity-bdd';

 configure({
   crew: [
     ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
     new SerenityBDDReporter()
   ],
 });
Registering the reporter using Protractor configuration
 // protractor.conf.js
 const
   { ArtifactArchiver }    = require('@serenity-js/core'),
   { SerenityBDDReporter } = require('@serenity-js/serenity-bdd');

 exports.config = {
   framework:     'custom',
   frameworkPath: require.resolve('@serenity-js/protractor/adapter'),

   serenity: {
     crew: [
       ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
       new SerenityBDDReporter(),
     ],
     // other Serenity/JS config
   },

   // other Protractor config
 };

Tests:

Constructor Summary

Public Constructor
public

constructor(stage: Stage)

Method Summary

Public Methods
public

Creates a new instance of this StageCrewMember and assigns it to a given Stage.

public

notifyOf(event: DomainEvent): void

Handles DomainEvent objects emitted by the StageCrewMember.

Public Constructors

public constructor(stage: Stage) source

Params:

NameTypeAttributeDescription
stage Stage
  • optional
  • default: undefined

stage

Public Methods

public assignedTo(stage: Stage): StageCrewMember source

Creates a new instance of this StageCrewMember and assigns it to a given Stage.

Params:

NameTypeAttributeDescription
stage Stage

An instance of a Stage this StageCrewMember will be assigned to

Returns:

StageCrewMember

A new instance of this StageCrewMember

public notifyOf(event: DomainEvent): void source

Handles DomainEvent objects emitted by the StageCrewMember.

Params:

NameTypeAttributeDescription
event DomainEvent

Returns:

void