简体   繁体   中英

Clic and slide at the same time - Protractor

Hello the community !

I'm coding a test for e2e, and I would like to slide the right circle to the extreme left for testing the price tool on my website.

I would like to click and slide the slider at the same time (check on picture).

The problem is that for sliding, the mouse has to be on the slide during all the action with the click activate.

I would like to know how to do it with Protractor :)

Thank you !!! Price slider

I have had one of these sliders in one of my projects, and I did it via simple drag and drop code. Here is the one that I used (thanks alecxe for this)

   var slider = element(by.id('slider'));

   browser.actions().dragAndDrop(
      slider,
      {x:100, y:0}
      ).perform();

where x,y are the coordinates to which I have to move the slider.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM