selene icon indicating copy to clipboard operation
selene copied to clipboard

consider changing element.click() to def click(*, xoffset=None, yoffset=None)

Open yashaka opened this issue 1 year ago • 3 comments

subj :)

while implementing think on the following:

  • should work with Appium too
  • let's compare how is it implemented in playwright - can we steal some good ideas from it?
  • should we make such options of type: int | None, or is it enough to be int and just use 0 for same reason as None is used... kind of... do we really need None here? (to switch the implementation of the method between normal webelement.click() and actions.move_to_element_with_offset(...).click().perform()

yashaka avatar Feb 28 '24 21:02 yashaka

should not we then do the same with element.hover() ?

yashaka avatar Feb 28 '24 21:02 yashaka

Here's how Playwright does it:

# Click the top left corner
page.get_by_text("Item").click(position={ "x": 0, "y": 0})

– this does not help us much... nothing to follow... because it does not use offset from center, it uses absolute values starting from top left corner... and also using dict is far from perfect, because we have to use "more symbols" when writing :p

yashaka avatar Mar 03 '24 14:03 yashaka

implemented but yet not tested with Appium :)

yashaka avatar Mar 04 '24 18:03 yashaka