Skip to main content

externalactorInTheSpotlight

Callable

  • actorInTheSpotlight(): Actor

  • Retrieves an actor who was last instantiated or retrieved using actorCalled.

    This function is particularly useful when automating Cucumber scenarios.

    This function is an alias for Serenity.theActorInTheSpotlight.

    Usage with Cucumber

    import { actorCalled } from '@serenity-js/core';
    import { Given, When } from '@cucumber/cucumber';

    Given(/(.*?) is a registered user/, (name: string) =>
    actorCalled(name).attemptsTo(
    // ... activities
    ))

    When(/(?:he|she|they) browse their recent orders/, () =>
    actorInTheSpotlight().attemptsTo(
    // ... activities
    ))

    Learn more


    Returns Actor