import {ArtifactArchiver} from '@serenity-js/core/lib/stage/crew/artifact-archiver'
ArtifactArchiver
Stores any Artifacts emitted via ArtifactGenerated events on the FileSystem
Implements:
Examples:
import { configure, StreamReporter } from '@serenity-js/core';
configure({
crew: [
ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
],
});
// protractor.conf.js
const { ArtifactArchiver } = require('@serenity-js/core');
exports.config = {
framework: 'custom',
frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
serenity: {
crew: [
ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
],
// other Serenity/JS config
},
// other Protractor config
};
Tests:
- ArtifactArchiver
- ArtifactArchiver stores the artifacts generated by other stage crew members notifies the StageManager when an artifact is saved so that the promise of a stage cue can be fulfilled
- ArtifactArchiver stores the artifacts generated by other stage crew members notifies the StageManager when an artifact cannot be saved so that the promise of a stage cue can be rejected
- ArtifactArchiver stores the artifacts generated by other stage crew members correctly saves the test report to a unique file
- ArtifactArchiver stores the artifacts generated by other stage crew members correctly saves PNG content to a file
- ArtifactArchiver stores the artifacts generated by other stage crew members
- ArtifactArchiver ignores them
- ArtifactArchiver notifies the StageManager when the artifact is correctly archived
Static Method Summary
Static Public Methods | ||
public static |
storingArtifactsAt(destination: string[]): StageCrewMember Instantiates an |
Constructor Summary
Public Constructor | ||
public |
constructor(fileSystem: FileSystem, stage: Stage) |
Method Summary
Public Methods | ||
public |
assignedTo(stage: Stage): StageCrewMember 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 StageManager. |
Static Public Methods
public static storingArtifactsAt(destination: string[]): StageCrewMember source
Instantiates an ArtifactArchiver
storing artifacts in a given destination
.
The destination
directory will be created automatically and recursively if it doesn't exist.
Params:
Name | Type | Attribute | Description |
destination | string[] |
Public Constructors
public constructor(fileSystem: FileSystem, stage: Stage) source
Params:
Name | Type | Attribute | Description |
fileSystem | FileSystem | ||
stage | Stage |
|
The stage this StageCrewMember should be assigned to |
Public Methods
public assignedTo(stage: Stage): StageCrewMember source
Creates a new instance of this StageCrewMember and assigns it to a given Stage.
Params:
Name | Type | Attribute | Description |
stage | Stage | An instance of a Stage this StageCrewMember will be assigned to |
See:
public notifyOf(event: DomainEvent): void source
Handles DomainEvent objects emitted by the StageManager.
Params:
Name | Type | Attribute | Description |
event | DomainEvent |
Returns:
void |