Core Modules@serenity-js/coreActorsactorCalledexternalactorCalled CallableactorCalled(name: string): ActorInstantiates or retrieves an Actor called name if one has already been instantiated. This method is an alias for Serenity.theActorCalled. Usage with Cucumberimport { actorCalled } from '@serenity-js/core';import { Given } from '@cucumber/cucumber';Given(/(.*?) is a registered user/, async (name: string) => { await actorCalled(name).attemptsTo( // ... activities )}) Usage with Jasmineimport 'jasmine';import { actorCalled } from '@serenity-js/core';describe('Feature', () => { it('should have some behaviour', async () { await actorCalled('James').attemptsTo( // ... activities ) })}) Usage with Mochaimport { describe, it } from 'mocha';import { actorCalled } from '@serenity-js/core';describe('Feature', () => { it('should have some behaviour', async () => { await actorCalled('James').attemptsTo( // ... activities ) })}) Usage with Playwright TestWhen using Serenity/JS with Playwright Test, you should use either the default actor fixture or the injected actorCalled function instead of importing it from @serenity-js/core. import { describe, it } from '@serenity-js/playwright-test';describe('Feature', () => { it('should have some behaviour', async ({ actorCalled }) => { await actorCalled('James').attemptsTo( // ... activities ) })}) Learn moreengageActorCastSerenity.theActorCalledParametersexternalname: stringThe name of the actor to instantiate or retrieveReturns Actor
Instantiates or retrieves an
Actor
calledname
if one has already been instantiated.This method is an alias for
Serenity.theActorCalled
.Usage with Cucumber
Usage with Jasmine
Usage with Mocha
Usage with Playwright Test
When using Serenity/JS with Playwright Test, you should use either the default
actor
fixture or the injectedactorCalled
function instead of importing it from@serenity-js/core
.Learn more
engage
Actor
Cast
Serenity.theActorCalled