Commit Graph

7 Commits

Author SHA1 Message Date
reformedot 97deba7bb8 refactor: update agent focus handling and CDP session retrieval to fix tests 2025-11-11 12:57:35 -08:00
Magnus Müller c3db6cff02 Refactor cross-origin iframe handling in tests and serializer
- Updated the DOMTreeSerializer to remove debug code related to cross-origin iframe detection, enhancing clarity and maintainability.
- Adjusted test cases to replace the cross-origin iframe source with a placeholder (about:blank) for improved test isolation and reliability.
- Updated comments and descriptions in tests to reflect the changes in iframe handling, ensuring accurate documentation of test behavior.

This change aims to streamline the handling of cross-origin iframes in both the serializer and tests, improving overall robustness and maintainability.
2025-10-27 17:19:03 -07:00
Magnus Müller 3ad835a311 Linter 2025-10-27 00:00:32 -07:00
Magnus Müller 04e987df99 Add stacked DOM elements test for complex scenarios
- Introduced a new HTML template for testing stacked DOM elements, including open and closed shadow DOMs, same-origin and cross-origin iframes, and a final button.
- Implemented a test case to validate click functionality through these stacked elements, ensuring that all interactive elements are clickable and that the click counter reflects the expected number of clicks.
- Enhanced the browser session configuration to accommodate a taller window size for better visibility of stacked elements.

This update aims to improve the robustness of DOM interaction tests and ensure comprehensive coverage of complex scenarios in the browser automation framework.
2025-10-26 23:16:06 -07:00
Magnus Müller 4258546098 Add DOM serializer test templates and improve logging
- Introduced new HTML templates for DOM serializer tests, including a main page and an iframe template.
- Enhanced logging in the BrowserSession to provide clearer insights when fetching the CDP client for target nodes, improving traceability during debugging.
- Updated tests to utilize the new HTML templates, ensuring better structure and maintainability.

This update aims to enhance the robustness of the DOM serializer tests and improve error handling in session management.
2025-10-26 22:44:42 -07:00
Magnus Müller adcac19259 Fix test to properly check for click failures
- Added check for failure messages in extracted_content
- Now catches both error field and 'not available'/'failed' in content
- Test will now fail in CI as expected, revealing click issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 21:39:15 -07:00
Magnus Müller f09df1a326 Add DOM serializer test with shadow DOM, iframes, and click functionality
- Tests DOM serializer extracts elements from:
  - Regular DOM (buttons, inputs, links)
  - Shadow DOM (elements inside shadow roots)
  - Same-origin iframes
  - Cross-origin iframes
- Tests clicking elements using tools.click(index) for each category
- Test fails if clicks don't work (currently failing - needs fix)
- Verifies 12 total interactive elements are found

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:34:50 -07:00