diff --git a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs index f762a51003..c117a99e7c 100644 --- a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs +++ b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs @@ -909,11 +909,11 @@ private void MobileDeviceActionHandler(ActMobileDevice act) break; case ActMobileDevice.eMobileDeviceAction.SwipeDown: - SwipeScreen(eSwipeSide.Down, 0.25); + SwipeScreen(eSwipeSide.Down, 1); break; case ActMobileDevice.eMobileDeviceAction.SwipeUp: - SwipeScreen(eSwipeSide.Up, 0.25); + SwipeScreen(eSwipeSide.Up, 1); break; case ActMobileDevice.eMobileDeviceAction.SwipeLeft: SwipeScreen(eSwipeSide.Left); @@ -1424,7 +1424,6 @@ await Task.Run(() => public void SwipeScreen(eSwipeSide side, double impact = 1) { - impact = 1; System.Drawing.Size sz = Driver.Manage().Window.Size; double startX; double startY; @@ -1445,15 +1444,15 @@ public void SwipeScreen(eSwipeSide side, double impact = 1) endY = sz.Height * 0.3; break; case eSwipeSide.Right: // center of left side - startX = sz.Width * 0.8 * impact; + startX = sz.Width * 0.7 * impact; startY = sz.Height * 0.5; - endX = sz.Width * 0.1; + endX = sz.Width * 0.3; endY = sz.Height * 0.5; break; case eSwipeSide.Left: // center of right side - startX = sz.Width * 0.1; + startX = sz.Width * 0.3; startY = sz.Height * 0.5; - endX = sz.Width * 0.8 * impact; + endX = sz.Width * 0.7 * impact; endY = sz.Height * 0.5; break; default: @@ -1463,25 +1462,14 @@ public void SwipeScreen(eSwipeSide side, double impact = 1) (BuildTouchAction(Driver, startX, startY, endX, endY, 200)).Perform(); } - public ITouchAction BuildTouchAction(AppiumDriver driver, double startX, double startY, double endX, double endY, int waitDuration=200) + public ITouchAction BuildTouchAction(AppiumDriver driver, double startX, double startY, double endX, double endY, int waitDuration = 200) { ITouchAction touchAction; - - if (DevicePlatformType == eDevicePlatformType.Android) - { - touchAction = new TouchAction(driver) - .Press(startX, startY) - .MoveTo(endX, endY) - .Release(); - } - else //iOS - { - touchAction = new TouchAction(driver) - .Press(startX, startY) - .Wait(waitDuration) - .MoveTo(endX, endY) - .Release(); - } + touchAction = new TouchAction(driver) + .Press(startX, startY) + .Wait(waitDuration) + .MoveTo(endX, endY) + .Release(); return touchAction; } diff --git a/Ginger/GingerCoreNET/GingerCoreNET.csproj b/Ginger/GingerCoreNET/GingerCoreNET.csproj index 64beba455c..5f9d46054b 100644 --- a/Ginger/GingerCoreNET/GingerCoreNET.csproj +++ b/Ginger/GingerCoreNET/GingerCoreNET.csproj @@ -224,7 +224,7 @@ - +