Skip to main content

actorCalled

Callable

  • actorCalled(name: string): Actor

  • Instantiates or retrieves an Actor called name if one has already been instantiated.

    This method is an alias for Serenity.theActorCalled.

    Usage with Mocha

      import { describe, it } from 'mocha';
    import { actorCalled } from '@serenity-js/core';

    describe('Feature', () => {

    it('should have some behaviour', () =>
    actorCalled('James').attemptsTo(
    // ... activities
    ))
    })

    Usage with Jasmine

      import 'jasmine';
    import { actorCalled } from '@serenity-js/core';

    describe('Feature', () => {

    it('should have some behaviour', () =>
    actorCalled('James').attemptsTo(
    // ... activities
    ))
    })

    Usage with Cucumber

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

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

    Learn more


    Parameters

    • name: string

      The name of the actor to instantiate or retrieve

    Returns Actor