Skip to main content

StreamReporter

Serialises all the DomainEvent objects it receives and streams them as ndjson to the output stream.

Useful when debugging issues related to custom Serenity/JS test runner adapters.

Registering StreamReporter programmatically

import { configure, StreamReporter } from '@serenity-js/core'

configure({
crew: [
new StreamReporter(process.stdout)
],
})

Writing DomainEvents to a file

import { configure, StreamReporter } from '@serenity-js/core'
import fs = require('fs')

configure({
crew: [
new StreamReporter(fs.createWriteStream('./events.ndjson'))
],
})

Registering StreamReporter using Protractor configuration

// protractor.conf.js
const { StreamReporter } = require('@serenity-js/core');

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

serenity: {
crew: [
new StreamReporter(process.stdout),
],
// other Serenity/JS config
},
// other Protractor config
};

Registering StreamReporter using WebdriverIO configuration

// wdio.conf.js
import { StreamReporter } from '@serenity-js/core'
import { WebdriverIOConfig } from '@serenity-js/webdriverio'

export const config: WebdriverIOConfig = {

framework: '@serenity-js/webdriverio',

serenity: {
crew: [
new StreamReporter(process.stdout),
]
// other Serenity/JS config
},
},
// other WebdriverIO config
}

Implements

Index

Constructors

constructor

  • Parameters

    • output: Writable = process.stdout

      A Writable stream that should receive the output

    • optionalstage: Stage

      The stage this StageCrewMember should be assigned to

    Returns StreamReporter

Methods

assignedTo

notifyOf