How to use the wd.MultiAction function in wd

To help you get started, we’ve selected a few wd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium / sample-code / examples / node / android-complex.js View on Github external
.moveTo({x:3, y:-1})
          .moveTo({x:3, y:-1})
          .moveTo({x:3, y:-1})
          .moveTo({x:2, y:-1})
          .moveTo({x:2, y:-1})
          .moveTo({x:2, y:-1})
          .moveTo({x:2, y:-1})
          .moveTo({x:2, y:-1})
          .moveTo({x:1, y:-1})
          .moveTo({x:1, y:-1})
          .moveTo({x:1, y:-1})
          .moveTo({x:1, y:-1})
          .moveTo({x:1, y:-1})
          .release();

        var ma = new wd.MultiAction().add(a1, a2, smile);
        return driver.performMultiAction(ma)
          // so you can see it
          .sleep(10000)
          .back().sleep(1000)
          .back().sleep(1000);
      });
  });
github appium / appium / test / functional / ios / testapp / touch-specs.js View on Github external
.then(function (el) {
          var multiAction = (new MultiAction()).add(
            (new TouchAction()).press({el: el}).moveTo({el: el, x: 25, y: 25 })
              .wait(3000).moveTo({el: el, x: 100, y: 100 }).release(),
            (new TouchAction()).press({el: el}).moveTo({el: el, x: 100, y: 0 })
              .wait({ ms: 3000 }).moveTo({el: el, x: 0, y: 0 }).release()
          );
          return driver.performMultiAction(multiAction);
        })
        .nodeify(done);
github appium / appium-uiautomator2-driver / test / functional / commands / touch-action-e2e-specs.js View on Github external
it('should scroll two different lists', async function () {
      let [leftEl, rightEl] = await driver.elementsByClassName('android.widget.ListView');

      const leftGesture = new wd.TouchAction()
        .press({element: leftEl})
        .moveTo({element: leftEl, x: 10, y: 0})
        .moveTo({element: leftEl, x: 10, y: -75})
        .moveTo({element: leftEl, x: 10, y: -150});

      const rightGesture = new wd.TouchAction()
        .press({element: rightEl})
        .moveTo({element: rightEl, x: 10, y: 0})
        .moveTo({element: rightEl, x: 10, y: -75})
        .moveTo({element: rightEl, x: 10, y: -150});

      const multiAction = new wd.MultiAction();
      multiAction.add(leftGesture, rightGesture);

      await driver.performMultiAction(multiAction);
    });
  });
github appium / appium-xcuitest-driver / test / functional / basic / gesture-e2e-specs.js View on Github external
async function doZoom () {
          let el = await driver.elementByClassName('XCUIElementTypeApplication');
          let thumb = new wd.TouchAction(driver);
          thumb.press({el, x: 100, y: 0}).moveTo({el, x: 50, y: 0}).release();

          let foreFinger = new wd.TouchAction(driver);
          foreFinger.press({el, x: 100, y: 0}).moveTo({el, x: 105, y: 0}).release();

          let zoom = new wd.MultiAction(driver);
          zoom.add(thumb, foreFinger);
          await zoom.perform();
        }
        await doZoom();
github appium / appium-xcuitest-driver / test / functional / basic / gesture-e2e-specs.js View on Github external
async function doPinch () {
          let el = await driver.elementByClassName('XCUIElementTypeApplication');
          let thumb = new wd.TouchAction(driver);
          thumb.press({el, x: 50, y: 0}).moveTo({el, x: 100, y: 0}).release();

          let foreFinger = new wd.TouchAction(driver);
          foreFinger.press({el, x: 100, y: 0}).moveTo({el, x: 50, y: 0}).release();

          let pinch = new wd.MultiAction(driver);
          pinch.add(thumb, foreFinger);
          await pinch.perform();
        }
        await doPinch();
github appium / appium / sample-code / examples / node / ios-actions.js View on Github external
.then(function (el) {
            var a1 = new wd.TouchAction();
            a1
              .tap({el: el, x: 10, y: 10});
            var a2 = new wd.TouchAction();
            a2
              .tap({el: el});
            var m = new wd.MultiAction();
            m.add(a1, a2);
            return driver.performMultiAction(m);
          });
      })
github Jonahss / appium-draws-its-logo / main.js View on Github external
var innerArcMulti = function() {
  var multi = new MultiAction();
  multi.add(
    innerArcAction(2*pi/3*1 + pi/3, 2*pi/3*1 + pi + pi/8 + pi/3),
    innerArcAction(2*pi/3*2 + pi/3, 2*pi/3*2 + pi + pi/8 + pi/3),
    innerArcAction(2*pi/3*3 + pi/3, 2*pi/3*3 + pi + pi/8 + pi/3)
  );
  return multi;
}
github appium / appium / sample-code / examples / node / ios-actions.js View on Github external
.then(function (el) {
            var a1 = new wd.TouchAction();
            a1
              .tap({el: el, x: 10, y: 10});
            var a2 = new wd.TouchAction();
            a2
              .tap({el: el});
            var m = new wd.MultiAction(driver);
            m.add(a1, a2);
            return m.perform();
          });
      });
github appium / appium / sample-code / examples / node / helpers / actions.js View on Github external
]).then(function (res) {
    var size = res[0];
    var loc = res[1];
    var center = {
      x: loc.x + size.width / 2,
      y: loc.y + size.height / 2
    };
    var a1 = new wd.TouchAction(this);
    a1.press({el: el}).moveTo({el: el, x: center.x, y: center.y - 100}).release();
    var a2 = new wd.TouchAction(this);
    a2.press({el: el}).moveTo({el: el, x: center.x, y: center.y + 100}).release();
    var m = new wd.MultiAction(this);
    m.add(a1, a2);
    return m.perform();
  }.bind(this));
};