@wdio/mcp 2.2.0 → 2.3.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.
package/lib/snapshot.d.ts CHANGED
@@ -1,73 +1,57 @@
1
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
2
+ * Browser element detection
3
+ * Single browser.execute() call: querySelectorAll flat interactable element list
35
4
  *
36
- * @param browser - WebDriverIO browser instance
37
- * @returns Flattened accessibility tree nodes
5
+ * NOTE: This script runs in browser context via browser.execute()
6
+ * It must be self-contained with no external dependencies
38
7
  */
39
- declare function getBrowserAccessibilityTree(browser: WebdriverIO.Browser): Promise<AccessibilityNode[]>;
40
-
41
- type ElementType = 'interactable' | 'visual' | 'all';
42
8
  interface BrowserElementInfo {
43
9
  tagName: string;
10
+ name: string;
44
11
  type: string;
45
- id: string;
46
- className: string;
47
- textContent: string;
48
12
  value: string;
49
- placeholder: string;
50
13
  href: string;
51
- ariaLabel: string;
52
- role: string;
53
- src: string;
54
- alt: string;
55
- cssSelector: string;
14
+ selector: string;
56
15
  isInViewport: boolean;
16
+ boundingBox?: {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ };
57
22
  }
58
23
  interface GetBrowserElementsOptions {
59
- /** Type of elements to return. Default: 'interactable' */
60
- elementType?: ElementType;
24
+ includeBounds?: boolean;
61
25
  }
62
26
  /**
63
- * Get browser interactable elements
64
- * Wrapper function that executes the script in browser context
27
+ * Get interactable browser elements via querySelectorAll.
28
+ */
29
+ declare function getInteractableBrowserElements(browser: WebdriverIO.Browser, options?: GetBrowserElementsOptions): Promise<BrowserElementInfo[]>;
30
+
31
+ /**
32
+ * Browser accessibility tree
33
+ * Single browser.execute() call: DOM walk → flat accessibility node list
65
34
  *
66
- * @param browser - WebDriverIO browser instance
67
- * @param options - Options for element filtering
68
- * @returns Array of visible element information
35
+ * NOTE: This script runs in browser context via browser.execute()
36
+ * It must be self-contained with no external dependencies
69
37
  */
70
- declare function getBrowserInteractableElements(browser: WebdriverIO.Browser, options?: GetBrowserElementsOptions): Promise<BrowserElementInfo[]>;
38
+ interface AccessibilityNode {
39
+ role: string;
40
+ name: string;
41
+ selector: string;
42
+ level: number | string;
43
+ disabled: string;
44
+ checked: string;
45
+ expanded: string;
46
+ selected: string;
47
+ pressed: string;
48
+ required: string;
49
+ readonly: string;
50
+ }
51
+ /**
52
+ * Get browser accessibility tree via a single DOM walk.
53
+ */
54
+ declare function getBrowserAccessibilityTree(browser: WebdriverIO.Browser): Promise<AccessibilityNode[]>;
71
55
 
72
56
  interface FilterOptions {
73
57
  includeTagNames?: string[];
@@ -120,4 +104,4 @@ interface GetMobileElementsOptions {
120
104
  */
121
105
  declare function getMobileVisibleElements(browser: WebdriverIO.Browser, platform: 'ios' | 'android', options?: GetMobileElementsOptions): Promise<MobileElementInfo[]>;
122
106
 
123
- export { type AccessibilityNode, type BrowserElementInfo, type ElementType, type GetBrowserElementsOptions, type GetMobileElementsOptions, type MobileElementInfo, getBrowserAccessibilityTree, getBrowserInteractableElements, getMobileVisibleElements };
107
+ export { type AccessibilityNode, type BrowserElementInfo, type GetBrowserElementsOptions, type GetMobileElementsOptions, type MobileElementInfo, getBrowserAccessibilityTree, getInteractableBrowserElements, getMobileVisibleElements };