mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: move mount implementation to ct-core (#22506)
This commit is contained in:
parent
e7b9c08833
commit
ba8aed9dea
@ -4,3 +4,4 @@
|
|||||||
!LICENSE
|
!LICENSE
|
||||||
!cli.js
|
!cli.js
|
||||||
!lib/**
|
!lib/**
|
||||||
|
!types/**
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
"./cli": "./cli.js",
|
"./cli": "./cli.js",
|
||||||
|
"./lib/mount": "./lib/mount.js",
|
||||||
"./lib/vitePlugin": "./lib/vitePlugin.js"
|
"./lib/vitePlugin": "./lib/vitePlugin.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from '../types/test';
|
import type { Fixtures, Locator, Page, BrowserContextOptions, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, BrowserContext } from '@playwright/test';
|
||||||
import type { Component, JsxComponent, MountOptions } from '../types/experimentalComponent';
|
import type { Component, JsxComponent, MountOptions } from '../types/component';
|
||||||
import type { ContextReuseMode, FullConfigInternal } from './common/config';
|
import type { ContextReuseMode, FullConfigInternal } from '../../playwright-test/src/common/config';
|
||||||
|
|
||||||
let boundCallbacksForMount: Function[] = [];
|
let boundCallbacksForMount: Function[] = [];
|
||||||
|
|
2
packages/playwright-ct-react/hooks.d.ts
vendored
2
packages/playwright-ct-react/hooks.d.ts
vendored
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* 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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
|
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
|
||||||
|
2
packages/playwright-ct-react/index.d.ts
vendored
2
packages/playwright-ct-react/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import * as __pwReact from 'react';
|
import * as __pwReact from 'react';
|
||||||
import { createRoot as __pwCreateRoot } from 'react-dom/client';
|
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 */
|
/** @typedef {import('react').FunctionComponent} FrameworkComponent */
|
||||||
|
|
||||||
/** @type {Map<string, FrameworkComponent>} */
|
/** @type {Map<string, FrameworkComponent>} */
|
||||||
|
2
packages/playwright-ct-react17/hooks.d.ts
vendored
2
packages/playwright-ct-react17/hooks.d.ts
vendored
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* 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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
|
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
|
||||||
|
2
packages/playwright-ct-react17/index.d.ts
vendored
2
packages/playwright-ct-react17/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
import __pwReact from 'react';
|
import __pwReact from 'react';
|
||||||
import __pwReactDOM from 'react-dom';
|
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 */
|
/** @typedef {import('react').FunctionComponent} FrameworkComponent */
|
||||||
|
|
||||||
/** @type {Map<string, FrameworkComponent>} */
|
/** @type {Map<string, FrameworkComponent>} */
|
||||||
|
2
packages/playwright-ct-solid/hooks.d.ts
vendored
2
packages/playwright-ct-solid/hooks.d.ts
vendored
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { JSXElement } from "solid-js";
|
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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise<void | JSXElement>
|
callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise<void | JSXElement>
|
||||||
|
2
packages/playwright-ct-solid/index.d.ts
vendored
2
packages/playwright-ct-solid/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import { render as __pwSolidRender, createComponent as __pwSolidCreateComponent } from 'solid-js/web';
|
import { render as __pwSolidRender, createComponent as __pwSolidCreateComponent } from 'solid-js/web';
|
||||||
import __pwH from 'solid-js/h';
|
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 */
|
/** @typedef {() => import('solid-js').JSX.Element} FrameworkComponent */
|
||||||
|
|
||||||
/** @type {Map<string, FrameworkComponent>} */
|
/** @type {Map<string, FrameworkComponent>} */
|
||||||
|
2
packages/playwright-ct-svelte/hooks.d.ts
vendored
2
packages/playwright-ct-svelte/hooks.d.ts
vendored
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { SvelteComponent } from 'svelte';
|
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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>
|
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>
|
||||||
|
2
packages/playwright-ct-svelte/index.d.ts
vendored
2
packages/playwright-ct-svelte/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';
|
import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import { detach as __pwDetach, insert as __pwInsert, noop as __pwNoop } from 'svelte/internal';
|
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 {any} FrameworkComponent */
|
||||||
/** @typedef {import('svelte').SvelteComponent} SvelteComponent */
|
/** @typedef {import('svelte').SvelteComponent} SvelteComponent */
|
||||||
|
|
||||||
|
2
packages/playwright-ct-vue/hooks.d.ts
vendored
2
packages/playwright-ct-vue/hooks.d.ts
vendored
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { App, ComponentPublicInstance } from 'vue';
|
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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise<void>
|
callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise<void>
|
||||||
|
2
packages/playwright-ct-vue/index.d.ts
vendored
2
packages/playwright-ct-vue/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
2
packages/playwright-ct-vue2/hooks.d.ts
vendored
2
packages/playwright-ct-vue2/hooks.d.ts
vendored
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
import { ComponentOptions } from 'vue';
|
import { ComponentOptions } from 'vue';
|
||||||
import { CombinedVueInstance, Vue, VueConstructor } from 'vue/types/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>(
|
export declare function beforeMount<HooksConfig extends JsonObject>(
|
||||||
callback: (params: {
|
callback: (params: {
|
||||||
|
2
packages/playwright-ct-vue2/index.d.ts
vendored
2
packages/playwright-ct-vue2/index.d.ts
vendored
@ -23,7 +23,7 @@ import type {
|
|||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
Locator,
|
||||||
} from '@playwright/test';
|
} 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 { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/test');
|
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 path = require('path');
|
||||||
|
|
||||||
const plugin = () => {
|
const plugin = () => {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import __pwVue, { h as __pwH } from 'vue';
|
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 */
|
/** @typedef {import('vue').Component} FrameworkComponent */
|
||||||
|
|
||||||
/** @type {Map<string, FrameworkComponent>} */
|
/** @type {Map<string, FrameworkComponent>} */
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
"./lib/common/compilationCache": "./lib/common/compilationCache.js",
|
"./lib/common/compilationCache": "./lib/common/compilationCache.js",
|
||||||
"./lib/internalsForTest": "./lib/internalsForTest.js",
|
"./lib/internalsForTest": "./lib/internalsForTest.js",
|
||||||
"./lib/experimentalLoader": "./lib/experimentalLoader.js",
|
"./lib/experimentalLoader": "./lib/experimentalLoader.js",
|
||||||
"./lib/mount": "./lib/mount.js",
|
|
||||||
"./lib/plugins": "./lib/plugins/index.js",
|
"./lib/plugins": "./lib/plugins/index.js",
|
||||||
"./lib/util": "./lib/util.js",
|
"./lib/util": "./lib/util.js",
|
||||||
"./lib/utilsBundle": "./lib/utilsBundle.js",
|
"./lib/utilsBundle": "./lib/utilsBundle.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user