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

refactor chain click #1186

Merged
merged 2 commits into from
Nov 13, 2024
Merged

refactor chain click #1186

merged 2 commits into from
Nov 13, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Nov 13, 2024

Important

Refactor chain_click in handler.py to enhance error handling and element interaction, adding new methods to SkyvernElement and SkyvernFrame for improved robustness.

  • Behavior:
    • Refactor chain_click in handler.py to improve error handling and element interaction.
    • Add error message parameter to FailToClick exception in exceptions.py.
    • Handle label elements, non-visible elements, and blocking elements in chain_click.
  • Element Handling:
    • Add is_visibile(), is_parent_of(), is_child_of(), and is_sibling_of() methods to SkyvernElement in dom.py.
    • Add get_blocking_element_id() and is_sibling() methods to SkyvernFrame in page.py.
  • JavaScript Enhancements:
    • Add isParent(), isSibling(), and getBlockElementUniqueID() functions in domUtils.js to support new element checks.

This description was created by Ellipsis for 41333d7. It will automatically update as commits are pushed.

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.

❌ Changes requested. Reviewed everything up to 1e08310 in 1 minute and 59 seconds

More details
  • Looked at 491 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. skyvern/webeye/actions/handler.py:1177
  • Draft comment:
    Typo in method name is_visibile. It should be is_visible. This typo is present in multiple files and should be corrected.
  • Reason this comment was not posted:
    Marked as duplicate.
2. skyvern/webeye/utils/dom.py:270
  • Draft comment:
        async def is_visible(self) -> bool:
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern/webeye/utils/page.py:182
  • Draft comment:
    Typo in method name is_visibile. It should be is_visible. This typo is present in multiple files and should be corrected.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_f51OoH3gMqrYmmCJ


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -263,6 266,22 @@ async def is_disabled(self, dynamic: bool = False) -> bool:
async def is_selectable(self) -> bool:
return self.get_selectable() or self.get_tag_name() in SELECTABLE_ELEMENT

async def is_visibile(self) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in method name is_visibile. It should be is_visible. This typo is present in multiple files and should be corrected.

Suggested change
async def is_visibile(self) -> bool:
async def is_visible(self) -> bool:

@@ -273,6 294,144 @@ function isElementVisible(element) {
return true;
}

// from playwright: https://github.com/microsoft/playwright/blob/1b65f26f0287c0352e76673bc5f85bc36c934b55/packages/playwright-core/src/server/injected/domUtils.ts#L121-L127
function isVisibleTextNode(node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The isVisibleTextNode function duplicates core logic from isElementVisible. Consider refactoring to use a shared utility function for visibility checks.

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! Incremental review on 41333d7 in 22 seconds

More details
  • Looked at 27 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/webeye/actions/handler.py:1179
  • Draft comment:
    The method name is_visibile was corrected to is_visible. Ensure this change is consistent across the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The method name was corrected from is_visibile to is_visible in two files. This is a simple typo fix and should be acknowledged.

Workflow ID: wflow_LUR5aYshySgZQ7q2


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

@LawyZheng LawyZheng merged commit d107c3d into main Nov 13, 2024
2 checks passed
@LawyZheng LawyZheng deleted the lawy/refactor-chain-click branch November 13, 2024 18:33
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