public void CheckTap(IPerformsTouchActions performer) { TouchAction t = new TouchAction(performer); t.Tap(accessibility); t.Perform(); MultiAction m = new MultiAction(performer); m.Add(new TouchAction(performer).Tap(customView)); m.Add(new TouchAction(performer).Tap(clickable)); m.Perform(); }
public void MultiActionTestCase () { IWebElement el = driver.FindElementByAccessibilityId ("ComputeSumButton"); ITouchAction a1 = new TouchAction(driver); a1.Tap(el, 10, 10); ITouchAction a2 = new TouchAction(driver); a2.Tap(el); IMultiAction m = new MultiAction (driver); m.Add (a1).Add (a2); m.Perform (); }
public void SimpleTouchActionTestCase() { IList<AppiumWebElement> els = driver.FindElementsByClassName("android.widget.TextView"); int number1 = els.Count; TouchAction tap = new TouchAction(driver); tap.Tap(els[4], 10, 5, 2).Perform(); els = driver.FindElementsByClassName("android.widget.TextView"); Assert.AreNotEqual(number1, els.Count); }
public void MultiActionTestCase() { driver.FindElementById ("TextField1").Clear(); driver.FindElementById ("TextField1").SendKeys ("2"); driver.FindElementById ("TextField2").Clear(); driver.FindElementById ("TextField2").SendKeys ("4"); IWebElement el = driver.FindElementByAccessibilityId("ComputeSumButton"); ITouchAction a1 = new TouchAction(driver); a1.Tap(el, 10, 10); ITouchAction a2 = new TouchAction(driver); a2.Tap(el); IMultiAction m = new MultiAction(driver); m.Add(a1).Add(a2); m.Perform(); const string str = "6"; Assert.AreEqual (driver.FindElementByXPath ("//*[@name = \"Answer\"]").Text, str); }
public void MultiActionTestCase() { IOSDriver<IWebElement> driver = new IOSDriver<IWebElement>(defaultUri, capabilities); RequestProcessor re = setupMultiAction(); IWebElement element = driver.FindElementByIosUIAutomation(".elements()"); MultiAction m = new MultiAction(driver); m.Perform(); Assert.AreEqual(re.inputData, ""); TouchAction a1 = new TouchAction(); a1 .Press(element, 100, 100) .Wait(1000) .Release(); m.Add(a1); m.Perform(); Assert.AreEqual(re.inputData, "{\"actions\":[[{\"action\":\"press\",\"options\":{\"element\":\"5\",\"x\":100,\"y\":100}},{\"action\":\"wait\",\"options\":{\"ms\":1000}},{\"action\":\"release\"}]]}"); TouchAction a2 = new TouchAction(); a2 .Tap(100, 100) .MoveTo(element); m.Add(a2); m.Perform(); Assert.AreEqual(re.inputData, "{\"actions\":[[{\"action\":\"press\",\"options\":{\"element\":\"5\",\"x\":100,\"y\":100}},{\"action\":\"wait\",\"options\":{\"ms\":1000}},{\"action\":\"release\"}],[{\"action\":\"tap\",\"options\":{\"x\":100,\"y\":100}},{\"action\":\"moveTo\",\"options\":{\"element\":\"5\"}}]]}"); }