UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

49 lines 2.08 kB
import type { UsesAbilities } from '../abilities'; import type { Answerable } from '../Answerable'; import type { CollectsArtifacts } from '../artifacts'; import { Interaction } from '../Interaction'; import type { AnswersQuestions } from '../questions'; /** * Instructs the [`Actor`](https://serenity-js.org/api/core/class/Actor/) * to [collect](https://serenity-js.org/api/core/interface/CollectsArtifacts/) arbitrary static values * and answers to [answerables](https://serenity-js.org/api/core/#Answerable), * so that they can be sent to the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/) * and printed to the terminal by the [`ConsoleReporter`](https://serenity-js.org/api/console-reporter/class/ConsoleReporter/) * or attached to the HTML report by the [`SerenityBDDReporter`](https://serenity-js.org/api/serenity-bdd/class/SerenityBDDReporter/). * * ## Logging static and `Answerable` values * * ```ts * import { actorCalled, Log } from '@serenity-js/core' * import { Page } from '@serenity-js/web' * * await actorCalled('Laura').attemptsTo( * Log.the('Current page', Page.current().title(), Page.current().url()), * ) * ``` * * @group Activities */ export declare class Log extends Interaction { private readonly items; /** * Instantiates a new [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Log`](https://serenity-js.org/api/core/class/Log/) * * Note that this method accepts [variable number of arguments](https://www.typescriptlang.org/docs/handbook/functions.html#rest-parameters), * so that you can easily log several values at the same time. * * @param items * The items to be logged */ static the(...items: Array<Answerable<any>>): Interaction; /** * @param items * The items to be logged */ protected constructor(items: Array<Answerable<any>>); /** * @inheritDoc */ performAs(actor: UsesAbilities & AnswersQuestions & CollectsArtifacts): Promise<void>; } //# sourceMappingURL=Log.d.ts.map