import {Photographer} from '@serenity-js/protractor/lib/stage/crew/photographer'
Photographer
The Photographer is a StageCrewMember who takes screenshots of the web browser the Actor in the spotlight is using.
Examples:
const { ArtifactArchiver } = require('@serenity-js/core');
const { Photographer, TakePhotosOfFailures } = require('@serenity-js/protractor');
exports.config = {
serenity: {
crew: [
ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
Photographer.whoWill(TakePhotosOfFailures),
]
},
// ... rest of the config omitted for brevity
};
const { Photographer, TakePhotosOfFailures } = require('@serenity-js/protractor');
Photographer.whoWill(TakePhotosOfFailures)
const { Photographer, TakePhotosOfInteractions } = require('@serenity-js/protractor');
Photographer.whoWill(TakePhotosOfInteractions)
const { Photographer, TakePhotosBeforeAndAfterInteractions } = require('@serenity-js/protractor');
Photographer.whoWill(TakePhotosBeforeAndAfterInteractions)
See also:
Static Method Summary
Static Public Methods | ||
public static |
whoWill(strategy: Function): StageCrewMember Instantiates a new Photographer configured to take photos (screenshots) as per the specified PhotoTakingStrategy. |
Constructor Summary
Public Constructor | ||
public |
constructor(photoTakingStrategy: PhotoTakingStrategy, 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): * Handles DomainEvent objects emitted by the Stage this StageCrewMember is assigned to. |
Static Public Methods
public static whoWill(strategy: Function): StageCrewMember source
Instantiates a new Photographer configured to take photos (screenshots) as per the specified PhotoTakingStrategy.
Params:
Name | Type | Attribute | Description |
strategy | Function | A no-arg constructor function that instantiates a PhotoTakingStrategy. |
Public Constructors
public constructor(photoTakingStrategy: PhotoTakingStrategy, stage: Stage) source
Params:
Name | Type | Attribute | Description |
photoTakingStrategy | PhotoTakingStrategy | ||
stage | Stage |
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 |
public notifyOf(event: DomainEvent): * source
Handles DomainEvent objects emitted by the Stage this StageCrewMember is assigned to.
Params:
Name | Type | Attribute | Description |
event | DomainEvent |
Returns:
* | void |