Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use css selector instead of xpath #551

Merged
merged 1 commit into from
Jul 4, 2024
Merged

use css selector instead of xpath #551

merged 1 commit into from
Jul 4, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Jul 4, 2024

🚀 This description was created by Ellipsis for commit fe76bd7

Summary:

Replaced XPath selectors with CSS selectors across the codebase for consistency and improved handling.

Key points:

  • Replaced xpath with css selectors in skyvern/exceptions.py for MissingElement and MultipleElementsFound exceptions.
  • Updated skyvern/forge/agent.py to use id_to_css_dict instead of id_to_xpath_dict for artifact creation.
  • Modified skyvern/forge/sdk/artifact/models.py to deprecate VISIBLE_ELEMENTS_ID_XPATH_MAP and introduce VISIBLE_ELEMENTS_ID_CSS_MAP.
  • Adjusted skyvern/forge/sdk/artifact/storage/base.py to map VISIBLE_ELEMENTS_ID_CSS_MAP to json.
  • Refactored skyvern/webeye/actions/handler.py to use CSS selectors in various action handlers (handle_click_action, handle_input_text_action, etc.).
  • Updated skyvern/webeye/scraper/scraper.py to build id_to_css_dict instead of id_to_xpath_dict.
  • Changed resolve_locator function in skyvern/webeye/utils/dom.py to use CSS selectors.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to fe76bd7 in 52 seconds

More details
  • Looked at 644 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/agent.py:966
  • Draft comment:
    The PR description and comments do not provide a rationale for the change from XPATH to CSS selectors. This change could potentially impact how elements are located and interacted with throughout the application. It's crucial to ensure that this change aligns with the overall design and functionality of the application.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_MUko2A87RY6TeFyJ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@LawyZheng LawyZheng merged commit cd0d563 into main Jul 4, 2024
2 checks passed
@LawyZheng LawyZheng deleted the use-css-selector branch July 4, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant