Skip to main content

TakeScreenshot

Instructs an actor who has the ability to BrowseTheWeb to take a screenshot and emit an Artifact, which can then be persisted by ArtifactArchiver and reported by Serenity BDD reporter.

Taking a screenshot

import { actorCalled } from '@serenity-js/core';
import { Navigate, TakeScreenshot } from '@serenity-js/protractor';

await actorCalled('Tania')
.attemptsTo(
Navigate.to('/app'),
TakeScreenshot.of('my app'),
)

Learn more

Hierarchy

  • Interaction
    • TakeScreenshot

Index

Methods

staticof

  • of(name: Answerable<string>): Interaction
  • Instantiates this Interaction.


    Parameters

    • name: Answerable<string>

      The name to give the emitted Artifact

    Returns Interaction

instantiationLocation

  • instantiationLocation(): FileSystemLocation
  • Returns the location where this Activity was instantiated.


    Returns FileSystemLocation

toString

  • toString(): string
  • Generates a human-friendly description to be used when reporting this Activity.

    Note: When this activity is reported, token #actor in the description will be replaced with the name of the actor performing this Activity.

    For example, #actor clicks on a button becomes Wendy clicks on a button.


    Returns string

performAs

  • performAs(actor: UsesAbilities & AnswersQuestions & CollectsArtifacts): Promise<void>
  • @inheritDoc

    Parameters

    • actor: UsesAbilities & AnswersQuestions & CollectsArtifacts

    Returns Promise<void>