Skip to main content



  • engage(actors: Cast): void

  • Re-configures Serenity/JS with a new Cast of actors you want to use in any subsequent calls to actorCalled.

    This function is an alias for Serenity.engage, which provides an alternative to calling Actor.whoCan directly in your tests and is typically invoked in a “before all” or “before each” hook of your test runner of choice.

    configure vs engage

    Calling engage replaces the currently configured cast of actors, but doesn’t affect any other configuration. If you want to reset the Serenity/JS configuration completely, use configure instead.

    If your implementation of the Cast interface is stateless, you can invoke this function just once before your entire test suite is executed, see

    However, if your Cast holds state that you want to reset before each scenario, it’s better to invoke engage before each test using:

    Engaging a cast of actors

    import { Actor, Cast } from '@serenity-js/core';

    class Actors implements Cast {
    prepare(actor: Actor) {
    return actor.whoCan(
    // ... abilities you'd like the Actor to have

    engage(new Actors());

    Using with Mocha test runner

    import { beforeEach } from 'mocha'

    beforeEach(() => engage(new Actors()))

    Using with Jasmine test runner

    import 'jasmine'

    describe('My feature', () => {
    beforeEach(() => engage(new Actors()))


    Using with Cucumber.js test runner

    Engage Actors before each test scenario:

    import { Before } from '@cucumber/cucumber'

    Before(() => engage(new Actors()))

    Engage Actors before scenarios with specific tags:

    import { Before } from '@cucumber/cucumber'

    Before('@web', () => engage(new Actors()))

    Using with Playwright Test runner

    Serenity/JS Playwright Test module will configure the cast on your behalf, so you don’t need to call engage.

    import { describe, it, test } from '@serenity-js/playwright-test'

    describe('My feature', () => {

    actors: new Actors()

    // test scenarios


    Learn more


    Returns void