@vitest/browser 2.0.5 → 2.1.0-beta.1
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/aria-role.d.ts +96 -0
- package/context.d.ts +221 -17
- package/dist/client/.vite/manifest.json +2 -2
- package/dist/client/__vitest__/assets/index-JTfsnJeu.css +1 -0
- package/dist/client/__vitest__/assets/index-uh8h5Yzr.js +52 -0
- package/dist/client/__vitest__/favicon.ico +0 -0
- package/dist/client/__vitest__/index.html +4 -3
- package/dist/client/__vitest_browser__/{orchestrator-CNOAigTE.js → orchestrator-BObhEEvc.js} +4 -4
- package/dist/client/__vitest_browser__/{tester-l8kjusoM.js → tester-CRcWWhrn.js} +10 -2
- package/dist/client/error-catcher.js +10 -16
- package/dist/client/orchestrator.html +1 -1
- package/dist/client/tester/tester.html +3 -11
- package/dist/context.js +194 -77
- package/dist/index-BRfqvYVY.js +5722 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +38 -23
- package/dist/locators/index.d.ts +261 -0
- package/dist/locators/index.js +2 -0
- package/dist/locators/playwright.js +42 -0
- package/dist/locators/preview.js +86 -0
- package/dist/locators/webdriverio.js +83 -0
- package/jest-dom.d.ts +1 -97
- package/matchers.d.ts +2 -1
- package/package.json +16 -11
- package/providers/playwright.d.ts +2 -1
- package/providers/webdriverio.d.ts +10 -1
- package/dist/client/__vitest__/assets/index--EAEh9Ei.js +0 -52
- package/dist/client/__vitest__/assets/index-C0SwoDYm.css +0 -1
package/jest-dom.d.ts
CHANGED
|
@@ -1,102 +1,6 @@
|
|
|
1
1
|
// Disable automatic exports.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
type ARIAWidgetRole =
|
|
5
|
-
| "button"
|
|
6
|
-
| "checkbox"
|
|
7
|
-
| "gridcell"
|
|
8
|
-
| "link"
|
|
9
|
-
| "menuitem"
|
|
10
|
-
| "menuitemcheckbox"
|
|
11
|
-
| "menuitemradio"
|
|
12
|
-
| "option"
|
|
13
|
-
| "progressbar"
|
|
14
|
-
| "radio"
|
|
15
|
-
| "scrollbar"
|
|
16
|
-
| "searchbox"
|
|
17
|
-
| "slider"
|
|
18
|
-
| "spinbutton"
|
|
19
|
-
| "switch"
|
|
20
|
-
| "tab"
|
|
21
|
-
| "tabpanel"
|
|
22
|
-
| "textbox"
|
|
23
|
-
| "treeitem";
|
|
24
|
-
|
|
25
|
-
type ARIACompositeWidgetRole =
|
|
26
|
-
| "combobox"
|
|
27
|
-
| "grid"
|
|
28
|
-
| "listbox"
|
|
29
|
-
| "menu"
|
|
30
|
-
| "menubar"
|
|
31
|
-
| "radiogroup"
|
|
32
|
-
| "tablist"
|
|
33
|
-
| "tree"
|
|
34
|
-
| "treegrid";
|
|
35
|
-
|
|
36
|
-
type ARIADocumentStructureRole =
|
|
37
|
-
| "application"
|
|
38
|
-
| "article"
|
|
39
|
-
| "blockquote"
|
|
40
|
-
| "caption"
|
|
41
|
-
| "cell"
|
|
42
|
-
| "columnheader"
|
|
43
|
-
| "definition"
|
|
44
|
-
| "deletion"
|
|
45
|
-
| "directory"
|
|
46
|
-
| "document"
|
|
47
|
-
| "emphasis"
|
|
48
|
-
| "feed"
|
|
49
|
-
| "figure"
|
|
50
|
-
| "generic"
|
|
51
|
-
| "group"
|
|
52
|
-
| "heading"
|
|
53
|
-
| "img"
|
|
54
|
-
| "insertion"
|
|
55
|
-
| "list"
|
|
56
|
-
| "listitem"
|
|
57
|
-
| "math"
|
|
58
|
-
| "meter"
|
|
59
|
-
| "none"
|
|
60
|
-
| "note"
|
|
61
|
-
| "paragraph"
|
|
62
|
-
| "presentation"
|
|
63
|
-
| "row"
|
|
64
|
-
| "rowgroup"
|
|
65
|
-
| "rowheader"
|
|
66
|
-
| "separator"
|
|
67
|
-
| "strong"
|
|
68
|
-
| "subscript"
|
|
69
|
-
| "superscript"
|
|
70
|
-
| "table"
|
|
71
|
-
| "term"
|
|
72
|
-
| "time"
|
|
73
|
-
| "toolbar"
|
|
74
|
-
| "tooltip";
|
|
75
|
-
|
|
76
|
-
type ARIALandmarkRole =
|
|
77
|
-
| "banner"
|
|
78
|
-
| "complementary"
|
|
79
|
-
| "contentinfo"
|
|
80
|
-
| "form"
|
|
81
|
-
| "main"
|
|
82
|
-
| "navigation"
|
|
83
|
-
| "region"
|
|
84
|
-
| "search";
|
|
85
|
-
|
|
86
|
-
type ARIALiveRegionRole = "alert" | "log" | "marquee" | "status" | "timer";
|
|
87
|
-
|
|
88
|
-
type ARIAWindowRole = "alertdialog" | "dialog";
|
|
89
|
-
|
|
90
|
-
type ARIAUncategorizedRole = "code";
|
|
91
|
-
|
|
92
|
-
type ARIARole =
|
|
93
|
-
| ARIAWidgetRole
|
|
94
|
-
| ARIACompositeWidgetRole
|
|
95
|
-
| ARIADocumentStructureRole
|
|
96
|
-
| ARIALandmarkRole
|
|
97
|
-
| ARIALiveRegionRole
|
|
98
|
-
| ARIAWindowRole
|
|
99
|
-
| ARIAUncategorizedRole;
|
|
3
|
+
import { ARIARole } from './aria-role.ts'
|
|
100
4
|
|
|
101
5
|
declare namespace matchers {
|
|
102
6
|
interface TestingLibraryMatchers<E, R> {
|
package/matchers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Locator } from '@vitest/browser/context'
|
|
1
2
|
import type jsdomMatchers from './jest-dom.js'
|
|
2
3
|
import type { Assertion } from 'vitest'
|
|
3
4
|
|
|
@@ -15,7 +16,7 @@ declare module 'vitest' {
|
|
|
15
16
|
type PromisifyDomAssertion<T> = Promisify<Assertion<T>>
|
|
16
17
|
|
|
17
18
|
interface ExpectStatic {
|
|
18
|
-
element: <T extends Element>(element: T, options?: ExpectPollOptions) => PromisifyDomAssertion<Awaited<
|
|
19
|
+
element: <T extends Element | Locator>(element: T, options?: ExpectPollOptions) => PromisifyDomAssertion<Awaited<Element>>
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/browser",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.1.0-beta.1",
|
|
5
5
|
"description": "Browser running for Vitest",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"./providers/playwright": {
|
|
41
41
|
"types": "./providers/playwright.d.ts"
|
|
42
42
|
},
|
|
43
|
+
"./locator": {
|
|
44
|
+
"types": "./dist/locators/index.d.ts",
|
|
45
|
+
"default": "./dist/locators/index.js"
|
|
46
|
+
},
|
|
43
47
|
"./*": "./*"
|
|
44
48
|
},
|
|
45
49
|
"main": "./dist/index.js",
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
"peerDependencies": {
|
|
55
59
|
"playwright": "*",
|
|
56
60
|
"webdriverio": "*",
|
|
57
|
-
"vitest": "2.0.
|
|
61
|
+
"vitest": "2.1.0-beta.1"
|
|
58
62
|
},
|
|
59
63
|
"peerDependenciesMeta": {
|
|
60
64
|
"playwright": {
|
|
@@ -70,28 +74,29 @@
|
|
|
70
74
|
"dependencies": {
|
|
71
75
|
"@testing-library/dom": "^10.4.0",
|
|
72
76
|
"@testing-library/user-event": "^14.5.2",
|
|
73
|
-
"magic-string": "^0.30.
|
|
74
|
-
"msw": "^2.3.
|
|
77
|
+
"magic-string": "^0.30.11",
|
|
78
|
+
"msw": "^2.3.5",
|
|
75
79
|
"sirv": "^2.0.4",
|
|
76
80
|
"ws": "^8.18.0",
|
|
77
|
-
"@vitest/utils": "2.0.
|
|
81
|
+
"@vitest/utils": "2.1.0-beta.1"
|
|
78
82
|
},
|
|
79
83
|
"devDependencies": {
|
|
80
|
-
"@testing-library/jest-dom": "^6.4.
|
|
81
|
-
"@types/ws": "^8.5.
|
|
84
|
+
"@testing-library/jest-dom": "^6.4.8",
|
|
85
|
+
"@types/ws": "^8.5.12",
|
|
82
86
|
"@wdio/protocols": "^8.38.0",
|
|
83
87
|
"birpc": "0.2.17",
|
|
84
88
|
"flatted": "^3.3.1",
|
|
89
|
+
"ivya": "^1.1.0",
|
|
85
90
|
"pathe": "^1.1.2",
|
|
86
91
|
"periscopic": "^4.0.2",
|
|
87
92
|
"playwright": "^1.45.3",
|
|
88
93
|
"playwright-core": "^1.45.3",
|
|
89
94
|
"safaridriver": "^0.1.2",
|
|
90
95
|
"webdriverio": "^8.39.1",
|
|
91
|
-
"@vitest/runner": "2.0.
|
|
92
|
-
"@vitest/
|
|
93
|
-
"vitest": "2.0.
|
|
94
|
-
"
|
|
96
|
+
"@vitest/runner": "2.1.0-beta.1",
|
|
97
|
+
"@vitest/ui": "2.1.0-beta.1",
|
|
98
|
+
"@vitest/ws-client": "2.1.0-beta.1",
|
|
99
|
+
"vitest": "2.1.0-beta.1"
|
|
95
100
|
},
|
|
96
101
|
"scripts": {
|
|
97
102
|
"build": "rimraf dist && pnpm build:node && pnpm build:client",
|
|
@@ -39,9 +39,10 @@ declare module '@vitest/browser/context' {
|
|
|
39
39
|
export interface UserEventHoverOptions extends PWHoverOptions {}
|
|
40
40
|
export interface UserEventClickOptions extends PWClickOptions {}
|
|
41
41
|
export interface UserEventDoubleClickOptions extends PWDoubleClickOptions {}
|
|
42
|
+
export interface UserEventTripleClickOptions extends PWClickOptions {}
|
|
42
43
|
export interface UserEventFillOptions extends PWFillOptions {}
|
|
43
44
|
export interface UserEventSelectOptions extends PWSelectOptions {}
|
|
44
|
-
export interface
|
|
45
|
+
export interface UserEventDragAndDropOptions extends PWDragAndDropOptions {}
|
|
45
46
|
|
|
46
47
|
export interface ScreenshotOptions extends PWScreenshotOptions {}
|
|
47
48
|
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import type { RemoteOptions } from 'webdriverio'
|
|
1
|
+
import type { RemoteOptions, ClickOptions, DragAndDropOptions } from 'webdriverio'
|
|
2
2
|
import '../matchers.js'
|
|
3
3
|
|
|
4
4
|
declare module 'vitest/node' {
|
|
5
5
|
interface BrowserProviderOptions extends RemoteOptions {}
|
|
6
6
|
|
|
7
|
+
export interface UserEventClickOptions extends ClickOptions {}
|
|
8
|
+
|
|
9
|
+
export interface UserEventDragOptions extends DragAndDropOptions {
|
|
10
|
+
sourceX?: number
|
|
11
|
+
sourceY?: number
|
|
12
|
+
targetX?: number
|
|
13
|
+
targetY?: number
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
export interface BrowserCommandContext {
|
|
8
17
|
browser: WebdriverIO.Browser
|
|
9
18
|
}
|