Type Alias LibraCaseDescribe

LibraCaseDescribe: SuiteFunction & {
    only: SuiteFunction;
    skip: SuiteFunction;
}

Declares a group of tests.

  • test.describe(title, callback)
  • test.describe(callback)
  • test.describe(title, details, callback)

Usage

You can declare a group of tests with a title. The title will be visible in the test report as a part of each test's title.

test.describe('two tests', () => {
test('one', async ({ page }) => {
// ...
});

test('two', async ({ page }) => {
// ...
});
});

Anonymous group

You can also declare a test group without a title. This is convenient to give a group of tests a common option with test.use(options).

test.describe(() => {
test.use({ colorScheme: 'dark' });

test('one', async ({ page }) => {
// ...
});

test('two', async ({ page }) => {
// ...
});
});

Tags

You can tag all tests in a group by providing additional details. Note that each tag must start with @ symbol.

import { test, expect } from '@playwright/test';
import { addLink } from '@wdio/allure-reporter';

test.describe('two tagged tests', {
tag: '@smoke',
}, () => {
test('one', async ({ page }) => {
// ...
});

test('two', async ({ page }) => {
// ...
});
});

Learn more about tagging.

Annotations

You can annotate all tests in a group by providing additional details.

import { test, expect } from '@playwright/test';

test.describe('two annotated tests', {
annotation: {
type: 'issue',
description: 'https://github.com/microsoft/playwright/issues/23180',
},
}, () => {
test('one', async ({ page }) => {
// ...
});

test('two', async ({ page }) => {
// ...
});
});

Learn more about test annotations.

Group title.

Additional details for all tests in the group.

A callback that is run immediately when calling test.describe([title, details, callback]). Any tests declared in this callback will belong to the group.

only

skip