diff --git a/docs/src/test-reporter-api/class-suite.md b/docs/src/test-reporter-api/class-suite.md index f585f3cedf..81f6646456 100644 --- a/docs/src/test-reporter-api/class-suite.md +++ b/docs/src/test-reporter-api/class-suite.md @@ -30,7 +30,7 @@ Returns the list of all test cases in this suite and its descendants, as opposit * since: v1.44 - type: <[Array]<[TestCase]|[Suite]>> -Test cases and suites defined directly in this suite. The elements returned in their declaration order. +Test cases and suites defined directly in this suite. The elements returned in their declaration order. You can discriminate between different entry types using [`property: TestCase.type`] and [`property: Suite.type`]. ## property: Suite.location * since: v1.10 @@ -83,4 +83,5 @@ Returns a list of titles from the root down to this suite. * since: v1.44 - returns: <[SuiteType]<'root' | 'project' | 'file' | 'describe'>> -Returns type of the suite. +Returns type of the suite. The Suites form the following hierarchy: +`root` -> `project` -> `file` -> `describe` -> ...`describe` -> `test`. diff --git a/packages/playwright/types/testReporter.d.ts b/packages/playwright/types/testReporter.d.ts index 1fb32a391e..539c8cef25 100644 --- a/packages/playwright/types/testReporter.d.ts +++ b/packages/playwright/types/testReporter.d.ts @@ -41,7 +41,8 @@ export type { FullConfig, TestStatus, FullProject } from './test'; */ export interface Suite { /** - * Returns type of the suite. + * Returns type of the suite. The Suites form the following hierarchy: `root` -> `project` -> `file` -> `describe` -> + * ...`describe` -> `test`. */ type: 'root' | 'project' | 'file' | 'describe'; /** @@ -55,7 +56,10 @@ export interface Suite { allTests(): Array; /** - * Test cases and suites defined directly in this suite. The elements returned in their declaration order. + * Test cases and suites defined directly in this suite. The elements returned in their declaration order. You can + * discriminate between different entry types using + * [testCase.type](https://playwright.dev/docs/api/class-testcase#test-case-type) and + * [suite.type](https://playwright.dev/docs/api/class-suite#suite-type). */ entries(): Array;