@voidzero-dev/vite-plus-test 0.0.0-0bfcc90f.20260209-0731
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.
- package/LICENSE.md +691 -0
- package/browser/context.d.ts +4 -0
- package/browser/context.js +20 -0
- package/config.d.ts +3 -0
- package/coverage.d.ts +1 -0
- package/dist/@vitest/browser/client/.vite/manifest.json +24 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/@vitest/browser/client/__vitest__/bg.png +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.svg +5 -0
- package/dist/@vitest/browser/client/__vitest__/index.html +32 -0
- package/dist/@vitest/browser/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/@vitest/browser/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/@vitest/browser/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/@vitest/browser/client/error-catcher.js +82 -0
- package/dist/@vitest/browser/client/esm-client-injector.js +67 -0
- package/dist/@vitest/browser/client/favicon.svg +5 -0
- package/dist/@vitest/browser/client/orchestrator.html +35 -0
- package/dist/@vitest/browser/client/tester/tester.html +13 -0
- package/dist/@vitest/browser/client.js +456 -0
- package/dist/@vitest/browser/context.d.ts +792 -0
- package/dist/@vitest/browser/context.js +541 -0
- package/dist/@vitest/browser/expect-element.js +32 -0
- package/dist/@vitest/browser/index-D6m36C6U.js +11 -0
- package/dist/@vitest/browser/index.d.ts +73 -0
- package/dist/@vitest/browser/index.js +3513 -0
- package/dist/@vitest/browser/jest-dom.d.ts +724 -0
- package/dist/@vitest/browser/locators.d.ts +354 -0
- package/dist/@vitest/browser/locators.js +1 -0
- package/dist/@vitest/browser/matchers.d.ts +29 -0
- package/dist/@vitest/browser/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/@vitest/browser/state.js +280 -0
- package/dist/@vitest/browser/types.d.ts +69 -0
- package/dist/@vitest/browser-playwright/context.d.ts +1 -0
- package/dist/@vitest/browser-playwright/index.d.ts +106 -0
- package/dist/@vitest/browser-playwright/index.js +1111 -0
- package/dist/@vitest/browser-playwright/locators.js +114 -0
- package/dist/@vitest/browser-preview/context.d.ts +1 -0
- package/dist/@vitest/browser-preview/index.d.ts +19 -0
- package/dist/@vitest/browser-preview/index.js +148 -0
- package/dist/@vitest/browser-preview/locators.js +79 -0
- package/dist/@vitest/browser-webdriverio/context.d.ts +1 -0
- package/dist/@vitest/browser-webdriverio/index.d.ts +63 -0
- package/dist/@vitest/browser-webdriverio/index.js +600 -0
- package/dist/@vitest/browser-webdriverio/locators.js +163 -0
- package/dist/@vitest/expect/index.d.ts +807 -0
- package/dist/@vitest/expect/index.js +1875 -0
- package/dist/@vitest/mocker/auto-register.d.ts +2 -0
- package/dist/@vitest/mocker/auto-register.js +9 -0
- package/dist/@vitest/mocker/automock.d.ts +12 -0
- package/dist/@vitest/mocker/automock.js +1 -0
- package/dist/@vitest/mocker/browser.d.ts +53 -0
- package/dist/@vitest/mocker/browser.js +91 -0
- package/dist/@vitest/mocker/chunk-automock.js +354 -0
- package/dist/@vitest/mocker/chunk-interceptor-native.js +15 -0
- package/dist/@vitest/mocker/chunk-mocker.js +521 -0
- package/dist/@vitest/mocker/chunk-pathe.M-eThtNZ.js +174 -0
- package/dist/@vitest/mocker/chunk-registry.js +185 -0
- package/dist/@vitest/mocker/chunk-utils.js +16 -0
- package/dist/@vitest/mocker/index.d-C-sLYZi-.d.ts +25 -0
- package/dist/@vitest/mocker/index.d.ts +2 -0
- package/dist/@vitest/mocker/index.js +185 -0
- package/dist/@vitest/mocker/mocker.d-TnKRhz7N.d.ts +81 -0
- package/dist/@vitest/mocker/node.d.ts +800 -0
- package/dist/@vitest/mocker/node.js +966 -0
- package/dist/@vitest/mocker/redirect.d.ts +3 -0
- package/dist/@vitest/mocker/redirect.js +79 -0
- package/dist/@vitest/mocker/register.d.ts +9 -0
- package/dist/@vitest/mocker/register.js +41 -0
- package/dist/@vitest/mocker/types.d-B8CCKmHt.d.ts +107 -0
- package/dist/@vitest/pretty-format/index.d.ts +124 -0
- package/dist/@vitest/pretty-format/index.js +1022 -0
- package/dist/@vitest/runner/chunk-tasks.js +340 -0
- package/dist/@vitest/runner/index.d.ts +180 -0
- package/dist/@vitest/runner/index.js +2114 -0
- package/dist/@vitest/runner/tasks.d-C7UxawJ9.d.ts +834 -0
- package/dist/@vitest/runner/types.d.ts +183 -0
- package/dist/@vitest/runner/types.js +1 -0
- package/dist/@vitest/runner/utils.d.ts +45 -0
- package/dist/@vitest/runner/utils.js +5 -0
- package/dist/@vitest/snapshot/environment.d-DHdQ1Csl.d.ts +22 -0
- package/dist/@vitest/snapshot/environment.d.ts +16 -0
- package/dist/@vitest/snapshot/environment.js +40 -0
- package/dist/@vitest/snapshot/index.d.ts +130 -0
- package/dist/@vitest/snapshot/index.js +1437 -0
- package/dist/@vitest/snapshot/manager.d.ts +18 -0
- package/dist/@vitest/snapshot/manager.js +73 -0
- package/dist/@vitest/snapshot/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
- package/dist/@vitest/spy/index.d.ts +384 -0
- package/dist/@vitest/spy/index.js +433 -0
- package/dist/@vitest/utils/chunk-_commonjsHelpers.js +5 -0
- package/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +156 -0
- package/dist/@vitest/utils/constants.d.ts +21 -0
- package/dist/@vitest/utils/constants.js +49 -0
- package/dist/@vitest/utils/diff.d.ts +93 -0
- package/dist/@vitest/utils/diff.js +2199 -0
- package/dist/@vitest/utils/display.d.ts +29 -0
- package/dist/@vitest/utils/display.js +742 -0
- package/dist/@vitest/utils/error.d.ts +7 -0
- package/dist/@vitest/utils/error.js +42 -0
- package/dist/@vitest/utils/helpers.d.ts +73 -0
- package/dist/@vitest/utils/helpers.js +295 -0
- package/dist/@vitest/utils/highlight.d.ts +9 -0
- package/dist/@vitest/utils/highlight.js +538 -0
- package/dist/@vitest/utils/index.d.ts +5 -0
- package/dist/@vitest/utils/index.js +1 -0
- package/dist/@vitest/utils/offset.d.ts +5 -0
- package/dist/@vitest/utils/offset.js +32 -0
- package/dist/@vitest/utils/resolver.d.ts +7 -0
- package/dist/@vitest/utils/resolver.js +71 -0
- package/dist/@vitest/utils/serialize.d.ts +3 -0
- package/dist/@vitest/utils/serialize.js +118 -0
- package/dist/@vitest/utils/source-map.d.ts +55 -0
- package/dist/@vitest/utils/source-map.js +478 -0
- package/dist/@vitest/utils/timers.d.ts +33 -0
- package/dist/@vitest/utils/timers.js +49 -0
- package/dist/@vitest/utils/types.d-BCElaP-c.d.ts +53 -0
- package/dist/@vitest/utils/types.d.ts +34 -0
- package/dist/@vitest/utils/types.js +1 -0
- package/dist/browser-compat.js +3 -0
- package/dist/browser.d.ts +46 -0
- package/dist/browser.js +20 -0
- package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
- package/dist/chunks/base.CJ0Y4ePK.js +165 -0
- package/dist/chunks/benchmark.B3N2zMcH.js +40 -0
- package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +24 -0
- package/dist/chunks/browser.d.ChKACdzH.d.ts +59 -0
- package/dist/chunks/cac.DVeoLl0M.js +1409 -0
- package/dist/chunks/cli-api.B7PN_QUv.js +13672 -0
- package/dist/chunks/config.d.Cy95HiCx.d.ts +210 -0
- package/dist/chunks/console.Cf-YriPC.js +146 -0
- package/dist/chunks/constants.D_Q9UYh-.js +36 -0
- package/dist/chunks/coverage.AVPTjMgw.js +3292 -0
- package/dist/chunks/coverage.D_JHT54q.js +25 -0
- package/dist/chunks/coverage.d.BZtK59WP.d.ts +37 -0
- package/dist/chunks/creator.DAmOKTvJ.js +673 -0
- package/dist/chunks/date.Bq6ZW5rf.js +73 -0
- package/dist/chunks/defaults.BOqNVLsY.js +74 -0
- package/dist/chunks/env.D4Lgay0q.js +8 -0
- package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
- package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
- package/dist/chunks/git.Bm2pzPAa.js +71 -0
- package/dist/chunks/global.d.B15mdLcR.d.ts +99 -0
- package/dist/chunks/globals.DOayXfHP.js +30 -0
- package/dist/chunks/index.6Qv1eEA6.js +109 -0
- package/dist/chunks/index.C5r1PdPD.js +231 -0
- package/dist/chunks/index.Chj8NDwU.js +206 -0
- package/dist/chunks/index.CyBMJtT7.js +727 -0
- package/dist/chunks/index.D3XRDfWc.js +213 -0
- package/dist/chunks/index.D4KonVSU.js +6343 -0
- package/dist/chunks/index.M8mOzt4Y.js +3839 -0
- package/dist/chunks/index.Z5E_ObnR.js +37 -0
- package/dist/chunks/init-forks._y3TW739.js +41 -0
- package/dist/chunks/init-threads.DBO2kn-p.js +18 -0
- package/dist/chunks/init.B6MLFIaN.js +334 -0
- package/dist/chunks/inspector.CvyFGlXm.js +53 -0
- package/dist/chunks/modules.BJuCwlRJ.js +36 -0
- package/dist/chunks/node.Ce0vMQM7.js +14 -0
- package/dist/chunks/plugin.d.CtqpEehP.d.ts +38 -0
- package/dist/chunks/reporters.d.CWXNI2jG.d.ts +3271 -0
- package/dist/chunks/rpc.BoxB0q7B.js +76 -0
- package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
- package/dist/chunks/setup-common.Cm-kSBVi.js +60 -0
- package/dist/chunks/startModuleRunner.DEj0jb3e.js +861 -0
- package/dist/chunks/suite.d.BJWk38HB.d.ts +10 -0
- package/dist/chunks/test.B8ej_ZHS.js +254 -0
- package/dist/chunks/traces.CCmnQaNT.js +217 -0
- package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
- package/dist/chunks/utils.DvEY5TfP.js +52 -0
- package/dist/chunks/vi.2VT5v0um.js +3919 -0
- package/dist/chunks/vm.D3epNOPZ.js +744 -0
- package/dist/chunks/worker.d.Dyxm8DEL.d.ts +255 -0
- package/dist/cli.js +28 -0
- package/dist/client/.vite/manifest.json +24 -0
- package/dist/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/client/__vitest__/bg.png +0 -0
- package/dist/client/__vitest__/favicon.ico +0 -0
- package/dist/client/__vitest__/favicon.svg +5 -0
- package/dist/client/__vitest__/index.html +32 -0
- package/dist/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/client/error-catcher.js +82 -0
- package/dist/client/esm-client-injector.js +67 -0
- package/dist/client/favicon.svg +5 -0
- package/dist/client/orchestrator.html +35 -0
- package/dist/client/tester/tester.html +13 -0
- package/dist/client.js +456 -0
- package/dist/config.cjs +94 -0
- package/dist/config.d.ts +104 -0
- package/dist/config.js +15 -0
- package/dist/context.js +541 -0
- package/dist/coverage.d.ts +118 -0
- package/dist/coverage.js +23 -0
- package/dist/dummy.js +2 -0
- package/dist/environments.d.ts +22 -0
- package/dist/environments.js +3 -0
- package/dist/expect-element.js +27 -0
- package/dist/index-D6m36C6U.js +6 -0
- package/dist/index-node.js +7 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +19 -0
- package/dist/locators.d.ts +354 -0
- package/dist/locators.js +1 -0
- package/dist/mocker.d.ts +1 -0
- package/dist/mocker.js +1 -0
- package/dist/module-evaluator.d.ts +124 -0
- package/dist/module-evaluator.js +343 -0
- package/dist/module-runner-stub.js +44 -0
- package/dist/module-runner.js +17 -0
- package/dist/node.d.ts +251 -0
- package/dist/node.js +98 -0
- package/dist/path.js +7 -0
- package/dist/plugins/browser-client.mjs +2 -0
- package/dist/plugins/browser-context.mjs +2 -0
- package/dist/plugins/browser-locators.mjs +2 -0
- package/dist/plugins/browser-playwright.mjs +2 -0
- package/dist/plugins/browser-preview.mjs +2 -0
- package/dist/plugins/browser-webdriverio.mjs +2 -0
- package/dist/plugins/browser.mjs +2 -0
- package/dist/plugins/expect.mjs +2 -0
- package/dist/plugins/mocker-automock.mjs +2 -0
- package/dist/plugins/mocker-browser.mjs +2 -0
- package/dist/plugins/mocker-node.mjs +2 -0
- package/dist/plugins/mocker-redirect.mjs +2 -0
- package/dist/plugins/mocker-register.mjs +2 -0
- package/dist/plugins/mocker.mjs +2 -0
- package/dist/plugins/pretty-format.mjs +2 -0
- package/dist/plugins/runner-types.mjs +2 -0
- package/dist/plugins/runner-utils.mjs +2 -0
- package/dist/plugins/runner.mjs +2 -0
- package/dist/plugins/snapshot-environment.mjs +2 -0
- package/dist/plugins/snapshot-manager.mjs +2 -0
- package/dist/plugins/snapshot.mjs +2 -0
- package/dist/plugins/spy.mjs +2 -0
- package/dist/plugins/utils-constants.mjs +2 -0
- package/dist/plugins/utils-diff.mjs +2 -0
- package/dist/plugins/utils-display.mjs +2 -0
- package/dist/plugins/utils-error.mjs +2 -0
- package/dist/plugins/utils-helpers.mjs +2 -0
- package/dist/plugins/utils-highlight.mjs +2 -0
- package/dist/plugins/utils-offset.mjs +2 -0
- package/dist/plugins/utils-resolver.mjs +2 -0
- package/dist/plugins/utils-serialize.mjs +2 -0
- package/dist/plugins/utils-source-map.mjs +2 -0
- package/dist/plugins/utils-timers.mjs +2 -0
- package/dist/plugins/utils.mjs +2 -0
- package/dist/reporters.d.ts +27 -0
- package/dist/reporters.js +24 -0
- package/dist/runners.d.ts +50 -0
- package/dist/runners.js +19 -0
- package/dist/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/snapshot.d.ts +9 -0
- package/dist/snapshot.js +4 -0
- package/dist/spy.js +1 -0
- package/dist/state.js +280 -0
- package/dist/suite.d.ts +5 -0
- package/dist/suite.js +6 -0
- package/dist/types.d.ts +69 -0
- package/dist/vendor/chai.d.mts +1 -0
- package/dist/vendor/chai.mjs +3577 -0
- package/dist/vendor/es-module-lexer.d.mts +193 -0
- package/dist/vendor/es-module-lexer.mjs +79 -0
- package/dist/vendor/estree-walker.d.mts +583 -0
- package/dist/vendor/estree-walker.mjs +339 -0
- package/dist/vendor/expect-type.d.mts +1574 -0
- package/dist/vendor/expect-type.mjs +214 -0
- package/dist/vendor/magic-string.d.mts +261 -0
- package/dist/vendor/magic-string.mjs +1700 -0
- package/dist/vendor/obug.d.mts +56 -0
- package/dist/vendor/obug.mjs +276 -0
- package/dist/vendor/pathe.d.mts +46 -0
- package/dist/vendor/pathe.mjs +496 -0
- package/dist/vendor/picomatch.d.mts +1 -0
- package/dist/vendor/picomatch.mjs +1855 -0
- package/dist/vendor/shared-3g9mwCWP.mjs +31 -0
- package/dist/vendor/std-env.d.mts +88 -0
- package/dist/vendor/std-env.mjs +159 -0
- package/dist/vendor/tinybench.d.mts +317 -0
- package/dist/vendor/tinybench.mjs +504 -0
- package/dist/vendor/tinyexec.d.mts +72 -0
- package/dist/vendor/tinyexec.mjs +637 -0
- package/dist/vendor/tinyglobby.d.mts +157 -0
- package/dist/vendor/tinyglobby.mjs +832 -0
- package/dist/vendor/tinyrainbow.d.mts +60 -0
- package/dist/vendor/tinyrainbow.mjs +93 -0
- package/dist/vendor/vitest_browser.mjs +2 -0
- package/dist/vendor/vitest_internal_browser.mjs +2 -0
- package/dist/vendor/vitest_runner.mjs +2 -0
- package/dist/vendor/vitest_runners.mjs +2 -0
- package/dist/worker.d.ts +32 -0
- package/dist/worker.js +48 -0
- package/dist/workers/forks.js +54 -0
- package/dist/workers/runVmTests.js +95 -0
- package/dist/workers/threads.js +55 -0
- package/dist/workers/vmForks.js +36 -0
- package/dist/workers/vmThreads.js +37 -0
- package/environments.d.ts +1 -0
- package/globals.d.ts +20 -0
- package/import-meta.d.ts +5 -0
- package/importMeta.d.ts +4 -0
- package/index.cjs +5 -0
- package/index.d.cts +1 -0
- package/jsdom.d.ts +6 -0
- package/mocker.d.ts +1 -0
- package/node.d.ts +1 -0
- package/optional-types.d.ts +7 -0
- package/package.json +335 -0
- package/reporters.d.ts +1 -0
- package/runners.d.ts +1 -0
- package/snapshot.d.ts +1 -0
- package/suite.d.ts +1 -0
- package/suppress-warnings.cjs +21 -0
- package/vitest.mjs +2 -0
- package/worker.d.ts +1 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { MockedModuleSerialized, ServerIdResolution, ServerMockResolution } from '../mocker/index.js';
|
|
2
|
+
import type { TaskEventPack, TaskResultPack, TestArtifact } from '../runner/index.js';
|
|
3
|
+
import type { BirpcReturn } from "birpc";
|
|
4
|
+
import type { AfterSuiteRunMeta, BrowserTesterOptions, CancelReason, RunnerTestFile, SerializedTestSpecification, SnapshotResult, TestExecutionMethod, UserConsoleLog } from '../../index.js';
|
|
5
|
+
export interface WebSocketBrowserHandlers {
|
|
6
|
+
resolveSnapshotPath: (testPath: string) => string;
|
|
7
|
+
resolveSnapshotRawPath: (testPath: string, rawPath: string) => string;
|
|
8
|
+
onUnhandledError: (error: unknown, type: string) => Promise<void>;
|
|
9
|
+
onQueued: (method: TestExecutionMethod, file: RunnerTestFile) => void;
|
|
10
|
+
onCollected: (method: TestExecutionMethod, files: RunnerTestFile[]) => Promise<void>;
|
|
11
|
+
onTaskArtifactRecord: <Artifact extends TestArtifact>(testId: string, artifact: Artifact) => Promise<Artifact>;
|
|
12
|
+
onTaskUpdate: (method: TestExecutionMethod, packs: TaskResultPack[], events: TaskEventPack[]) => void;
|
|
13
|
+
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
14
|
+
cancelCurrentRun: (reason: CancelReason) => void;
|
|
15
|
+
getCountOfFailedTests: () => number;
|
|
16
|
+
readSnapshotFile: (id: string) => Promise<string | null>;
|
|
17
|
+
saveSnapshotFile: (id: string, content: string) => Promise<void>;
|
|
18
|
+
removeSnapshotFile: (id: string) => Promise<void>;
|
|
19
|
+
sendLog: (method: TestExecutionMethod, log: UserConsoleLog) => void;
|
|
20
|
+
snapshotSaved: (snapshot: SnapshotResult) => void;
|
|
21
|
+
debug: (...args: string[]) => void;
|
|
22
|
+
resolveId: (id: string, importer?: string) => Promise<ServerIdResolution | null>;
|
|
23
|
+
triggerCommand: <T>(sessionId: string, command: string, testPath: string | undefined, payload: unknown[]) => Promise<T>;
|
|
24
|
+
resolveMock: (id: string, importer: string, options: {
|
|
25
|
+
mock: "spy" | "factory" | "auto";
|
|
26
|
+
}) => Promise<ServerMockResolution>;
|
|
27
|
+
invalidate: (ids: string[]) => void;
|
|
28
|
+
getBrowserFileSourceMap: (id: string) => SourceMap | null | {
|
|
29
|
+
mappings: "";
|
|
30
|
+
} | undefined;
|
|
31
|
+
wdioSwitchContext: (direction: "iframe" | "parent") => void;
|
|
32
|
+
registerMock: (sessionId: string, mock: MockedModuleSerialized) => void;
|
|
33
|
+
unregisterMock: (sessionId: string, id: string) => void;
|
|
34
|
+
clearMocks: (sessionId: string) => void;
|
|
35
|
+
sendCdpEvent: (sessionId: string, event: string, payload?: Record<string, unknown>) => unknown;
|
|
36
|
+
trackCdpEvent: (sessionId: string, type: "on" | "once" | "off", event: string, listenerId: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export type Awaitable<T> = T | PromiseLike<T>;
|
|
39
|
+
export interface WebSocketEvents {
|
|
40
|
+
onCollected?: (files: RunnerTestFile[]) => Awaitable<void>;
|
|
41
|
+
onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable<void>;
|
|
42
|
+
onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;
|
|
43
|
+
onPathsCollected?: (paths?: string[]) => Awaitable<void>;
|
|
44
|
+
onSpecsCollected?: (specs?: SerializedTestSpecification[]) => Awaitable<void>;
|
|
45
|
+
onFinishedReportCoverage: () => void;
|
|
46
|
+
}
|
|
47
|
+
export interface WebSocketBrowserEvents {
|
|
48
|
+
onCancel: (reason: CancelReason) => void;
|
|
49
|
+
createTesters: (options: BrowserTesterOptions) => Promise<void>;
|
|
50
|
+
cleanupTesters: () => Promise<void>;
|
|
51
|
+
cdpEvent: (event: string, payload: unknown) => void;
|
|
52
|
+
resolveManualMock: (url: string) => Promise<{
|
|
53
|
+
url: string;
|
|
54
|
+
keys: string[];
|
|
55
|
+
responseId: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export type WebSocketBrowserRPC = BirpcReturn<WebSocketBrowserEvents, WebSocketBrowserHandlers>;
|
|
59
|
+
interface SourceMap {
|
|
60
|
+
file: string;
|
|
61
|
+
mappings: string;
|
|
62
|
+
names: string[];
|
|
63
|
+
sources: string[];
|
|
64
|
+
sourcesContent?: string[];
|
|
65
|
+
version: number;
|
|
66
|
+
toString: () => string;
|
|
67
|
+
toUrl: () => string;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../browser/context.js'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { CustomComparatorsRegistry } from '../browser/index.js';
|
|
2
|
+
export { defineBrowserCommand } from '../browser/index.js';
|
|
3
|
+
import { Page, Frame, FrameLocator, BrowserContext, CDPSession, LaunchOptions, ConnectOptions, BrowserContextOptions, Browser } from 'playwright';
|
|
4
|
+
import { ScreenshotMatcherOptions, ScreenshotComparatorRegistry, Locator } from '../browser/index.js';
|
|
5
|
+
import { BrowserProviderOption, BrowserProvider, BrowserModuleMocker, TestProject, CDPSession as CDPSession$1 } from '../../node.js';
|
|
6
|
+
|
|
7
|
+
declare const playwrightBrowsers: readonly ["firefox", "webkit", "chromium"];
|
|
8
|
+
type PlaywrightBrowser = (typeof playwrightBrowsers)[number];
|
|
9
|
+
interface PlaywrightProviderOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The options passed down to [`playwright.connect`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch) method.
|
|
12
|
+
* @see {@link https://playwright.dev/docs/api/class-browsertype#browser-type-launch}
|
|
13
|
+
*/
|
|
14
|
+
launchOptions?: Omit<LaunchOptions, "tracesDir">;
|
|
15
|
+
/**
|
|
16
|
+
* The options passed down to [`playwright.connect`](https://playwright.dev/docs/api/class-browsertype#browser-type-connect) method.
|
|
17
|
+
*
|
|
18
|
+
* This is used only if you connect remotely to the playwright instance via a WebSocket connection.
|
|
19
|
+
* @see {@link https://playwright.dev/docs/api/class-browsertype#browser-type-connect}
|
|
20
|
+
*/
|
|
21
|
+
connectOptions?: ConnectOptions & {
|
|
22
|
+
wsEndpoint: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The options passed down to [`browser.newContext`](https://playwright.dev/docs/api/class-browser#browser-new-context) method.
|
|
26
|
+
* @see {@link https://playwright.dev/docs/api/class-browser#browser-new-context}
|
|
27
|
+
*/
|
|
28
|
+
contextOptions?: Omit<BrowserContextOptions, "ignoreHTTPSErrors" | "serviceWorkers">;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum time in milliseconds to wait for `userEvent` action to complete.
|
|
31
|
+
* @default 0 (no timeout)
|
|
32
|
+
*/
|
|
33
|
+
actionTimeout?: number;
|
|
34
|
+
}
|
|
35
|
+
declare function playwright(options?: PlaywrightProviderOptions): BrowserProviderOption<PlaywrightProviderOptions>;
|
|
36
|
+
declare class PlaywrightBrowserProvider implements BrowserProvider {
|
|
37
|
+
private project;
|
|
38
|
+
private options;
|
|
39
|
+
name: "playwright";
|
|
40
|
+
supportsParallelism: boolean;
|
|
41
|
+
browser: Browser | null;
|
|
42
|
+
contexts: Map<string, BrowserContext>;
|
|
43
|
+
pages: Map<string, Page>;
|
|
44
|
+
mocker: BrowserModuleMocker;
|
|
45
|
+
browserName: PlaywrightBrowser;
|
|
46
|
+
private browserPromise;
|
|
47
|
+
private closing;
|
|
48
|
+
tracingContexts: Set<string>;
|
|
49
|
+
pendingTraces: Map<string, string>;
|
|
50
|
+
initScripts: string[];
|
|
51
|
+
constructor(project: TestProject, options: PlaywrightProviderOptions);
|
|
52
|
+
private openBrowser;
|
|
53
|
+
private createMocker;
|
|
54
|
+
private createContext;
|
|
55
|
+
getPage(sessionId: string): Page;
|
|
56
|
+
getCommandsContext(sessionId: string): {
|
|
57
|
+
page: Page;
|
|
58
|
+
context: BrowserContext;
|
|
59
|
+
frame: () => Promise<Frame>;
|
|
60
|
+
readonly iframe: FrameLocator;
|
|
61
|
+
};
|
|
62
|
+
private openBrowserPage;
|
|
63
|
+
openPage(sessionId: string, url: string): Promise<void>;
|
|
64
|
+
private _throwIfClosing;
|
|
65
|
+
getCDPSession(sessionid: string): Promise<CDPSession$1>;
|
|
66
|
+
close(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
declare module "vitest/node" {
|
|
69
|
+
interface BrowserCommandContext {
|
|
70
|
+
page: Page;
|
|
71
|
+
frame(): Promise<Frame>;
|
|
72
|
+
iframe: FrameLocator;
|
|
73
|
+
context: BrowserContext;
|
|
74
|
+
}
|
|
75
|
+
interface _BrowserNames {
|
|
76
|
+
playwright: PlaywrightBrowser;
|
|
77
|
+
}
|
|
78
|
+
interface ToMatchScreenshotOptions extends Omit<ScreenshotMatcherOptions, "comparatorName" | "comparatorOptions">, CustomComparatorsRegistry {}
|
|
79
|
+
interface ToMatchScreenshotComparators extends ScreenshotComparatorRegistry {}
|
|
80
|
+
}
|
|
81
|
+
type PWHoverOptions = NonNullable<Parameters<Page["hover"]>[1]>;
|
|
82
|
+
type PWClickOptions = NonNullable<Parameters<Page["click"]>[1]>;
|
|
83
|
+
type PWDoubleClickOptions = NonNullable<Parameters<Page["dblclick"]>[1]>;
|
|
84
|
+
type PWFillOptions = NonNullable<Parameters<Page["fill"]>[2]>;
|
|
85
|
+
type PWScreenshotOptions = NonNullable<Parameters<Page["screenshot"]>[0]>;
|
|
86
|
+
type PWSelectOptions = NonNullable<Parameters<Page["selectOption"]>[2]>;
|
|
87
|
+
type PWDragAndDropOptions = NonNullable<Parameters<Page["dragAndDrop"]>[2]>;
|
|
88
|
+
type PWSetInputFiles = NonNullable<Parameters<Page["setInputFiles"]>[2]>;
|
|
89
|
+
type PWCDPSession = CDPSession;
|
|
90
|
+
declare module "vitest/browser" {
|
|
91
|
+
interface UserEventHoverOptions extends PWHoverOptions {}
|
|
92
|
+
interface UserEventClickOptions extends PWClickOptions {}
|
|
93
|
+
interface UserEventDoubleClickOptions extends PWDoubleClickOptions {}
|
|
94
|
+
interface UserEventTripleClickOptions extends PWClickOptions {}
|
|
95
|
+
interface UserEventFillOptions extends PWFillOptions {}
|
|
96
|
+
interface UserEventSelectOptions extends PWSelectOptions {}
|
|
97
|
+
interface UserEventDragAndDropOptions extends PWDragAndDropOptions {}
|
|
98
|
+
interface UserEventUploadOptions extends PWSetInputFiles {}
|
|
99
|
+
interface ScreenshotOptions extends Omit<PWScreenshotOptions, "mask"> {
|
|
100
|
+
mask?: ReadonlyArray<Element | Locator> | undefined;
|
|
101
|
+
}
|
|
102
|
+
interface CDPSession extends PWCDPSession {}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { PlaywrightBrowserProvider, playwright };
|
|
106
|
+
export type { PlaywrightProviderOptions };
|