export type ShardingMode

This commit is contained in:
Mathias Leppich 2024-09-09 16:20:44 +02:00
parent 0503672cfb
commit 4b3d75467a
4 changed files with 6 additions and 6 deletions

View file

@ -484,7 +484,7 @@ export default defineConfig({
## property: TestConfig.shardingMode
* since: v1.46
* since: v1.48
- type: ?<[ShardingMode]<"partition"|"round-robin"|"duration-round-robin">>
Defines the algorithm to be used for sharding. Defaults to `'partition'`.

View file

@ -17,7 +17,7 @@
import fs from 'fs';
import path from 'path';
import os from 'os';
import type { Config, Fixtures, PlaywrightTestConfig, Project, ReporterDescription } from '../../types/test';
import type { Config, Fixtures, ShardingMode, Project, ReporterDescription } from '../../types/test';
import type { Location } from '../../types/testReporter';
import type { TestRunnerPluginRegistration } from '../plugins';
import { getPackageJsonPath, mergeObjects } from '../util';
@ -56,7 +56,7 @@ export class FullConfigInternal {
cliFailOnFlakyTests?: boolean;
testIdMatcher?: Matcher;
defineConfigWasUsed = false;
shardingMode: Exclude<PlaywrightTestConfig['shardingMode'], undefined>;
shardingMode: ShardingMode;
lastRunFile: string | undefined;
lastRunInfo?: LastRunInfo;

View file

@ -1439,7 +1439,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
*
* Learn more about [sharding](https://playwright.dev/docs/test-sharding) with Playwright Test.
*/
shardingMode?: ShardingMode;
shardingMode?: "partition"|"round-robin"|"duration-round-robin";
/**
* **NOTE** Use
@ -5118,8 +5118,7 @@ export interface PlaywrightWorkerOptions {
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize };
}
export type ShardingMode = "partition" | "round-robin" | "duration-round-robin";
export type ShardingMode = Exclude<PlaywrightTestConfig['shardingMode'], undefined>;
export type ScreenshotMode = 'off' | 'on' | 'only-on-failure';
export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure';
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';

View file

@ -202,6 +202,7 @@ export interface PlaywrightWorkerOptions {
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize };
}
export type ShardingMode = Exclude<PlaywrightTestConfig['shardingMode'], undefined>;
export type ScreenshotMode = 'off' | 'on' | 'only-on-failure';
export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure';
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry';