@vitest/browser 2.0.0-beta.12 → 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 +21 -5
- package/dist/client/.vite/manifest.json +6 -6
- package/dist/client/__vitest__/assets/index-C-LD6Fid.js +52 -0
- package/dist/client/__vitest__/assets/{index-goqgbqVs.css → index-DEM1IsBG.css} +1 -1
- package/dist/client/__vitest__/index.html +2 -2
- package/dist/client/__vitest_browser__/{client-Dz5Ebwug.js → client-dLyjuL0K.js} +10 -72
- package/dist/client/__vitest_browser__/{orchestrator-DJ6H4qlM.js → orchestrator-x0A1t8rC.js} +6 -8
- package/dist/client/__vitest_browser__/{tester-DHXll_4H.js → tester-BdcP5piS.js} +272 -366
- package/dist/client/orchestrator.html +2 -2
- package/dist/client/tester/tester.html +2 -2
- package/dist/context.js +78 -50
- package/dist/index.d.ts +8 -1
- package/dist/index.js +144 -63
- package/dist/providers.js +2 -2
- package/dist/{webdriver-CJA71Bgl.js → webdriver-BdVqnfdE.js} +26 -4
- package/package.json +11 -11
- package/dist/client/__vitest__/assets/index-BcWipdNi.js +0 -52
package/context.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ export interface ScreenshotOptions {
|
|
|
29
29
|
* Path relative to the `screenshotDirectory` in the test config.
|
|
30
30
|
*/
|
|
31
31
|
path?: string
|
|
32
|
+
/**
|
|
33
|
+
* Will also return the base64 encoded screenshot alongside the path.
|
|
34
|
+
*/
|
|
35
|
+
base64?: boolean
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
export interface BrowserCommands {
|
|
@@ -60,6 +64,13 @@ export interface UserEvent {
|
|
|
60
64
|
* @see {@link https://testing-library.com/docs/user-event/convenience/#dblClick} testing-library API
|
|
61
65
|
*/
|
|
62
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>
|
|
63
74
|
/**
|
|
64
75
|
* Choose one or more values from a select element. Uses provider's API under the hood.
|
|
65
76
|
* If select doesn't have `multiple` attribute, only the first value will be selected.
|
|
@@ -165,6 +176,7 @@ export interface UserEventHoverOptions {}
|
|
|
165
176
|
export interface UserEventSelectOptions {}
|
|
166
177
|
export interface UserEventClickOptions {}
|
|
167
178
|
export interface UserEventDoubleClickOptions {}
|
|
179
|
+
export interface UserEventTripleClickOptions {}
|
|
168
180
|
export interface UserEventDragAndDropOptions {}
|
|
169
181
|
|
|
170
182
|
export interface UserEventTabOptions {
|
|
@@ -210,7 +222,7 @@ export const server: {
|
|
|
210
222
|
browser: string
|
|
211
223
|
/**
|
|
212
224
|
* Available commands for the browser.
|
|
213
|
-
* @see {@link https://vitest.dev/guide/browser
|
|
225
|
+
* @see {@link https://vitest.dev/guide/browser/commands}
|
|
214
226
|
*/
|
|
215
227
|
commands: BrowserCommands
|
|
216
228
|
}
|
|
@@ -225,7 +237,7 @@ export const userEvent: UserEvent
|
|
|
225
237
|
/**
|
|
226
238
|
* Available commands for the browser.
|
|
227
239
|
* A shortcut to `server.commands`.
|
|
228
|
-
* @see {@link https://vitest.dev/guide/browser
|
|
240
|
+
* @see {@link https://vitest.dev/guide/browser/commands}
|
|
229
241
|
*/
|
|
230
242
|
export const commands: BrowserCommands
|
|
231
243
|
|
|
@@ -237,12 +249,16 @@ export interface BrowserPage {
|
|
|
237
249
|
/**
|
|
238
250
|
* Change the size of iframe's viewport.
|
|
239
251
|
*/
|
|
240
|
-
viewport
|
|
252
|
+
viewport(width: number, height: number): Promise<void>
|
|
241
253
|
/**
|
|
242
254
|
* Make a screenshot of the test iframe or a specific element.
|
|
243
|
-
* @returns Path to the screenshot file.
|
|
255
|
+
* @returns Path to the screenshot file or path and base64.
|
|
244
256
|
*/
|
|
245
|
-
screenshot
|
|
257
|
+
screenshot(options: Omit<ScreenshotOptions, 'base64'> & { base64: true }): Promise<{
|
|
258
|
+
path: string
|
|
259
|
+
base64: string
|
|
260
|
+
}>
|
|
261
|
+
screenshot(options?: ScreenshotOptions): Promise<string>
|
|
246
262
|
}
|
|
247
263
|
|
|
248
264
|
export const page: BrowserPage
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_client-
|
|
3
|
-
"file": "__vitest_browser__/client-
|
|
2
|
+
"_client-dLyjuL0K.js": {
|
|
3
|
+
"file": "__vitest_browser__/client-dLyjuL0K.js",
|
|
4
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
|
-
"_client-
|
|
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
|
-
"_client-
|
|
21
|
+
"_client-dLyjuL0K.js"
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
24
|
}
|