Giter Site home page Giter Site logo

Comments (12)

michallepicki avatar michallepicki commented on May 4, 2024 4

Update: @jangromko is working on adding some touch support to Wallaby, we're basing the API on what's available in Selenium WebDriver Wire Protocol and what works in Chrome (doesn't work in Firefox for some reason). Expect a PR with tests + new commands in a few weeks (similar to #453 )

from wallaby.

keathley avatar keathley commented on May 4, 2024

What sort of api were you thinking about for this? I'd be interested to see a sample implementation. Otherwise if this is an issue you're facing right now you can always use execute_script/2 and just do drag and drop directly with JS.

from wallaby.

zolrath avatar zolrath commented on May 4, 2024

I would think it would be nice to separate the drag and drop actions to allow partial application for reuse.

session
|> drag("#garbage")
|> drop("#trash")

This way you could save off everything before the drop into a function and call it with a new drop target easily for multiple tests.

from wallaby.

keathley avatar keathley commented on May 4, 2024

I think the way we'd have to do this is with the perform actions endpoint: https://www.w3.org/TR/webdriver/#dfn-perform-actions.

We'd have to construct the list of actions internally and then execute them. I'm not sure what the level of effort would be to construct the actions since I'm not exactly sure what format the actions have to be in or if they would work with our existing functionality.

from wallaby.

michallepicki avatar michallepicki commented on May 4, 2024

Selenium JSON Wire Protocol has some touch-related commands (see Selenium Wiki) and I am currently using touch_scroll like this:


  def touch_scroll(session, element, x_offset, y_offset) do
    {:ok, _} =
      request(:post, "#{session.url}/touch/scroll", %{
        element: element.id,
        xoffset: x_offset,
        yoffset: y_offset
      })

    session
  end

  def touch_scroll(session, x_offset, y_offset) do
    {:ok, _} =
      request(:post, "#{session.url}/touch/scroll", %{xoffset: x_offset, yoffset: y_offset})

    session
  end

We could look into whether this is also supported on chromedriver and add these commands to Wallaby

from wallaby.

keathley avatar keathley commented on May 4, 2024

That sounds good to me. I believe that chromedriver had something similar so we can probably take advantage of that.

from wallaby.

oliverswitzer avatar oliverswitzer commented on May 4, 2024

@michallepicki just checking -- was any progress made on this?

from wallaby.

michallepicki avatar michallepicki commented on May 4, 2024

There is a stale PR by @jangromko , needs to be updated: #480 - @oliverswitzer is this something you'd want to pick up?

edit: Looks like @jangromko updated the PR and there are no conflicts now.
edit2: This was released in Wallaby 0.28 :)

from wallaby.

michallepicki avatar michallepicki commented on May 4, 2024

@mhanberg I think this can be closed?

from wallaby.

mhanberg avatar mhanberg commented on May 4, 2024

@michallepicki @jangromko were you ever able to get drag and drop working with the touch commands?

from wallaby.

michallepicki avatar michallepicki commented on May 4, 2024

@mhanberg I think there are different use cases, for some you want the touch commands (naming from Wallaby.WebdriverClient) like touch_down + touch_move + touch_up, but for just drag and drop the first PR linked in this issue added regular mouse events support. So there are button_down + move_mouse_to + button_up that can be used for drag and drop. Should be still working since integration tests were added?

from wallaby.

mhanberg avatar mhanberg commented on May 4, 2024

We are trying to do it at work currently, and it is not working, but I was wondering if it has something to do with the JS api we are using to accomplish it.

I also noticed that Capybara still uses some JS to do drag and drop, so I was wondering if it actually worked without the JS haha.

Thanks for the response, I'll take a closer look at our tests.

from wallaby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.