chore: get rid of ConfigInWorker, use FullConfig instead (#30517)

Addressing API review feedback.
This commit is contained in:
Yury Semikhatsky 2024-04-24 14:14:05 -07:00 committed by GitHub
parent 6fecf52016
commit f1f3929a67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 49 additions and 494 deletions

View File

@ -1,135 +0,0 @@
# class: ConfigInWorker
* since: v1.10
* langs: js
Resolved configuration available via [`property: TestInfo.config`] and [`property: WorkerInfo.config`].
## property: ConfigInWorker.configFile
* since: v1.20
- type: ?<[string]>
Path to the configuration file (if any) used to run the tests.
## property: ConfigInWorker.forbidOnly
* since: v1.10
- type: <[boolean]>
See [`property: TestConfig.forbidOnly`].
## property: ConfigInWorker.fullyParallel
* since: v1.20
- type: <[boolean]>
See [`property: TestConfig.fullyParallel`].
## property: ConfigInWorker.globalSetup
* since: v1.10
- type: <[null]|[string]>
See [`property: TestConfig.globalSetup`].
## property: ConfigInWorker.globalTeardown
* since: v1.10
- type: <[null]|[string]>
See [`property: TestConfig.globalTeardown`].
## property: ConfigInWorker.globalTimeout
* since: v1.10
- type: <[int]>
See [`property: TestConfig.globalTimeout`].
## property: ConfigInWorker.grep
* since: v1.10
- type: <[RegExp]|[Array]<[RegExp]>>
See [`property: TestConfig.grep`].
## property: ConfigInWorker.grepInvert
* since: v1.10
- type: <[null]|[RegExp]|[Array]<[RegExp]>>
See [`property: TestConfig.grepInvert`].
## property: ConfigInWorker.maxFailures
* since: v1.10
- type: <[int]>
See [`property: TestConfig.maxFailures`].
## property: ConfigInWorker.metadata
* since: v1.10
- type: <[Metadata]>
See [`property: TestConfig.metadata`].
## property: ConfigInWorker.preserveOutput
* since: v1.10
- type: <[PreserveOutput]<"always"|"never"|"failures-only">>
See [`property: TestConfig.preserveOutput`].
## property: ConfigInWorker.projects
* since: v1.10
- type: <[Array]<[ProjectInWorker]>>
List of resolved projects.
## property: ConfigInWorker.quiet
* since: v1.10
- type: <[boolean]>
See [`property: TestConfig.quiet`].
## property: ConfigInWorker.reporter
* since: v1.10
- type: <[string]|[Array]<[Object]>|[BuiltInReporter]<"list"|"dot"|"line"|"github"|"json"|"junit"|"null"|"html">>
- `0` <[string]> Reporter name or module or file path
- `1` <[Object]> An object with reporter options if any
See [`property: TestConfig.reporter`].
## property: ConfigInWorker.reportSlowTests
* since: v1.10
- type: <[null]|[Object]>
- `max` <[int]> The maximum number of slow test files to report. Defaults to `5`.
- `threshold` <[float]> Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
See [`property: TestConfig.reportSlowTests`].
## property: ConfigInWorker.rootDir
* since: v1.20
- type: <[string]>
## property: ConfigInWorker.shard
* since: v1.10
- type: <[null]|[Object]>
- `total` <[int]> The total number of shards.
- `current` <[int]> The index of the shard to execute, one-based.
See [`property: TestConfig.shard`].
## property: ConfigInWorker.updateSnapshots
* since: v1.10
- type: <[UpdateSnapshots]<"all"|"none"|"missing">>
See [`property: TestConfig.updateSnapshots`].
## property: ConfigInWorker.version
* since: v1.20
- type: <[string]>
Playwright version.
## property: ConfigInWorker.webServer
* since: v1.10
- type: <[null]|[Object]>
See [`property: TestConfig.webServer`].
## property: ConfigInWorker.workers
* since: v1.10
- type: <[int]>
See [`property: TestConfig.workers`].

View File

@ -2,13 +2,13 @@
* since: v1.10
* langs: js
Resolved configuration passed to [`method: Reporter.onBegin`].
Resolved configuration which is accessible via [`property: TestInfo.config`] and is passed to the test reporters. To see the format of Playwright configuration file, please see [TestConfig] instead.
## property: FullConfig.configFile
* since: v1.20
- type: ?<[string]>
Path to the configuration file (if any) used to run the tests.
Path to the configuration file used to run the tests. The value is an empty string if no config file was used.
## property: FullConfig.forbidOnly
* since: v1.10
@ -102,6 +102,8 @@ See [`property: TestConfig.reportSlowTests`].
* since: v1.20
- type: <[string]>
Base directory for all relative paths used in the reporters.
## property: FullConfig.shard
* since: v1.10
- type: <[null]|[Object]>

View File

@ -2,10 +2,7 @@
* since: v1.10
* langs: js
Runtime representation of the test project configuration that is passed
to [Reporter]. It exposes some of the resolved fields declared in
[TestProject]. You can get [FullProject] instance from [`property: FullConfig.projects`]
or [`method: Suite.project`].
Runtime representation of the test project configuration. It is accessible in the tests via [`property: TestInfo.project`] and [`property: WorkerInfo.project`] and is passed to the test reporters. To see the format of the project in the Playwright configuration file please see [TestProject] instead.
## property: FullProject.dependencies
* since: v1.31

View File

@ -1,96 +0,0 @@
# class: ProjectInWorker
* since: v1.10
* langs: js
Runtime representation of the test project configuration that can be accessed
in the tests via [`property: TestInfo.project`] and [`property: WorkerInfo.project`].
## property: ProjectInWorker.dependencies
* since: v1.31
- type: <[Array]<[string]>>
See [`property: TestProject.dependencies`].
## property: ProjectInWorker.grep
* since: v1.10
- type: <[RegExp]|[Array]<[RegExp]>>
See [`property: TestProject.grep`].
## property: ProjectInWorker.grepInvert
* since: v1.10
- type: <[null]|[RegExp]|[Array]<[RegExp]>>
See [`property: TestProject.grepInvert`].
## property: ProjectInWorker.metadata
* since: v1.10
- type: <[Metadata]>
See [`property: TestProject.metadata`].
## property: ProjectInWorker.name
* since: v1.10
- type: <[string]>
See [`property: TestProject.name`].
## property: ProjectInWorker.snapshotDir
* since: v1.10
- type: <[string]>
See [`property: TestProject.snapshotDir`].
## property: ProjectInWorker.outputDir
* since: v1.10
- type: <[string]>
See [`property: TestProject.outputDir`].
## property: ProjectInWorker.repeatEach
* since: v1.10
- type: <[int]>
See [`property: TestProject.repeatEach`].
## property: ProjectInWorker.retries
* since: v1.10
- type: <[int]>
See [`property: TestProject.retries`].
## property: ProjectInWorker.teardown
* since: v1.34
- type: ?<[string]>
See [`property: TestProject.teardown`].
## property: ProjectInWorker.testDir
* since: v1.10
- type: <[string]>
See [`property: TestProject.testDir`].
## property: ProjectInWorker.testIgnore
* since: v1.10
- type: <[string]|[RegExp]|[Array]<[string]|[RegExp]>>
See [`property: TestProject.testIgnore`].
## property: ProjectInWorker.testMatch
* since: v1.10
- type: <[string]|[RegExp]|[Array]<[string]|[RegExp]>>
See [`property: TestProject.testMatch`].
## property: ProjectInWorker.timeout
* since: v1.10
- type: <[int]>
See [`property: TestProject.timeout`].
## property: ProjectInWorker.use
* since: v1.10
- type: <[Fixtures]>
See [`property: TestProject.use`].

View File

@ -2,7 +2,7 @@
* since: v1.10
* langs: js
Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout` or `testDir`. These options are described in the [TestConfig] object in the [configuration file](../test-configuration.md).
Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout` or `testDir`. These options are described in the [TestConfig] object in the [configuration file](../test-configuration.md). This type describes format of the configuration file, to access resolved configuration parameters at run time use [FullConfig].
Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to [`property: TestConfig.projects`], but top-level [TestConfig] can also define base options shared between all projects.
@ -112,7 +112,7 @@ export default defineConfig({
* since: v1.10
- type: ?<[string]>
Path to the global setup file. This file will be required and run before all the tests. It must export a single function that takes a [`TestConfig`] argument.
Path to the global setup file. This file will be required and run before all the tests. It must export a single function that takes a [FullConfig] argument.
Learn more about [global setup and teardown](../test-global-setup-teardown.md).

View File

@ -106,7 +106,7 @@ Column number where the currently running test is declared.
## property: TestInfo.config
* since: v1.10
- type: <[ConfigInWorker]>
- type: <[FullConfig]>
Processed configuration from the [configuration file](../test-configuration.md).
@ -279,7 +279,7 @@ Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about [paralleli
## property: TestInfo.project
* since: v1.10
- type: <[ProjectInWorker]>
- type: <[FullProject]>
Processed project configuration from the [configuration file](../test-configuration.md).

View File

@ -2,7 +2,7 @@
* since: v1.10
* langs: js
Playwright Test supports running multiple test projects at the same time. This is useful for running tests in multiple configurations. For example, consider running tests against multiple browsers.
Playwright Test supports running multiple test projects at the same time. This is useful for running tests in multiple configurations. For example, consider running tests against multiple browsers. This type describes format of a project in the configuration file, to access resolved configuration parameters at run time use [FullProject].
`TestProject` encapsulates configuration specific to a single project. Projects are configured in [`property: TestConfig.projects`] specified in the [configuration file](../test-configuration.md). Note that all properties of [TestProject] are available in the top-level [TestConfig], in which case they are shared between all projects.

View File

@ -6,7 +6,7 @@
## property: WorkerInfo.config
* since: v1.10
- type: <[ConfigInWorker]>
- type: <[FullConfig]>
Processed configuration from the [configuration file](../test-configuration.md).
@ -22,7 +22,7 @@ Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about [paralleli
## property: WorkerInfo.project
* since: v1.10
- type: <[ProjectInWorker]>
- type: <[FullProject]>
Processed project configuration from the [configuration file](../test-configuration.md).

View File

@ -17,13 +17,13 @@
import fs from 'fs';
import path from 'path';
import { captureRawStack, monotonicTime, zones, sanitizeForFilePath, stringifyStackFrames } from 'playwright-core/lib/utils';
import type { TestInfoError, TestInfo, TestStatus, ProjectInWorker, ConfigInWorker } from '../../types/test';
import type { TestInfoError, TestInfo, TestStatus, FullProject } from '../../types/test';
import type { AttachmentPayload, StepBeginPayload, StepEndPayload, WorkerInitParams } from '../common/ipc';
import type { TestCase } from '../common/test';
import { TimeoutManager, TimeoutManagerError, kMaxDeadline } from './timeoutManager';
import type { RunnableDescription } from './timeoutManager';
import type { Annotation, FullConfigInternal, FullProjectInternal } from '../common/config';
import type { Location } from '../../types/testReporter';
import type { FullConfig, Location } from '../../types/testReporter';
import { debugTest, filteredStackTrace, formatLocation, getContainedPath, normalizeAndSaveAttachment, serializeError, trimLongString, windowsFilesystemFriendlyLength } from '../util';
import { TestTracing } from './testTracing';
import type { Attachment } from './testTracing';
@ -81,8 +81,8 @@ export class TestInfoImpl implements TestInfo {
readonly retry: number;
readonly workerIndex: number;
readonly parallelIndex: number;
readonly project: ProjectInWorker;
readonly config: ConfigInWorker;
readonly project: FullProject;
readonly config: FullConfig;
readonly title: string;
readonly titlePath: string[];
readonly file: string;

View File

@ -35,7 +35,9 @@ type UseOptions<TestArgs, WorkerArgs> = Partial<WorkerArgs> & Partial<TestArgs>;
/**
* Playwright Test supports running multiple test projects at the same time. This is useful for running tests in
* multiple configurations. For example, consider running tests against multiple browsers.
* multiple configurations. For example, consider running tests against multiple browsers. This type describes format
* of a project in the configuration file, to access resolved configuration parameters at run time use {@link
* FullProject}.
*
* `TestProject` encapsulates configuration specific to a single project. Projects are configured in
* [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects) specified in the
@ -626,11 +628,13 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject<Tes
}
/**
* Runtime representation of the test project configuration that can be accessed in the tests via
* Runtime representation of the test project configuration. It is accessible in the tests via
* [testInfo.project](https://playwright.dev/docs/api/class-testinfo#test-info-project) and
* [workerInfo.project](https://playwright.dev/docs/api/class-workerinfo#worker-info-project).
* [workerInfo.project](https://playwright.dev/docs/api/class-workerinfo#worker-info-project) and is passed to the
* test reporters. To see the format of the project in the Playwright configuration file please see {@link
* TestProject} instead.
*/
export interface ProjectInWorker<TestArgs = {}, WorkerArgs = {}> {
export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
/**
* See [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
*/
@ -711,7 +715,8 @@ type LiteralUnion<T extends U, U = string> = T | (U & { zz_IGNORE_ME?: never });
/**
* Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout`
* or `testDir`. These options are described in the {@link TestConfig} object in the
* [configuration file](https://playwright.dev/docs/test-configuration).
* [configuration file](https://playwright.dev/docs/test-configuration). This type describes format of the configuration file, to access
* resolved configuration parameters at run time use {@link FullConfig}.
*
* Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to
* [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level {@link
@ -1055,7 +1060,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* Path to the global setup file. This file will be required and run before all the tests. It must export a single
* function that takes a [`TestConfig`] argument.
* function that takes a {@link FullConfig} argument.
*
* Learn more about [global setup and teardown](https://playwright.dev/docs/test-global-setup-teardown).
*
@ -1667,15 +1672,15 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig<TestA
export type Metadata = { [key: string]: any };
/**
* Resolved configuration available via
* [testInfo.config](https://playwright.dev/docs/api/class-testinfo#test-info-config) and
* [workerInfo.config](https://playwright.dev/docs/api/class-workerinfo#worker-info-config).
* Resolved configuration which is accessible via
* [testInfo.config](https://playwright.dev/docs/api/class-testinfo#test-info-config) and is passed to the test
* reporters. To see the format of Playwright configuration file, please see {@link TestConfig} instead.
*/
export interface ConfigInWorker<TestArgs = {}, WorkerArgs = {}> {
export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* List of resolved projects.
*/
projects: ProjectInWorker<TestArgs, WorkerArgs>[];
projects: FullProject<TestArgs, WorkerArgs>[];
/**
* See [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
*/
@ -1685,7 +1690,7 @@ export interface ConfigInWorker<TestArgs = {}, WorkerArgs = {}> {
*/
webServer: TestConfigWebServer | null;
/**
* Path to the configuration file (if any) used to run the tests.
* Path to the configuration file used to run the tests. The value is an empty string if no config file was used.
*/
configFile?: string;
@ -1759,6 +1764,9 @@ export interface ConfigInWorker<TestArgs = {}, WorkerArgs = {}> {
threshold: number;
};
/**
* Base directory for all relative paths used in the reporters.
*/
rootDir: string;
/**
@ -8129,7 +8137,7 @@ export interface TestInfo {
/**
* Processed configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
*/
config: ConfigInWorker;
config: FullConfig;
/**
* The number of milliseconds the test took to finish. Always zero before the test finishes, either successfully or
@ -8205,7 +8213,7 @@ export interface TestInfo {
/**
* Processed project configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
*/
project: ProjectInWorker;
project: FullProject;
/**
* Specifies a unique repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each`
@ -8359,7 +8367,7 @@ export interface WorkerInfo {
/**
* Processed configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
*/
config: ConfigInWorker;
config: FullConfig;
/**
* The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have
@ -8374,7 +8382,7 @@ export interface WorkerInfo {
/**
* Processed project configuration from the [configuration file](https://playwright.dev/docs/test-configuration).
*/
project: ProjectInWorker;
project: FullProject;
/**
* The unique index of the worker process that is running the test. When a worker is restarted, for example after a

View File

@ -15,217 +15,8 @@
* limitations under the License.
*/
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, ConfigInWorker } from './test';
export type { TestStatus } from './test';
type UseOptions<TestArgs, WorkerArgs> = Partial<WorkerArgs> & Partial<TestArgs>;
/**
* Resolved configuration passed to
* [reporter.onBegin(config, suite)](https://playwright.dev/docs/api/class-reporter#reporter-on-begin).
*/
export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* List of resolved projects.
*/
projects: FullProject<TestArgs, WorkerArgs>[];
/**
* See [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
*/
reporter: ReporterDescription[];
/**
* See [testConfig.webServer](https://playwright.dev/docs/api/class-testconfig#test-config-web-server).
*/
webServer: ConfigInWorker['webServer'];
/**
* Path to the configuration file (if any) used to run the tests.
*/
configFile?: string;
/**
* See [testConfig.forbidOnly](https://playwright.dev/docs/api/class-testconfig#test-config-forbid-only).
*/
forbidOnly: boolean;
/**
* See [testConfig.fullyParallel](https://playwright.dev/docs/api/class-testconfig#test-config-fully-parallel).
*/
fullyParallel: boolean;
/**
* See [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
*/
globalSetup: null|string;
/**
* See [testConfig.globalTeardown](https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown).
*/
globalTeardown: null|string;
/**
* See [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout).
*/
globalTimeout: number;
/**
* See [testConfig.grep](https://playwright.dev/docs/api/class-testconfig#test-config-grep).
*/
grep: RegExp|Array<RegExp>;
/**
* See [testConfig.grepInvert](https://playwright.dev/docs/api/class-testconfig#test-config-grep-invert).
*/
grepInvert: null|RegExp|Array<RegExp>;
/**
* See [testConfig.maxFailures](https://playwright.dev/docs/api/class-testconfig#test-config-max-failures).
*/
maxFailures: number;
/**
* See [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata).
*/
metadata: Metadata;
/**
* See [testConfig.preserveOutput](https://playwright.dev/docs/api/class-testconfig#test-config-preserve-output).
*/
preserveOutput: "always"|"never"|"failures-only";
/**
* See [testConfig.quiet](https://playwright.dev/docs/api/class-testconfig#test-config-quiet).
*/
quiet: boolean;
/**
* See [testConfig.reportSlowTests](https://playwright.dev/docs/api/class-testconfig#test-config-report-slow-tests).
*/
reportSlowTests: null|{
/**
* The maximum number of slow test files to report. Defaults to `5`.
*/
max: number;
/**
* Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
*/
threshold: number;
};
rootDir: string;
/**
* See [testConfig.shard](https://playwright.dev/docs/api/class-testconfig#test-config-shard).
*/
shard: null|{
/**
* The total number of shards.
*/
total: number;
/**
* The index of the shard to execute, one-based.
*/
current: number;
};
/**
* See [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots).
*/
updateSnapshots: "all"|"none"|"missing";
/**
* Playwright version.
*/
version: string;
/**
* See [testConfig.workers](https://playwright.dev/docs/api/class-testconfig#test-config-workers).
*/
workers: number;
}
/**
* Runtime representation of the test project configuration that is passed to {@link Reporter}. It exposes some of the
* resolved fields declared in {@link TestProject}. You can get {@link FullProject} instance from
* [fullConfig.projects](https://playwright.dev/docs/api/class-fullconfig#full-config-projects) or
* [suite.project()](https://playwright.dev/docs/api/class-suite#suite-project).
*/
export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
/**
* See [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use).
*/
use: UseOptions<PlaywrightTestOptions & TestArgs, PlaywrightWorkerOptions & WorkerArgs>;
/**
* See [testProject.dependencies](https://playwright.dev/docs/api/class-testproject#test-project-dependencies).
*/
dependencies: Array<string>;
/**
* See [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep).
*/
grep: RegExp|Array<RegExp>;
/**
* See [testProject.grepInvert](https://playwright.dev/docs/api/class-testproject#test-project-grep-invert).
*/
grepInvert: null|RegExp|Array<RegExp>;
/**
* See [testProject.metadata](https://playwright.dev/docs/api/class-testproject#test-project-metadata).
*/
metadata: Metadata;
/**
* See [testProject.name](https://playwright.dev/docs/api/class-testproject#test-project-name).
*/
name: string;
/**
* See [testProject.outputDir](https://playwright.dev/docs/api/class-testproject#test-project-output-dir).
*/
outputDir: string;
/**
* See [testProject.repeatEach](https://playwright.dev/docs/api/class-testproject#test-project-repeat-each).
*/
repeatEach: number;
/**
* See [testProject.retries](https://playwright.dev/docs/api/class-testproject#test-project-retries).
*/
retries: number;
/**
* See [testProject.snapshotDir](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-dir).
*/
snapshotDir: string;
/**
* See [testProject.teardown](https://playwright.dev/docs/api/class-testproject#test-project-teardown).
*/
teardown?: string;
/**
* See [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir).
*/
testDir: string;
/**
* See [testProject.testIgnore](https://playwright.dev/docs/api/class-testproject#test-project-test-ignore).
*/
testIgnore: string|RegExp|Array<string|RegExp>;
/**
* See [testProject.testMatch](https://playwright.dev/docs/api/class-testproject#test-project-test-match).
*/
testMatch: string|RegExp|Array<string|RegExp>;
/**
* See [testProject.timeout](https://playwright.dev/docs/api/class-testproject#test-project-timeout).
*/
timeout: number;
}
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject } from './test';
export type { FullConfig, FullProject, TestStatus } from './test';
/**
* Result of the full test run.

View File

@ -280,8 +280,8 @@ const authFiles = {
export default config;
`,
'auth.ts': `
import { chromium, ConfigInWorker } from '@playwright/test';
async function globalSetup(config: ConfigInWorker) {
import { chromium, FullConfig } from '@playwright/test';
async function globalSetup(config: FullConfig) {
const { baseURL, storageState } = config.projects[0].use;
const browser = await chromium.launch();
const page = await browser.newPage();

View File

@ -39,7 +39,7 @@ interface TestProject<TestArgs = {}, WorkerArgs = {}> {
export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject<TestArgs, WorkerArgs> {
}
export interface ProjectInWorker<TestArgs = {}, WorkerArgs = {}> {
export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
use: UseOptions<PlaywrightTestOptions & TestArgs, PlaywrightWorkerOptions & WorkerArgs>;
}
@ -57,8 +57,8 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig<TestA
export type Metadata = { [key: string]: any };
export interface ConfigInWorker<TestArgs = {}, WorkerArgs = {}> {
projects: ProjectInWorker<TestArgs, WorkerArgs>[];
export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
projects: FullProject<TestArgs, WorkerArgs>[];
reporter: ReporterDescription[];
webServer: TestConfigWebServer | null;
}

View File

@ -14,20 +14,8 @@
* limitations under the License.
*/
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, ConfigInWorker } from './test';
export type { TestStatus } from './test';
type UseOptions<TestArgs, WorkerArgs> = Partial<WorkerArgs> & Partial<TestArgs>;
export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
projects: FullProject<TestArgs, WorkerArgs>[];
reporter: ReporterDescription[];
webServer: ConfigInWorker['webServer'];
}
export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
use: UseOptions<PlaywrightTestOptions & TestArgs, PlaywrightWorkerOptions & WorkerArgs>;
}
import type { TestStatus, Metadata, PlaywrightTestOptions, PlaywrightWorkerOptions, ReporterDescription, FullConfig, FullProject } from './test';
export type { FullConfig, FullProject, TestStatus } from './test';
/**
* Result of the full test run.