@tontoko/fast-playwright-mcp 0.1.1 → 0.1.2
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/README.md +116 -96
- package/lib/diagnostics/page-analyzer.js +2 -1
- package/lib/services/selector-resolver.js +541 -0
- package/lib/tab.js +47 -24
- package/lib/tools/base-tool-handler.js +3 -19
- package/lib/tools/evaluate.js +11 -7
- package/lib/tools/inspect-html.js +238 -0
- package/lib/tools/keyboard.js +12 -14
- package/lib/tools/screenshot.js +15 -13
- package/lib/tools/shared-element-utils.js +60 -0
- package/lib/tools/snapshot.js +21 -23
- package/lib/tools.js +2 -0
- package/lib/types/batch.js +1 -1
- package/lib/types/html-inspection.js +106 -0
- package/lib/types/selectors.js +126 -0
- package/lib/utilities/html-inspector.js +514 -0
- package/lib/utilities/index.js +24 -0
- package/lib/utils/tool-patterns.js +3 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,16 @@ A Model Context Protocol (MCP) server that provides browser automation capabilit
|
|
|
39
39
|
- Enhanced error handling with alternative element suggestions
|
|
40
40
|
- Page structure analysis (iframes, modals, accessibility metrics)
|
|
41
41
|
- Performance monitoring with execution time under 300ms
|
|
42
|
+
- **Enhanced Selector System**. Unified element selection with multiple strategies:
|
|
43
|
+
- **Selector Arrays**: All element-based tools now support multiple selectors with automatic fallback
|
|
44
|
+
- **4 Selector Types**:
|
|
45
|
+
- `ref`: System-generated element IDs from previous tool results (highest priority)
|
|
46
|
+
- `role`: ARIA roles with optional text matching (e.g., `{role: "button", text: "Submit"}`)
|
|
47
|
+
- `css`: Standard CSS selectors (e.g., `{css: "#submit-btn"}`)
|
|
48
|
+
- `text`: Text content search with optional tag filtering (e.g., `{text: "Click me", tag: "button"}`)
|
|
49
|
+
- **Intelligent Resolution**: Parallel CSS resolution, sequential role matching, automatic fallback
|
|
50
|
+
- **Multiple Match Handling**: When multiple elements match, returns candidate list for LLM selection
|
|
51
|
+
- **HTML Inspection**: New `browser_inspect_html` tool for intelligent content extraction with depth control
|
|
42
52
|
|
|
43
53
|
### Requirements
|
|
44
54
|
- Node.js 18 or newer
|
|
@@ -213,9 +223,6 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
213
223
|
--config <path> path to the configuration file.
|
|
214
224
|
--device <device> device to emulate, for example: "iPhone 15"
|
|
215
225
|
--executable-path <path> path to the browser executable.
|
|
216
|
-
--extension Connect to a running browser instance
|
|
217
|
-
(Edge/Chrome only). Requires the "Playwright MCP
|
|
218
|
-
Bridge" browser extension to be installed.
|
|
219
226
|
--headless run browser in headless mode, headed by default
|
|
220
227
|
--host <host> host to bind server to. Default is localhost. Use
|
|
221
228
|
0.0.0.0 to bind to all interfaces.
|
|
@@ -452,24 +459,23 @@ http.createServer(async (req, res) => {
|
|
|
452
459
|
|
|
453
460
|
- **browser_batch_execute**
|
|
454
461
|
- Title: Batch Execute Browser Actions
|
|
455
|
-
- Description: Execute multiple browser actions in sequence
|
|
462
|
+
- Description: Execute multiple browser actions in sequence. PREFER over individual tools for 2+ operations.
|
|
456
463
|
- Parameters:
|
|
457
|
-
- `steps` (array): Array of steps to execute in sequence
|
|
464
|
+
- `steps` (array): Array of steps to execute in sequence. Recommended for form filling (multiple type→click), multi-step navigation, any workflow with 2+ known steps. Saves 90% tokens vs individual calls. Example: [{tool:"browser_navigate",arguments:{url:"https://example.com"}},{tool:"browser_type",arguments:{selectors:[{css:"#user"}],text:"john"}},{tool:"browser_click",arguments:{selectors:[{css:"#btn"}]}}]
|
|
458
465
|
- `stopOnFirstError` (boolean, optional): Stop entire batch on first error
|
|
459
|
-
- `globalExpectation` (optional): Default expectation for all steps
|
|
466
|
+
- `globalExpectation` (optional): Default expectation for all steps. Recommended: {includeSnapshot:false,snapshotOptions:{selector:"#app"},diffOptions:{enabled:true}}. Per-step override with steps[].expectation
|
|
460
467
|
- Read-only: **false**
|
|
461
468
|
|
|
462
469
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
463
470
|
|
|
464
471
|
- **browser_click**
|
|
465
|
-
- Title:
|
|
466
|
-
- Description: Perform click on web page
|
|
472
|
+
- Title: Perform click on web page
|
|
473
|
+
- Description: Perform click on web page
|
|
467
474
|
- Parameters:
|
|
468
|
-
- `
|
|
469
|
-
- `
|
|
470
|
-
- `
|
|
471
|
-
- `
|
|
472
|
-
- `expectation` (object, optional): undefined
|
|
475
|
+
- `selectors` (array): Array of element selectors (max 5). Selectors are tried in order until one succeeds (fallback mechanism). Multiple matches trigger an error with candidate list. Supports: ref (highest priority), CSS (#id, .class, tag), role (button, textbox, etc.), text content. Example: [{css: "#submit"}, {role: "button", text: "Submit"}] - tries ID first, falls back to role+text
|
|
476
|
+
- `doubleClick` (boolean, optional): Double-click if true
|
|
477
|
+
- `button` (string, optional): Mouse button (default: left)
|
|
478
|
+
- `expectation` (object, optional): Page state capture config. Use batch_execute for multi-clicks
|
|
473
479
|
- Read-only: **false**
|
|
474
480
|
|
|
475
481
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
@@ -485,7 +491,8 @@ http.createServer(async (req, res) => {
|
|
|
485
491
|
- **browser_console_messages**
|
|
486
492
|
- Title: Get console messages
|
|
487
493
|
- Description: Returns all console messages
|
|
488
|
-
- Parameters:
|
|
494
|
+
- Parameters:
|
|
495
|
+
- `consoleOptions` (object, optional): undefined
|
|
489
496
|
- Read-only: **true**
|
|
490
497
|
|
|
491
498
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
@@ -510,35 +517,32 @@ http.createServer(async (req, res) => {
|
|
|
510
517
|
|
|
511
518
|
- **browser_drag**
|
|
512
519
|
- Title: Drag mouse
|
|
513
|
-
- Description: Perform drag and drop between two elements
|
|
520
|
+
- Description: Perform drag and drop between two elements
|
|
514
521
|
- Parameters:
|
|
515
|
-
- `
|
|
516
|
-
- `
|
|
517
|
-
- `
|
|
518
|
-
- `endRef` (string): Exact target element reference from the page snapshot
|
|
519
|
-
- `expectation` (object, optional): undefined
|
|
522
|
+
- `startSelectors` (array): Source element selectors for drag start
|
|
523
|
+
- `endSelectors` (array): Target element selectors for drag end
|
|
524
|
+
- `expectation` (object, optional): Page state after drag. Use batch_execute for workflows
|
|
520
525
|
- Read-only: **false**
|
|
521
526
|
|
|
522
527
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
523
528
|
|
|
524
529
|
- **browser_evaluate**
|
|
525
530
|
- Title: Evaluate JavaScript
|
|
526
|
-
- Description: Evaluate JavaScript expression on page or element
|
|
531
|
+
- Description: Evaluate JavaScript expression on page or element and return result
|
|
527
532
|
- Parameters:
|
|
528
|
-
- `function` (string): () => {
|
|
529
|
-
- `
|
|
530
|
-
- `
|
|
531
|
-
- `expectation` (object, optional): undefined
|
|
533
|
+
- `function` (string): JS function: () => {...} or (element) => {...}
|
|
534
|
+
- `selectors` (array, optional): Optional element selectors. If provided, function receives element as parameter
|
|
535
|
+
- `expectation` (object, optional): Page state config. false for data extraction, true for DOM changes
|
|
532
536
|
- Read-only: **false**
|
|
533
537
|
|
|
534
538
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
535
539
|
|
|
536
540
|
- **browser_file_upload**
|
|
537
541
|
- Title: Upload files
|
|
538
|
-
- Description: Upload one or multiple files to file input
|
|
542
|
+
- Description: Upload one or multiple files to file input
|
|
539
543
|
- Parameters:
|
|
540
|
-
- `paths` (array):
|
|
541
|
-
- `expectation` (object, optional):
|
|
544
|
+
- `paths` (array): Absolute paths to upload (array)
|
|
545
|
+
- `expectation` (object, optional): Page state config. Use batch_execute for click→upload
|
|
542
546
|
- Read-only: **false**
|
|
543
547
|
|
|
544
548
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
@@ -560,74 +564,93 @@ http.createServer(async (req, res) => {
|
|
|
560
564
|
|
|
561
565
|
- **browser_handle_dialog**
|
|
562
566
|
- Title: Handle a dialog
|
|
563
|
-
- Description: Handle a dialog(alert,confirm,prompt)
|
|
567
|
+
- Description: Handle a dialog (alert, confirm, prompt)
|
|
564
568
|
- Parameters:
|
|
565
|
-
- `accept` (boolean):
|
|
566
|
-
- `promptText` (string, optional):
|
|
567
|
-
- `expectation` (object, optional):
|
|
569
|
+
- `accept` (boolean): Accept (true) or dismiss (false)
|
|
570
|
+
- `promptText` (string, optional): Text for prompt dialogs
|
|
571
|
+
- `expectation` (object, optional): Page state after dialog. Use batch_execute for workflows
|
|
568
572
|
- Read-only: **false**
|
|
569
573
|
|
|
570
574
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
571
575
|
|
|
572
576
|
- **browser_hover**
|
|
573
577
|
- Title: Hover mouse
|
|
574
|
-
- Description: Hover over element on page
|
|
578
|
+
- Description: Hover over element on page
|
|
575
579
|
- Parameters:
|
|
576
|
-
- `
|
|
577
|
-
- `
|
|
578
|
-
|
|
580
|
+
- `selectors` (array): Array of element selectors (max 5). Selectors are tried in order until one succeeds (fallback mechanism). Multiple matches trigger an error with candidate list. Supports: ref (highest priority), CSS (#id, .class, tag), role (button, textbox, etc.), text content. Example: [{css: "#submit"}, {role: "button", text: "Submit"}] - tries ID first, falls back to role+text
|
|
581
|
+
- `expectation` (object, optional): Page state after hover. Use batch_execute for hover→click
|
|
582
|
+
- Read-only: **true**
|
|
583
|
+
|
|
584
|
+
<!-- NOTE: This has been generated via update-readme.js -->
|
|
585
|
+
|
|
586
|
+
- **browser_inspect_html**
|
|
587
|
+
- Title: HTML inspection
|
|
588
|
+
- Description: Extract and analyze HTML content from web pages with intelligent filtering and size control. Optimized for LLM consumption with configurable depth, format options, and automatic truncation.
|
|
589
|
+
- Parameters:
|
|
590
|
+
- `selectors` (array): Array of element selectors to inspect
|
|
591
|
+
- `depth` (number, optional): Maximum hierarchy depth to extract
|
|
592
|
+
- `includeStyles` (boolean, optional): Include computed CSS styles
|
|
593
|
+
- `maxSize` (number, optional): Maximum size in bytes (1KB-500KB)
|
|
594
|
+
- `format` (string, optional): Output format
|
|
595
|
+
- `includeAttributes` (boolean, optional): Include element attributes
|
|
596
|
+
- `preserveWhitespace` (boolean, optional): Preserve whitespace in content
|
|
597
|
+
- `excludeSelector` (string, optional): CSS selector to exclude elements
|
|
598
|
+
- `includeSuggestions` (boolean, optional): Include CSS selector suggestions in output
|
|
599
|
+
- `includeChildren` (boolean, optional): Include child elements in extraction
|
|
600
|
+
- `optimizeForLLM` (boolean, optional): Optimize extracted HTML for LLM consumption
|
|
601
|
+
- `expectation` (object, optional): Page state config (minimal for HTML inspection)
|
|
579
602
|
- Read-only: **true**
|
|
580
603
|
|
|
581
604
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
582
605
|
|
|
583
606
|
- **browser_navigate**
|
|
584
607
|
- Title: Navigate to a URL
|
|
585
|
-
- Description: Navigate to a URL
|
|
608
|
+
- Description: Navigate to a URL
|
|
586
609
|
- Parameters:
|
|
587
610
|
- `url` (string): The URL to navigate to
|
|
588
|
-
- `expectation` (object, optional):
|
|
611
|
+
- `expectation` (object, optional): Page state after navigation
|
|
589
612
|
- Read-only: **false**
|
|
590
613
|
|
|
591
614
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
592
615
|
|
|
593
616
|
- **browser_navigate_back**
|
|
594
|
-
- Title: Go back
|
|
595
|
-
- Description: Go back to previous page
|
|
617
|
+
- Title: Go back to previous page
|
|
618
|
+
- Description: Go back to previous page
|
|
596
619
|
- Parameters:
|
|
597
|
-
- `expectation` (object, optional):
|
|
620
|
+
- `expectation` (object, optional): Page state after going back
|
|
598
621
|
- Read-only: **true**
|
|
599
622
|
|
|
600
623
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
601
624
|
|
|
602
625
|
- **browser_navigate_forward**
|
|
603
|
-
- Title: Go forward
|
|
604
|
-
- Description: Go forward to next page
|
|
626
|
+
- Title: Go forward to next page
|
|
627
|
+
- Description: Go forward to next page
|
|
605
628
|
- Parameters:
|
|
606
|
-
- `expectation` (object, optional):
|
|
629
|
+
- `expectation` (object, optional): Page state after going forward
|
|
607
630
|
- Read-only: **true**
|
|
608
631
|
|
|
609
632
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
610
633
|
|
|
611
634
|
- **browser_network_requests**
|
|
612
635
|
- Title: List network requests
|
|
613
|
-
- Description: Returns network requests since loading the page with optional filtering
|
|
636
|
+
- Description: Returns network requests since loading the page with optional filtering
|
|
614
637
|
- Parameters:
|
|
615
|
-
- `urlPatterns` (array, optional): URL patterns to
|
|
616
|
-
- `excludeUrlPatterns` (array, optional): URL patterns to exclude (
|
|
617
|
-
- `statusRanges` (array, optional): Status code ranges
|
|
618
|
-
- `methods` (array, optional): HTTP methods to filter
|
|
619
|
-
- `maxRequests` (number, optional):
|
|
620
|
-
- `newestFirst` (boolean, optional):
|
|
638
|
+
- `urlPatterns` (array, optional): URL patterns to filter (supports regex)
|
|
639
|
+
- `excludeUrlPatterns` (array, optional): URL patterns to exclude (takes precedence)
|
|
640
|
+
- `statusRanges` (array, optional): Status code ranges (e.g., [{min:200,max:299}])
|
|
641
|
+
- `methods` (array, optional): HTTP methods to filter
|
|
642
|
+
- `maxRequests` (number, optional): Max requests to return (default: 20)
|
|
643
|
+
- `newestFirst` (boolean, optional): Order by timestamp (default: newest first)
|
|
621
644
|
- Read-only: **true**
|
|
622
645
|
|
|
623
646
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
624
647
|
|
|
625
648
|
- **browser_press_key**
|
|
626
649
|
- Title: Press a key
|
|
627
|
-
- Description: Press a key on the keyboard
|
|
650
|
+
- Description: Press a key on the keyboard
|
|
628
651
|
- Parameters:
|
|
629
|
-
- `key` (string):
|
|
630
|
-
- `expectation` (object, optional):
|
|
652
|
+
- `key` (string): Key to press
|
|
653
|
+
- `expectation` (object, optional): Page state config. Use batch_execute for multiple keys
|
|
631
654
|
- Read-only: **false**
|
|
632
655
|
|
|
633
656
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
@@ -645,61 +668,58 @@ http.createServer(async (req, res) => {
|
|
|
645
668
|
|
|
646
669
|
- **browser_select_option**
|
|
647
670
|
- Title: Select option
|
|
648
|
-
- Description: Select option in dropdown
|
|
671
|
+
- Description: Select option in dropdown
|
|
649
672
|
- Parameters:
|
|
650
|
-
- `
|
|
651
|
-
- `
|
|
652
|
-
- `
|
|
653
|
-
- `expectation` (object, optional): undefined
|
|
673
|
+
- `selectors` (array): Array of element selectors (max 5). Selectors are tried in order until one succeeds (fallback mechanism). Multiple matches trigger an error with candidate list. Supports: ref (highest priority), CSS (#id, .class, tag), role (button, textbox, etc.), text content. Example: [{css: "#submit"}, {role: "button", text: "Submit"}] - tries ID first, falls back to role+text
|
|
674
|
+
- `values` (array): Values to select (array)
|
|
675
|
+
- `expectation` (object, optional): Page state after selection. Use batch_execute for forms
|
|
654
676
|
- Read-only: **false**
|
|
655
677
|
|
|
656
678
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
657
679
|
|
|
658
680
|
- **browser_snapshot**
|
|
659
681
|
- Title: Page snapshot
|
|
660
|
-
- Description: Capture accessibility snapshot of current page
|
|
682
|
+
- Description: Capture accessibility snapshot of current page
|
|
661
683
|
- Parameters:
|
|
662
|
-
- `expectation` (object, optional):
|
|
684
|
+
- `expectation` (object, optional): Page state config
|
|
663
685
|
- Read-only: **true**
|
|
664
686
|
|
|
665
687
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
666
688
|
|
|
667
689
|
- **browser_take_screenshot**
|
|
668
690
|
- Title: Take a screenshot
|
|
669
|
-
- Description: Take a screenshot of current page
|
|
691
|
+
- Description: Take a screenshot of current page and return image data
|
|
670
692
|
- Parameters:
|
|
671
693
|
- `type` (string, optional): Image format for the screenshot. Default is png.
|
|
672
694
|
- `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified.
|
|
673
|
-
- `
|
|
674
|
-
- `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.
|
|
695
|
+
- `selectors` (array, optional): Optional element selectors for element screenshots. If not provided, viewport screenshot will be taken.
|
|
675
696
|
- `fullPage` (boolean, optional): When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.
|
|
676
|
-
- `expectation` (object, optional):
|
|
697
|
+
- `expectation` (object, optional): Additional page state config
|
|
677
698
|
- Read-only: **true**
|
|
678
699
|
|
|
679
700
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
680
701
|
|
|
681
702
|
- **browser_type**
|
|
682
703
|
- Title: Type text
|
|
683
|
-
- Description: Type text into editable element
|
|
704
|
+
- Description: Type text into editable element
|
|
684
705
|
- Parameters:
|
|
685
|
-
- `
|
|
686
|
-
- `ref` (string): Exact target element reference from the page snapshot
|
|
706
|
+
- `selectors` (array): Array of element selectors (max 5) supporting ref, role, CSS, or text-based selection
|
|
687
707
|
- `text` (string): Text to type into the element
|
|
688
|
-
- `submit` (boolean, optional):
|
|
689
|
-
- `slowly` (boolean, optional):
|
|
690
|
-
- `expectation` (object, optional):
|
|
708
|
+
- `submit` (boolean, optional): Press Enter after typing if true
|
|
709
|
+
- `slowly` (boolean, optional): Type slowly for auto-complete if true
|
|
710
|
+
- `expectation` (object, optional): Page state config. Use batch_execute for forms
|
|
691
711
|
- Read-only: **false**
|
|
692
712
|
|
|
693
713
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
694
714
|
|
|
695
715
|
- **browser_wait_for**
|
|
696
716
|
- Title: Wait for
|
|
697
|
-
- Description: Wait for text to appear
|
|
717
|
+
- Description: Wait for text to appear or disappear or a specified time to pass
|
|
698
718
|
- Parameters:
|
|
699
|
-
- `time` (number, optional):
|
|
700
|
-
- `text` (string, optional):
|
|
701
|
-
- `textGone` (string, optional):
|
|
702
|
-
- `expectation` (object, optional):
|
|
719
|
+
- `time` (number, optional): Wait time in seconds
|
|
720
|
+
- `text` (string, optional): undefined
|
|
721
|
+
- `textGone` (string, optional): undefined
|
|
722
|
+
- `expectation` (object, optional): Page state after wait
|
|
703
723
|
- Read-only: **true**
|
|
704
724
|
|
|
705
725
|
</details>
|
|
@@ -710,39 +730,39 @@ http.createServer(async (req, res) => {
|
|
|
710
730
|
|
|
711
731
|
- **browser_tab_close**
|
|
712
732
|
- Title: Close a tab
|
|
713
|
-
- Description: Close a tab
|
|
733
|
+
- Description: Close a tab by index or close current tab
|
|
714
734
|
- Parameters:
|
|
715
|
-
- `index` (number, optional):
|
|
716
|
-
- `expectation` (object, optional):
|
|
735
|
+
- `index` (number, optional): Tab index to close (omit for current)
|
|
736
|
+
- `expectation` (object, optional): Page state after close
|
|
717
737
|
- Read-only: **false**
|
|
718
738
|
|
|
719
739
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
720
740
|
|
|
721
741
|
- **browser_tab_list**
|
|
722
742
|
- Title: List tabs
|
|
723
|
-
- Description: List browser tabs
|
|
743
|
+
- Description: List browser tabs with titles and URLs
|
|
724
744
|
- Parameters:
|
|
725
|
-
- `expectation` (object, optional):
|
|
745
|
+
- `expectation` (object, optional): Page state config
|
|
726
746
|
- Read-only: **true**
|
|
727
747
|
|
|
728
748
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
729
749
|
|
|
730
750
|
- **browser_tab_new**
|
|
731
751
|
- Title: Open a new tab
|
|
732
|
-
- Description: Open a new tab
|
|
752
|
+
- Description: Open a new tab
|
|
733
753
|
- Parameters:
|
|
734
|
-
- `url` (string, optional):
|
|
735
|
-
- `expectation` (object, optional):
|
|
754
|
+
- `url` (string, optional): URL for new tab (optional)
|
|
755
|
+
- `expectation` (object, optional): Page state of new tab
|
|
736
756
|
- Read-only: **true**
|
|
737
757
|
|
|
738
758
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
739
759
|
|
|
740
760
|
- **browser_tab_select**
|
|
741
761
|
- Title: Select a tab
|
|
742
|
-
- Description: Select a tab by index
|
|
762
|
+
- Description: Select a tab by index
|
|
743
763
|
- Parameters:
|
|
744
764
|
- `index` (number): The index of the tab to select
|
|
745
|
-
- `expectation` (object, optional):
|
|
765
|
+
- `expectation` (object, optional): Page state after tab switch
|
|
746
766
|
- Read-only: **true**
|
|
747
767
|
|
|
748
768
|
</details>
|
|
@@ -765,26 +785,26 @@ http.createServer(async (req, res) => {
|
|
|
765
785
|
|
|
766
786
|
- **browser_mouse_click_xy**
|
|
767
787
|
- Title: Click
|
|
768
|
-
- Description: Click at specific coordinates
|
|
788
|
+
- Description: Click at specific coordinates
|
|
769
789
|
- Parameters:
|
|
770
790
|
- `element` (string): undefined
|
|
771
|
-
- `x` (number): X coordinate
|
|
772
|
-
- `y` (number): Y coordinate
|
|
773
|
-
- `expectation` (object, optional):
|
|
791
|
+
- `x` (number): X coordinate (requires --caps=vision)
|
|
792
|
+
- `y` (number): Y coordinate (requires --caps=vision)
|
|
793
|
+
- `expectation` (object, optional): Page state after click. Prefer element ref over coords
|
|
774
794
|
- Read-only: **false**
|
|
775
795
|
|
|
776
796
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
777
797
|
|
|
778
798
|
- **browser_mouse_drag_xy**
|
|
779
799
|
- Title: Drag mouse
|
|
780
|
-
- Description: Drag from one coordinate to another
|
|
800
|
+
- Description: Drag from one coordinate to another
|
|
781
801
|
- Parameters:
|
|
782
802
|
- `element` (string): undefined
|
|
783
|
-
- `startX` (number): Start X
|
|
784
|
-
- `startY` (number): Start Y
|
|
785
|
-
- `endX` (number): End X
|
|
786
|
-
- `endY` (number): End Y
|
|
787
|
-
- `expectation` (object, optional):
|
|
803
|
+
- `startX` (number): Start X (requires --caps=vision)
|
|
804
|
+
- `startY` (number): Start Y (requires --caps=vision)
|
|
805
|
+
- `endX` (number): End X
|
|
806
|
+
- `endY` (number): End Y
|
|
807
|
+
- `expectation` (object, optional): Page state after drag. Prefer element refs over coords
|
|
788
808
|
- Read-only: **false**
|
|
789
809
|
|
|
790
810
|
<!-- NOTE: This has been generated via update-readme.js -->
|
|
@@ -119,7 +119,8 @@ class PageAnalyzer extends DiagnosticBase {
|
|
|
119
119
|
}
|
|
120
120
|
async updateFrameMetadata(frame) {
|
|
121
121
|
try {
|
|
122
|
-
const
|
|
122
|
+
const elements = await frame.$$("*");
|
|
123
|
+
const elementCount = elements.length;
|
|
123
124
|
this.frameManager.updateElementCount(frame, elementCount);
|
|
124
125
|
} catch {}
|
|
125
126
|
}
|