import {TakeScreenshot} from '@serenity-js/protractor/lib/screenplay/interactions'
public class | source

TakeScreenshot

Instructs the Actor to take a screenshot and emit an Artifact, which can then be persisted by ArtifactArchiver and reported by Serenity BDD reporter.

Extends:

Interaction → TakeScreenshot

Examples:

Clicking on an element
 import { actorCalled } from '@serenity-js/core';
 import { BrowseTheWeb, Navigate, TakeScreenshot } from '@serenity-js/protractor';
 import { protractor } from 'protractor';

 actorCalled('Tania')
     .whoCan(BrowseTheWeb.using(protractor.browser))
     .attemptsTo(
         Navigate.to('/app'),
         TakeScreenshot.of('my app'),
     );

Static Method Summary

Static Public Methods
public static

of(name: Answerable<string>): Interaction

Instantiates this Interaction.

Constructor Summary

Public Constructor
public

constructor(name: Answerable<string>)

Method Summary

Public Methods
public

performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>

Makes the provided Actor perform this Interaction.

public

toString(): string

Generates a description to be used when reporting this Activity.

Static Public Methods

public static of(name: Answerable<string>): Interaction source

Instantiates this Interaction.

Params:

NameTypeAttributeDescription
name Answerable<string>

The name to associate the screenshot with

Returns:

Interaction

Public Constructors

public constructor(name: Answerable<string>) source

Params:

NameTypeAttributeDescription
name Answerable<string>

The name to associate the screenshot with

Public Methods

public performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void> source

Makes the provided Actor perform this Interaction.

Params:

NameTypeAttributeDescription
actor UsesAbilities & AnswersQuestions

An Actor to perform this Interaction

Returns:

PromiseLike<void>

public toString(): string source

Generates a description to be used when reporting this Activity.

Returns:

string