Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

feat: add name for plugins (#13826)

Ross Wollman45972a0b6acf
diff --git a/docs/src/test-api/class-testplugin.md b/docs/src/test-api/class-testplugin.md
index aa650cc614..dd464af016 100644
--- a/docs/src/test-api/class-testplugin.md
+++ b/docs/src/test-api/class-testplugin.md
@@ -1,6 +1,9 @@
# class: TestPlugin
* langs: js
+## property: TestPlugin.name
+- type: <[string]>
+
## optional async method: TestPlugin.configure
### param: TestPlugin.configure.config
- `config` <[TestConfig]>
diff --git a/packages/playwright-test/src/plugins/vitePlugin.ts b/packages/playwright-test/src/plugins/vitePlugin.ts
index 2a62491615..325210cc29 100644
--- a/packages/playwright-test/src/plugins/vitePlugin.ts
+++ b/packages/playwright-test/src/plugins/vitePlugin.ts
@@ -35,6 +35,8 @@ export function createPlugin(
const port = options.port || 3100;
let configDir: string;
return {
+ name: 'playwright-vite-plugin',
+
configure: async (config: PlaywrightTestConfig, configDirectory: string) => {
configDir = configDirectory;
const url = `http://localhost:${port}/playwright/index.html`;
diff --git a/packages/playwright-test/types/test.d.ts b/packages/playwright-test/types/test.d.ts
index 3088daf89d..8c6cf90304 100644
--- a/packages/playwright-test/types/test.d.ts
+++ b/packages/playwright-test/types/test.d.ts
@@ -3638,6 +3638,8 @@ export interface TestError {
}
export interface TestPlugin {
+ name: string;
+
/**
* @param config
* @param configDir
diff --git a/tests/config/experimental.d.ts b/tests/config/experimental.d.ts
index 0da9312926..2bb00c76b1 100644
--- a/tests/config/experimental.d.ts
+++ b/tests/config/experimental.d.ts
@@ -20091,6 +20091,8 @@ export interface TestError {
}
export interface TestPlugin {
+ name: string;
+
/**
* @param config
* @param configDir