@vitest/browser 2.0.0-beta.11 → 2.0.0-beta.13
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 +26 -5
- package/dist/client/.vite/manifest.json +7 -7
- package/dist/client/__vitest__/assets/index-C-LD6Fid.js +52 -0
- package/dist/client/__vitest__/assets/index-DEM1IsBG.css +1 -0
- package/dist/client/__vitest__/index.html +2 -2
- package/dist/client/__vitest_browser__/{rpc-D6HtJ5Rb.js → client-dLyjuL0K.js} +34 -133
- package/dist/client/__vitest_browser__/{orchestrator-DQ4hbmZ_.js → orchestrator-x0A1t8rC.js} +193 -162
- package/dist/client/__vitest_browser__/tester-BdcP5piS.js +12070 -0
- package/dist/client/orchestrator.html +2 -2
- package/dist/client/tester/tester.html +2 -2
- package/dist/context.js +82 -51
- package/dist/index.d.ts +30 -4
- package/dist/index.js +344 -98
- package/dist/providers.js +2 -2
- package/dist/state.js +1 -1
- package/dist/{webdriver-BRud6NtS.js → webdriver-BdVqnfdE.js} +75 -6
- package/jest-dom.d.ts +816 -0
- package/matchers.d.ts +22 -0
- package/package.json +15 -11
- package/providers/playwright.d.ts +25 -1
- package/providers/webdriverio.d.ts +1 -0
- package/dist/client/__vitest__/assets/index-BfnqOMHY.js +0 -51
- package/dist/client/__vitest__/assets/index-qZYZB8Y3.css +0 -1
- package/dist/client/__vitest_browser__/tester-IF8AbWCS.js +0 -837
package/context.d.ts
CHANGED
|
@@ -19,12 +19,20 @@ export interface FsOptions {
|
|
|
19
19
|
flag?: string | number
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export interface CDPSession {
|
|
23
|
+
// methods are defined by the provider type augmentation
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
export interface ScreenshotOptions {
|
|
23
27
|
element?: Element
|
|
24
28
|
/**
|
|
25
29
|
* Path relative to the `screenshotDirectory` in the test config.
|
|
26
30
|
*/
|
|
27
31
|
path?: string
|
|
32
|
+
/**
|
|
33
|
+
* Will also return the base64 encoded screenshot alongside the path.
|
|
34
|
+
*/
|
|
35
|
+
base64?: boolean
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
export interface BrowserCommands {
|
|
@@ -56,6 +64,13 @@ export interface UserEvent {
|
|
|
56
64
|
* @see {@link https://testing-library.com/docs/user-event/convenience/#dblClick} testing-library API
|
|
57
65
|
*/
|
|
58
66
|
dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise<void>
|
|
67
|
+
/**
|
|
68
|
+
* Triggers a triple click event on an element. Uses provider's API under the hood.
|
|
69
|
+
* @see {@link https://playwright.dev/docs/api/class-locator#locator-click} Playwright API: using `click` with `clickCount: 3`
|
|
70
|
+
* @see {@link https://webdriver.io/docs/api/browser/actions/} WebdriverIO API: using actions api with `move` plus three `down + up + pause` events in a row
|
|
71
|
+
* @see {@link https://testing-library.com/docs/user-event/convenience/#tripleclick} testing-library API
|
|
72
|
+
*/
|
|
73
|
+
tripleClick: (element: Element, options?: UserEventTripleClickOptions) => Promise<void>
|
|
59
74
|
/**
|
|
60
75
|
* Choose one or more values from a select element. Uses provider's API under the hood.
|
|
61
76
|
* If select doesn't have `multiple` attribute, only the first value will be selected.
|
|
@@ -161,6 +176,7 @@ export interface UserEventHoverOptions {}
|
|
|
161
176
|
export interface UserEventSelectOptions {}
|
|
162
177
|
export interface UserEventClickOptions {}
|
|
163
178
|
export interface UserEventDoubleClickOptions {}
|
|
179
|
+
export interface UserEventTripleClickOptions {}
|
|
164
180
|
export interface UserEventDragAndDropOptions {}
|
|
165
181
|
|
|
166
182
|
export interface UserEventTabOptions {
|
|
@@ -206,7 +222,7 @@ export const server: {
|
|
|
206
222
|
browser: string
|
|
207
223
|
/**
|
|
208
224
|
* Available commands for the browser.
|
|
209
|
-
* @see {@link https://vitest.dev/guide/browser
|
|
225
|
+
* @see {@link https://vitest.dev/guide/browser/commands}
|
|
210
226
|
*/
|
|
211
227
|
commands: BrowserCommands
|
|
212
228
|
}
|
|
@@ -221,7 +237,7 @@ export const userEvent: UserEvent
|
|
|
221
237
|
/**
|
|
222
238
|
* Available commands for the browser.
|
|
223
239
|
* A shortcut to `server.commands`.
|
|
224
|
-
* @see {@link https://vitest.dev/guide/browser
|
|
240
|
+
* @see {@link https://vitest.dev/guide/browser/commands}
|
|
225
241
|
*/
|
|
226
242
|
export const commands: BrowserCommands
|
|
227
243
|
|
|
@@ -233,12 +249,17 @@ export interface BrowserPage {
|
|
|
233
249
|
/**
|
|
234
250
|
* Change the size of iframe's viewport.
|
|
235
251
|
*/
|
|
236
|
-
viewport
|
|
252
|
+
viewport(width: number, height: number): Promise<void>
|
|
237
253
|
/**
|
|
238
254
|
* Make a screenshot of the test iframe or a specific element.
|
|
239
|
-
* @returns Path to the screenshot file.
|
|
255
|
+
* @returns Path to the screenshot file or path and base64.
|
|
240
256
|
*/
|
|
241
|
-
screenshot
|
|
257
|
+
screenshot(options: Omit<ScreenshotOptions, 'base64'> & { base64: true }): Promise<{
|
|
258
|
+
path: string
|
|
259
|
+
base64: string
|
|
260
|
+
}>
|
|
261
|
+
screenshot(options?: ScreenshotOptions): Promise<string>
|
|
242
262
|
}
|
|
243
263
|
|
|
244
264
|
export const page: BrowserPage
|
|
265
|
+
export const cdp: () => CDPSession
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"file": "__vitest_browser__/
|
|
4
|
-
"name": "
|
|
2
|
+
"_client-dLyjuL0K.js": {
|
|
3
|
+
"file": "__vitest_browser__/client-dLyjuL0K.js",
|
|
4
|
+
"name": "client"
|
|
5
5
|
},
|
|
6
6
|
"orchestrator.html": {
|
|
7
|
-
"file": "__vitest_browser__/orchestrator-
|
|
7
|
+
"file": "__vitest_browser__/orchestrator-x0A1t8rC.js",
|
|
8
8
|
"name": "orchestrator",
|
|
9
9
|
"src": "orchestrator.html",
|
|
10
10
|
"isEntry": true,
|
|
11
11
|
"imports": [
|
|
12
|
-
"
|
|
12
|
+
"_client-dLyjuL0K.js"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"tester/tester.html": {
|
|
16
|
-
"file": "__vitest_browser__/tester-
|
|
16
|
+
"file": "__vitest_browser__/tester-BdcP5piS.js",
|
|
17
17
|
"name": "tester",
|
|
18
18
|
"src": "tester/tester.html",
|
|
19
19
|
"isEntry": true,
|
|
20
20
|
"imports": [
|
|
21
|
-
"
|
|
21
|
+
"_client-dLyjuL0K.js"
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
24
|
}
|