UNPKG

@serenity-js/web

Version:

Serenity/JS Screenplay Pattern library offering a flexible, web driver-agnostic approach for interacting with web-based user interfaces and components, suitable for various testing contexts

47 lines 1.77 kB
import type { Answerable, AnswersQuestions, CollectsArtifacts, UsesAbilities } from '@serenity-js/core'; import { Interaction } from '@serenity-js/core'; /** * Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) * who has the [ability](https://serenity-js.org/api/core/class/Ability/) * to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) * to take a screenshot and emit an artifact, * which can then be persisted by [`ArtifactArchiver`](https://serenity-js.org/api/core/class/ArtifactArchiver/) * and reported by [Serenity BDD reporter](https://serenity-js.org/api/serenity-bdd). * * #### Taking a screenshot * * ```ts * 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 * * - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) * - [`CollectsArtifacts`](https://serenity-js.org/api/core/interface/CollectsArtifacts/) * - [`ArtifactArchiver`](https://serenity-js.org/api/core/class/ArtifactArchiver/) * * @group Activities */ export declare class TakeScreenshot extends Interaction { private readonly name; /** * Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/). * * @param name * The name to give the emitted artifact */ static of(name: Answerable<string>): Interaction; protected constructor(name: Answerable<string>); /** * @inheritDoc */ performAs(actor: UsesAbilities & AnswersQuestions & CollectsArtifacts): Promise<void>; } //# sourceMappingURL=TakeScreenshot.d.ts.map