Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: move mount implementation to ct-core (#22506)
Pavel Feldmanba8aed9dea7c
diff --git a/packages/playwright-ct-core/.npmignore b/packages/playwright-ct-core/.npmignoreindex 19509990b8..d3d3dc5a76 100644--- a/packages/playwright-ct-core/.npmignore+++ b/packages/playwright-ct-core/.npmignore@@ -4,3 +4,4 @@!LICENSE!cli.js!lib/**+!types/**diff --git a/packages/playwright-ct-core/package.json b/packages/playwright-ct-core/package.jsonindex 88ba6f0af8..1f96800c90 100644--- a/packages/playwright-ct-core/package.json+++ b/packages/playwright-ct-core/package.json@@ -13,6 +13,7 @@"license": "Apache-2.0","exports": {"./cli": "./cli.js",+ "./lib/mount": "./lib/mount.js","./lib/vitePlugin": "./lib/vitePlugin.js"},"dependencies": {diff --git a/packages/playwright-test/src/mount.ts b/packages/playwright-ct-core/src/mount.tssimilarity index 97%rename from packages/playwright-test/src/mount.tsrename to packages/playwright-ct-core/src/mount.tsindex 609f7bd38f..fbdc133fff 100644--- a/packages/playwright-test/src/mount.ts+++ b/packages/playwright-ct-core/src/mount.ts@@ -14,9 +14,9 @@* limitations under the License.*/-import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from '../types/test';-import type { Component, JsxComponent, MountOptions } from '../types/experimentalComponent';-import type { ContextReuseMode, FullConfigInternal } from './common/config';+import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from '@playwright/test';+import type { Component, JsxComponent, MountOptions } from '../types/component';+import type { ContextReuseMode, FullConfigInternal } from '../../playwright-test/src/common/config';let boundCallbacksForMount: Function[] = [];diff --git a/packages/playwright-test/types/experimentalComponent.d.ts b/packages/playwright-ct-core/types/component.d.tssimilarity index 100%rename from packages/playwright-test/types/experimentalComponent.d.tsrename to packages/playwright-ct-core/types/component.d.tsdiff --git a/packages/playwright-ct-react/hooks.d.ts b/packages/playwright-ct-react/hooks.d.tsindex 658146662c..0fa7cf3e1a 100644--- a/packages/playwright-ct-react/hooks.d.ts+++ b/packages/playwright-ct-react/hooks.d.ts@@ -14,7 +14,7 @@* limitations under the License.*/-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>diff --git a/packages/playwright-ct-react/index.d.ts b/packages/playwright-ct-react/index.d.tsindex 3835c7cd44..e7717c9b68 100644--- a/packages/playwright-ct-react/index.d.ts+++ b/packages/playwright-ct-react/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {diff --git a/packages/playwright-ct-react/index.js b/packages/playwright-ct-react/index.jsindex 0d2641d9eb..7ec0f6b567 100644--- a/packages/playwright-ct-react/index.js+++ b/packages/playwright-ct-react/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-react/registerSource.mjs b/packages/playwright-ct-react/registerSource.mjsindex 0ba05eebef..d3c7cda8fe 100644--- a/packages/playwright-ct-react/registerSource.mjs+++ b/packages/playwright-ct-react/registerSource.mjs@@ -20,7 +20,7 @@import * as __pwReact from 'react';import { createRoot as __pwCreateRoot } from 'react-dom/client';-/** @typedef {import('../playwright-test/types/experimentalComponent').Component} Component */+/** @typedef {import('../playwright-ct-core/types/component').Component} Component *//** @typedef {import('react').FunctionComponent} FrameworkComponent *//** @type {Map<string, FrameworkComponent>} */diff --git a/packages/playwright-ct-react17/hooks.d.ts b/packages/playwright-ct-react17/hooks.d.tsindex 658146662c..0fa7cf3e1a 100644--- a/packages/playwright-ct-react17/hooks.d.ts+++ b/packages/playwright-ct-react17/hooks.d.ts@@ -14,7 +14,7 @@* limitations under the License.*/-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>diff --git a/packages/playwright-ct-react17/index.d.ts b/packages/playwright-ct-react17/index.d.tsindex 3835c7cd44..e7717c9b68 100644--- a/packages/playwright-ct-react17/index.d.ts+++ b/packages/playwright-ct-react17/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {diff --git a/packages/playwright-ct-react17/index.js b/packages/playwright-ct-react17/index.jsindex 0d2641d9eb..7ec0f6b567 100644--- a/packages/playwright-ct-react17/index.js+++ b/packages/playwright-ct-react17/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-react17/registerSource.mjs b/packages/playwright-ct-react17/registerSource.mjsindex 3ffcf0c5ba..e77a546038 100644--- a/packages/playwright-ct-react17/registerSource.mjs+++ b/packages/playwright-ct-react17/registerSource.mjs@@ -21,7 +21,7 @@import __pwReact from 'react';import __pwReactDOM from 'react-dom';-/** @typedef {import('../playwright-test/types/experimentalComponent').Component} Component */+/** @typedef {import('../playwright-ct-core/types/component').Component} Component *//** @typedef {import('react').FunctionComponent} FrameworkComponent *//** @type {Map<string, FrameworkComponent>} */diff --git a/packages/playwright-ct-solid/hooks.d.ts b/packages/playwright-ct-solid/hooks.d.tsindex a3c357085c..38d483ec6d 100644--- a/packages/playwright-ct-solid/hooks.d.ts+++ b/packages/playwright-ct-solid/hooks.d.ts@@ -15,7 +15,7 @@*/import { JSXElement } from "solid-js";-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise<void | JSXElement>diff --git a/packages/playwright-ct-solid/index.d.ts b/packages/playwright-ct-solid/index.d.tsindex 3835c7cd44..e7717c9b68 100644--- a/packages/playwright-ct-solid/index.d.ts+++ b/packages/playwright-ct-solid/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {diff --git a/packages/playwright-ct-solid/index.js b/packages/playwright-ct-solid/index.jsindex 9724316de6..6d81c3b0ea 100644--- a/packages/playwright-ct-solid/index.js+++ b/packages/playwright-ct-solid/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-solid/registerSource.mjs b/packages/playwright-ct-solid/registerSource.mjsindex cfa6f390da..426c414038 100644--- a/packages/playwright-ct-solid/registerSource.mjs+++ b/packages/playwright-ct-solid/registerSource.mjs@@ -20,7 +20,7 @@import { render as __pwSolidRender, createComponent as __pwSolidCreateComponent } from 'solid-js/web';import __pwH from 'solid-js/h';-/** @typedef {import('../playwright-test/types/experimentalComponent').Component} Component */+/** @typedef {import('../playwright-ct-core/types/component').Component} Component *//** @typedef {() => import('solid-js').JSX.Element} FrameworkComponent *//** @type {Map<string, FrameworkComponent>} */diff --git a/packages/playwright-ct-svelte/hooks.d.ts b/packages/playwright-ct-svelte/hooks.d.tsindex 0a086825c4..bcad0538d0 100644--- a/packages/playwright-ct-svelte/hooks.d.ts+++ b/packages/playwright-ct-svelte/hooks.d.ts@@ -15,7 +15,7 @@*/import type { SvelteComponent } from 'svelte';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>diff --git a/packages/playwright-ct-svelte/index.d.ts b/packages/playwright-ct-svelte/index.d.tsindex 55e0e24911..65f4cc85fe 100644--- a/packages/playwright-ct-svelte/index.d.ts+++ b/packages/playwright-ct-svelte/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';diff --git a/packages/playwright-ct-svelte/index.js b/packages/playwright-ct-svelte/index.jsindex 507f968420..d315751c05 100644--- a/packages/playwright-ct-svelte/index.js+++ b/packages/playwright-ct-svelte/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-svelte/registerSource.mjs b/packages/playwright-ct-svelte/registerSource.mjsindex 0fbb392b6c..99f6dcf1c7 100644--- a/packages/playwright-ct-svelte/registerSource.mjs+++ b/packages/playwright-ct-svelte/registerSource.mjs@@ -20,7 +20,7 @@import { detach as __pwDetach, insert as __pwInsert, noop as __pwNoop } from 'svelte/internal';-/** @typedef {import('../playwright-test/types/experimentalComponent').Component} Component */+/** @typedef {import('../playwright-ct-core/types/component').Component} Component *//** @typedef {any} FrameworkComponent *//** @typedef {import('svelte').SvelteComponent} SvelteComponent */diff --git a/packages/playwright-ct-vue/hooks.d.ts b/packages/playwright-ct-vue/hooks.d.tsindex 19ec4cb41e..2a18496007 100644--- a/packages/playwright-ct-vue/hooks.d.ts+++ b/packages/playwright-ct-vue/hooks.d.ts@@ -15,7 +15,7 @@*/import type { App, ComponentPublicInstance } from 'vue';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise<void>diff --git a/packages/playwright-ct-vue/index.d.ts b/packages/playwright-ct-vue/index.d.tsindex 6bcdc5706b..f992773bee 100644--- a/packages/playwright-ct-vue/index.d.ts+++ b/packages/playwright-ct-vue/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {diff --git a/packages/playwright-ct-vue/index.js b/packages/playwright-ct-vue/index.jsindex bc55b04ef3..b56283bff8 100644--- a/packages/playwright-ct-vue/index.js+++ b/packages/playwright-ct-vue/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-vue2/hooks.d.ts b/packages/playwright-ct-vue2/hooks.d.tsindex a8c16dddcc..4c3a391117 100644--- a/packages/playwright-ct-vue2/hooks.d.ts+++ b/packages/playwright-ct-vue2/hooks.d.ts@@ -16,7 +16,7 @@import { ComponentOptions } from 'vue';import { CombinedVueInstance, Vue, VueConstructor } from 'vue/types/vue';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';export declare function beforeMount<HooksConfig extends JsonObject>(callback: (params: {diff --git a/packages/playwright-ct-vue2/index.d.ts b/packages/playwright-ct-vue2/index.d.tsindex a9cb47a132..08046733c5 100644--- a/packages/playwright-ct-vue2/index.d.ts+++ b/packages/playwright-ct-vue2/index.d.ts@@ -23,7 +23,7 @@ import type {PlaywrightWorkerOptions,Locator,} from '@playwright/test';-import type { JsonObject } from '@playwright/test/types/experimentalComponent';+import type { JsonObject } from '@playwright/experimental-ct-core/types/component';import type { InlineConfig } from 'vite';export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {diff --git a/packages/playwright-ct-vue2/index.js b/packages/playwright-ct-vue2/index.jsindex 6122b97526..19e0b9d318 100644--- a/packages/playwright-ct-vue2/index.js+++ b/packages/playwright-ct-vue2/index.js@@ -15,7 +15,7 @@*/const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');-const { fixtures } = require('@playwright/test/lib/mount');+const { fixtures } = require('@playwright/experimental-ct-core/lib/mount');const path = require('path');const plugin = () => {diff --git a/packages/playwright-ct-vue2/registerSource.mjs b/packages/playwright-ct-vue2/registerSource.mjsindex fd8a2d063d..54bd466090 100644--- a/packages/playwright-ct-vue2/registerSource.mjs+++ b/packages/playwright-ct-vue2/registerSource.mjs@@ -20,7 +20,7 @@import __pwVue, { h as __pwH } from 'vue';-/** @typedef {import('../playwright-test/types/experimentalComponent').Component} Component */+/** @typedef {import('../playwright-ct-core/types/component').Component} Component *//** @typedef {import('vue').Component} FrameworkComponent *//** @type {Map<string, FrameworkComponent>} */diff --git a/packages/playwright-test/package.json b/packages/playwright-test/package.jsonindex 3d823e84fc..e983951304 100644--- a/packages/playwright-test/package.json+++ b/packages/playwright-test/package.json@@ -22,7 +22,6 @@"./lib/common/compilationCache": "./lib/common/compilationCache.js","./lib/internalsForTest": "./lib/internalsForTest.js","./lib/experimentalLoader": "./lib/experimentalLoader.js",- "./lib/mount": "./lib/mount.js","./lib/plugins": "./lib/plugins/index.js","./lib/util": "./lib/util.js","./lib/utilsBundle": "./lib/utilsBundle.js",