Skip to main content

afterAll

Callable

  • afterAll(inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, actors> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any): void
  • afterAll(title: string, inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, actors> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any): void

  • Declares an afterAll hook that is executed once per worker after all tests.

    Details

    When called in the scope of a test file, runs after all tests in the file. When called inside a test.describe(title, callback) group, runs after all tests in the group. If multiple afterAll hooks are added, they will run in the order of their registration.

    Note that worker process is restarted on test failures, and afterAll hook runs again in the new worker. Learn more about workers and failures.

    Usage

    test.afterAll(async () => {
    console.log('Done with tests');
    // ...
    });

    Parameters

    • inner: (args: PlaywrightTestArgs & PlaywrightTestOptions & Omit<SerenityOptions, actors> & SerenityFixtures & PlaywrightWorkerArgs & PlaywrightWorkerOptions & object, testInfo: TestInfo) => any

    Returns void