@vitest/browser 2.0.0-beta.6 → 2.0.0-beta.7
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/context.d.ts +21 -0
- package/dist/client/.vite/manifest.json +2 -2
- package/dist/client/__vitest__/assets/{index-T2_JR9hd.js → index-BNIf8EuF.js} +19 -19
- package/dist/client/__vitest__/index.html +1 -1
- package/dist/client/__vitest_browser__/{orchestrator-D24IzA4b.js → orchestrator-CTfJ7g35.js} +9 -3
- package/dist/client/__vitest_browser__/{tester-C3Mchfpf.js → tester-Bo1gw1oi.js} +12 -2
- package/dist/client/orchestrator.html +1 -1
- package/dist/client/tester.html +1 -1
- package/dist/index.js +121 -32
- package/dist/providers.js +5 -5
- package/package.json +9 -7
- package/providers.d.ts +5 -5
package/context.d.ts
CHANGED
|
@@ -33,6 +33,20 @@ export interface BrowserCommands {
|
|
|
33
33
|
sendKeys: (payload: SendKeysPayload) => Promise<void>
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export interface UserEvent {
|
|
37
|
+
/**
|
|
38
|
+
* Click on an element. Uses provider's API under the hood and supports all its options.
|
|
39
|
+
* @see {@link https://playwright.dev/docs/api/class-locator#locator-click} Playwright API
|
|
40
|
+
* @see {@link https://webdriver.io/docs/api/element/click/} WebdriverIO API
|
|
41
|
+
* @see {@link https://testing-library.com/docs/user-event/convenience/#click} testing-library API
|
|
42
|
+
*/
|
|
43
|
+
click: (element: Element, options?: UserEventClickOptions) => Promise<void>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface UserEventClickOptions {
|
|
47
|
+
[key: string]: any
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
type Platform =
|
|
37
51
|
| 'aix'
|
|
38
52
|
| 'android'
|
|
@@ -72,6 +86,13 @@ export const server: {
|
|
|
72
86
|
commands: BrowserCommands
|
|
73
87
|
}
|
|
74
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Handler for user interactions. The support is provided by the browser provider (`playwright` or `webdriverio`).
|
|
91
|
+
* If used with `preview` provider, fallbacks to simulated events via `@testing-library/user-event`.
|
|
92
|
+
* @experimental
|
|
93
|
+
*/
|
|
94
|
+
export const userEvent: UserEvent
|
|
95
|
+
|
|
75
96
|
/**
|
|
76
97
|
* Available commands for the browser.
|
|
77
98
|
* A shortcut to `server.commands`.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "rpc"
|
|
5
5
|
},
|
|
6
6
|
"orchestrator.html": {
|
|
7
|
-
"file": "__vitest_browser__/orchestrator-
|
|
7
|
+
"file": "__vitest_browser__/orchestrator-CTfJ7g35.js",
|
|
8
8
|
"name": "orchestrator",
|
|
9
9
|
"src": "orchestrator.html",
|
|
10
10
|
"isEntry": true,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"tester.html": {
|
|
16
|
-
"file": "__vitest_browser__/tester-
|
|
16
|
+
"file": "__vitest_browser__/tester-Bo1gw1oi.js",
|
|
17
17
|
"name": "tester",
|
|
18
18
|
"src": "tester.html",
|
|
19
19
|
"isEntry": true,
|