@vitest/browser-playwright 4.0.0-beta.17 → 4.0.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +8 -12
  2. package/package.json +5 -6
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Page, Frame, FrameLocator, BrowserContext, LaunchOptions, ConnectOptions, BrowserContextOptions, Browser } from 'playwright';
2
- import { Protocol } from 'playwright-core/types/protocol';
3
- import { ScreenshotMatcherOptions, ScreenshotComparatorRegistry, Locator } from 'vitest/browser';
4
- import { BrowserProviderOption, BrowserProvider, BrowserModuleMocker, TestProject, CDPSession } from 'vitest/node';
1
+ import { CustomComparatorsRegistry } from '@vitest/browser';
5
2
  export { defineBrowserCommand } from '@vitest/browser';
3
+ import { Page, Frame, FrameLocator, BrowserContext, CDPSession, LaunchOptions, ConnectOptions, BrowserContextOptions, Browser } from 'playwright';
4
+ import { ScreenshotMatcherOptions, ScreenshotComparatorRegistry, Locator } from 'vitest/browser';
5
+ import { BrowserProviderOption, BrowserProvider, BrowserModuleMocker, TestProject, CDPSession as CDPSession$1 } from 'vitest/node';
6
6
 
7
7
  declare const playwrightBrowsers: readonly ["firefox", "webkit", "chromium"];
8
8
  type PlaywrightBrowser = (typeof playwrightBrowsers)[number];
@@ -62,7 +62,7 @@ declare class PlaywrightBrowserProvider implements BrowserProvider {
62
62
  private openBrowserPage;
63
63
  openPage(sessionId: string, url: string): Promise<void>;
64
64
  private _throwIfClosing;
65
- getCDPSession(sessionid: string): Promise<CDPSession>;
65
+ getCDPSession(sessionid: string): Promise<CDPSession$1>;
66
66
  close(): Promise<void>;
67
67
  }
68
68
  declare module "vitest/node" {
@@ -75,7 +75,7 @@ declare module "vitest/node" {
75
75
  interface _BrowserNames {
76
76
  playwright: PlaywrightBrowser;
77
77
  }
78
- interface ToMatchScreenshotOptions extends Omit<ScreenshotMatcherOptions, "comparatorName" | "comparatorOptions"> {}
78
+ interface ToMatchScreenshotOptions extends Omit<ScreenshotMatcherOptions, "comparatorName" | "comparatorOptions">, CustomComparatorsRegistry {}
79
79
  interface ToMatchScreenshotComparators extends ScreenshotComparatorRegistry {}
80
80
  }
81
81
  type PWHoverOptions = NonNullable<Parameters<Page["hover"]>[1]>;
@@ -86,6 +86,7 @@ type PWScreenshotOptions = NonNullable<Parameters<Page["screenshot"]>[0]>;
86
86
  type PWSelectOptions = NonNullable<Parameters<Page["selectOption"]>[2]>;
87
87
  type PWDragAndDropOptions = NonNullable<Parameters<Page["dragAndDrop"]>[2]>;
88
88
  type PWSetInputFiles = NonNullable<Parameters<Page["setInputFiles"]>[2]>;
89
+ type PWCDPSession = CDPSession;
89
90
  declare module "vitest/browser" {
90
91
  interface UserEventHoverOptions extends PWHoverOptions {}
91
92
  interface UserEventClickOptions extends PWClickOptions {}
@@ -98,12 +99,7 @@ declare module "vitest/browser" {
98
99
  interface ScreenshotOptions extends Omit<PWScreenshotOptions, "mask"> {
99
100
  mask?: ReadonlyArray<Element | Locator> | undefined;
100
101
  }
101
- interface CDPSession {
102
- send<T extends keyof Protocol.CommandParameters>(method: T, params?: Protocol.CommandParameters[T]): Promise<Protocol.CommandReturnValues[T]>;
103
- on<T extends keyof Protocol.Events>(event: T, listener: (payload: Protocol.Events[T]) => void): this;
104
- once<T extends keyof Protocol.Events>(event: T, listener: (payload: Protocol.Events[T]) => void): this;
105
- off<T extends keyof Protocol.Events>(event: T, listener: (payload: Protocol.Events[T]) => void): this;
106
- }
102
+ interface CDPSession extends PWCDPSession {}
107
103
  }
108
104
 
109
105
  export { PlaywrightBrowserProvider, playwright };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/browser-playwright",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.17",
4
+ "version": "4.0.0-beta.18",
5
5
  "description": "Browser running for Vitest using playwright",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -42,7 +42,7 @@
42
42
  ],
43
43
  "peerDependencies": {
44
44
  "playwright": "*",
45
- "vitest": "4.0.0-beta.17"
45
+ "vitest": "4.0.0-beta.18"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "playwright": {
@@ -51,13 +51,12 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "tinyrainbow": "^3.0.3",
54
- "@vitest/browser": "4.0.0-beta.17",
55
- "@vitest/mocker": "4.0.0-beta.17"
54
+ "@vitest/browser": "4.0.0-beta.18",
55
+ "@vitest/mocker": "4.0.0-beta.18"
56
56
  },
57
57
  "devDependencies": {
58
58
  "playwright": "^1.55.0",
59
- "playwright-core": "^1.55.0",
60
- "vitest": "4.0.0-beta.17"
59
+ "vitest": "4.0.0-beta.18"
61
60
  },
62
61
  "scripts": {
63
62
  "build": "premove dist && pnpm rollup -c",