public void MultipleDragAndDrop() { var altElement1 = altUnityDriver.FindElement("Drag Image1"); var altElement2 = altUnityDriver.FindElement("Drop Box1"); altUnityDriver.Swipe(new Vector2(altElement1.x, altElement1.y), new Vector2(altElement2.x, altElement2.y), 1); altElement1 = altUnityDriver.FindElement("Drag Image2"); altElement2 = altUnityDriver.FindElement("Drop Box2"); altUnityDriver.Swipe(new Vector2(altElement1.x, altElement1.y), new Vector2(altElement2.x, altElement2.y), 2); altElement1 = altUnityDriver.FindElement("Drag Image3"); altElement2 = altUnityDriver.FindElement("Drop Box1"); altUnityDriver.Swipe(new Vector2(altElement1.x, altElement1.y), new Vector2(altElement2.x, altElement2.y), 2); altElement1 = altUnityDriver.FindElement("Drag Image1"); altElement2 = altUnityDriver.FindElement("Drop Box1"); altUnityDriver.Swipe(new Vector2(altElement1.x, altElement1.y), new Vector2(altElement2.x, altElement2.y), 3); Thread.Sleep(4000); var imageSource = altUnityDriver.FindElement("Drag Image1").GetComponentProperty("UnityEngine.UI.Image", "sprite"); var imageSourceDropZone = altUnityDriver.FindElement("Drop Image").GetComponentProperty("UnityEngine.UI.Image", "sprite"); Assert.AreNotEqual(imageSource, imageSourceDropZone); imageSource = altUnityDriver.FindElement("Drag Image2").GetComponentProperty("UnityEngine.UI.Image", "sprite"); imageSourceDropZone = altUnityDriver.FindElement("Drop").GetComponentProperty("UnityEngine.UI.Image", "sprite"); Assert.AreNotEqual(imageSource, imageSourceDropZone); }
public void MovePanel() { var altElement = altUnityDriver.FindElement("Drag Zone"); var position = new Vector2(altElement.x, altElement.y); altUnityDriver.Swipe(new Vector2(altElement.x, altElement.y), new Vector2(altElement.x + 200, altElement.y + 200), 2); Thread.Sleep(2000); altElement = altUnityDriver.FindElement("Drag Zone"); var position2 = new Vector2(altElement.x, altElement.y); Assert.AreNotEqual(position, position2); }