Skip to main content

externalSerenityWorkerFixtures

Serenity/JS-specific Playwright Test fixtures injected into your test scenarios.

Example test scenario

import { Ensure, equals } from '@serenity-js/assertions'
import { describe, it, test } from '@serenity-js/playwright-test'
import { Photographer, TakePhotosOfFailures } from '@serenity-js/web'

describe(`Recording items`, () => {

test.use({
defaultActorName: 'Serena',
crew: [
Photographer.whoWill(TakePhotosOfFailures),
],
})

describe(`Todo List App`, () => {

it(`should allow me to add a todo item`, async ({ actor }) => {
await actor.attemptsTo(
startWithAnEmptyList(),

recordItem('Buy some milk'),

Ensure.that(itemNames(), equals([
'Buy some milk',
])),
)
})
})
})

Learn more

Index

Properties

externalplatform

platform: { name: string; version: string }

Name and version of the operating system that Playwright Test worker process runs on.


Type declaration

  • externalname: string
  • externalversion: string

externalserenity

serenity: Serenity

Retrieves the root object of the Serenity/JS framework.

externalactorCalled

actorCalled: (name: string) => Actor

Uses the provided cast of actors to instantiate an Actor called name and inject it into a test scenario.

Retrieves an existing actor if one has already been instantiated.

Learn more


Type declaration

    • Parameters

      • externalname: string

      Returns Actor

Page Options