Skip to main content

externalSerenityWorkerFixtures

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

Example test scenario

import { Ensure, equals } from '@serenity-js/assertions'
import { beforeAll, describe, it } from '@serenity-js/playwright-test'
import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'

describe('GitHub', () => {

beforeAll('Ensure system is ready to test', async ({ actorCalled }) => {
await actorCalled('Stagehand')
.whoCan(CallAnApi.at('https://www.githubstatus.com/api/v2/'))
.attemptsTo(
Send.a(GetRequest.to('status.json')),
Ensure.that(
LastResponse.status(),
equals(200)
),
Ensure.that(
LastResponse.body().status.description,
equals('All Systems Operational')
),
);
});
});

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