Skip to main content

describe

Callable

  • describe(title: string, callback: () => void): void
  • describe(callback: () => void): void
  • describe(title: string, details: TestDetails, callback: () => void): void

  • Declares a group of test scenarios.

    Example

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

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

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

    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',
    ])),
    )
    })

    it('should clear text input field when an item is added', async ({ actor }) => {
    await actor.attemptsTo(
    startWithAnEmptyList(),

    recordItem('Buy some milk'),

    Ensure.that(Value.of(newTodoInput()), equals('')),
    )
    })
    })

    Learn more


    Parameters

    • title: string
    • callback: () => void

    Returns void