@wdio/mcp 2.1.0 → 2.2.0

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.
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Browser accessibility tree snapshot
3
+ * Extracts semantic information about page elements (roles, names, states)
4
+ */
5
+ interface AccessibilityNode {
6
+ role: string;
7
+ name: string;
8
+ value: string;
9
+ description: string;
10
+ disabled: string;
11
+ focused: string;
12
+ selected: string;
13
+ checked: string;
14
+ expanded: string;
15
+ pressed: string;
16
+ readonly: string;
17
+ required: string;
18
+ level: string | number;
19
+ valuemin: string | number;
20
+ valuemax: string | number;
21
+ autocomplete: string;
22
+ haspopup: string;
23
+ invalid: string;
24
+ modal: string;
25
+ multiline: string;
26
+ multiselectable: string;
27
+ orientation: string;
28
+ keyshortcuts: string;
29
+ roledescription: string;
30
+ valuetext: string;
31
+ }
32
+ /**
33
+ * Get browser accessibility tree snapshot
34
+ * Browser-only - requires Puppeteer access via WebDriverIO browser instance
35
+ *
36
+ * @param browser - WebDriverIO browser instance
37
+ * @returns Flattened accessibility tree nodes
38
+ */
39
+ declare function getBrowserAccessibilityTree(browser: WebdriverIO.Browser): Promise<AccessibilityNode[]>;
40
+
41
+ type ElementType = 'interactable' | 'visual' | 'all';
42
+ interface BrowserElementInfo {
43
+ tagName: string;
44
+ type: string;
45
+ id: string;
46
+ className: string;
47
+ textContent: string;
48
+ value: string;
49
+ placeholder: string;
50
+ href: string;
51
+ ariaLabel: string;
52
+ role: string;
53
+ src: string;
54
+ alt: string;
55
+ cssSelector: string;
56
+ isInViewport: boolean;
57
+ }
58
+ interface GetBrowserElementsOptions {
59
+ /** Type of elements to return. Default: 'interactable' */
60
+ elementType?: ElementType;
61
+ }
62
+ /**
63
+ * Get browser interactable elements
64
+ * Wrapper function that executes the script in browser context
65
+ *
66
+ * @param browser - WebDriverIO browser instance
67
+ * @param options - Options for element filtering
68
+ * @returns Array of visible element information
69
+ */
70
+ declare function getBrowserInteractableElements(browser: WebdriverIO.Browser, options?: GetBrowserElementsOptions): Promise<BrowserElementInfo[]>;
71
+
72
+ interface FilterOptions {
73
+ includeTagNames?: string[];
74
+ excludeTagNames?: string[];
75
+ requireAttributes?: string[];
76
+ minAttributeCount?: number;
77
+ fetchableOnly?: boolean;
78
+ clickableOnly?: boolean;
79
+ visibleOnly?: boolean;
80
+ }
81
+
82
+ /**
83
+ * Mobile element detection utilities for iOS and Android
84
+ *
85
+ * Uses page source parsing for optimal performance (2 HTTP calls vs 600+ for 50 elements)
86
+ */
87
+
88
+ /**
89
+ * Element info returned by getMobileVisibleElements
90
+ * Uses uniform fields (all elements have same keys) to enable TOON tabular format
91
+ */
92
+ interface MobileElementInfo {
93
+ selector: string;
94
+ tagName: string;
95
+ isInViewport: boolean;
96
+ text: string;
97
+ resourceId: string;
98
+ accessibilityId: string;
99
+ isEnabled: boolean;
100
+ altSelector: string;
101
+ bounds?: {
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ };
107
+ }
108
+ /**
109
+ * Options for getMobileVisibleElements
110
+ */
111
+ interface GetMobileElementsOptions {
112
+ includeContainers?: boolean;
113
+ includeBounds?: boolean;
114
+ filterOptions?: FilterOptions;
115
+ }
116
+ /**
117
+ * Get all visible elements from a mobile app
118
+ *
119
+ * Performance: 2 HTTP calls (getWindowSize + getPageSource) vs 12+ per element with legacy approach
120
+ */
121
+ declare function getMobileVisibleElements(browser: WebdriverIO.Browser, platform: 'ios' | 'android', options?: GetMobileElementsOptions): Promise<MobileElementInfo[]>;
122
+
123
+ export { type AccessibilityNode, type BrowserElementInfo, type ElementType, type GetBrowserElementsOptions, type GetMobileElementsOptions, type MobileElementInfo, getBrowserAccessibilityTree, getBrowserInteractableElements, getMobileVisibleElements };