Move ion-item-sliding by Protractor

Hello. I trying to write e2e test for ion-item-sliding but can’t drag it.
None of next variant work for me:

  • mouseDown().mouseMove().mouseUp()
  • dragAndDrop()
  • tapAndHold().move()
    Do you have any recommendations? Maybe i don’t need to use protractor for ionic?

Solved. By crazy. Need to move mouse sloooower :slight_smile: then ionic will catch it.
You can’t just move mouse from some point to another, need to do it step by step:

      .mouseMove({x: -50, y: 0}) // yes, few times by 50 pixels, with single mouseMove ionic can't catch swipe event
      .mouseMove({x: -50, y: 0})
      .mouseMove({x: -50, y: 0})

This worked for me - thanks!

In case it can help someone else as it did not work for me:

        browser.executeScript('arguments[0].classList.add("active-slide", "active-options-right")', element(by.css('ion-item-sliding:nth-child(1)')).getWebElement());
        browser.executeScript('arguments[0].style.transform = "translate3d(-87px, 0px, 0px)"', element(by.css('ion-item-sliding:nth-child(1) > ion-item')).getWebElement());
  • The first browser.driver.sleep is necessary for the classes to be added
1 Like

It really made my day. Before it I had tried each and every solution, I knew or available on the internet. Thanks alot @loles34