-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- fixing Appiun Swipe issue #3466
Conversation
-Upgrading Appium Nugget to more updated version
WalkthroughThe recent modifications streamline the mobile automation framework within the GingerCoreNET library. Specifically, the update enhances the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files selected for processing (2)
- Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (4 hunks)
- Ginger/GingerCoreNET/GingerCoreNET.csproj (1 hunks)
Additional comments: 2
Ginger/GingerCoreNET/GingerCoreNET.csproj (1)
- 227-227: The update of the
Appium.WebDriver
package from "5.0.0-beta01" to "5.0.0-rc.1" is correctly implemented. This change is essential for addressing the swipe functionality issues mentioned in the PR objectives. Ensure that this version update is tested across all relevant platforms and scenarios to confirm compatibility and functionality.Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (1)
- 1465-1472: The
BuildTouchAction
method has been adjusted to include default spacing around the=
operator for thewaitDuration
parameter, aligning with coding standards for readability.This change improves code readability and consistency.
SwipeScreen(eSwipeSide.Down, 1); | ||
break; | ||
|
||
case ActMobileDevice.eMobileDeviceAction.SwipeUp: | ||
SwipeScreen(eSwipeSide.Up, 0.25); | ||
SwipeScreen(eSwipeSide.Up, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impact
parameter in the SwipeScreen
method is not utilized in the method body, leading to potential confusion about its purpose.
Consider removing the impact
parameter if it's not needed, or implement its usage within the method.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for calculating start and end points in the SwipeScreen
method for eSwipeSide.Right
and eSwipeSide.Left
seems inverted. For swiping right, one would expect the start X to be less than the end X, and vice versa for swiping left.
- startX = sz.Width * 0.7 * impact; // For Right swipe, this should be smaller, like 0.3
- endX = sz.Width * 0.3; // For Right swipe, this should be larger, like 0.7 * impact
+ startX = sz.Width * 0.3; // Corrected for Right swipe
+ endX = sz.Width * 0.7 * impact; // Corrected for Right swipe
// Similar corrections needed for Left swipe
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
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; | |
startX = sz.Width * 0.3; // Corrected for Right swipe | |
startY = sz.Height * 0.5; | |
endX = sz.Width * 0.7 * impact; // Corrected for Right swipe | |
endY = sz.Height * 0.5; | |
break; | |
case eSwipeSide.Left: // center of right side | |
startX = sz.Width * 0.3; | |
startY = sz.Height * 0.5; | |
endX = sz.Width * 0.7 * impact; |
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [912-1472]
No explicit performance issues detected in the modified methods. However, it's important to ensure that the SwipeScreen
and BuildTouchAction
methods are not called excessively in tight loops without necessary throttling, as they involve UI interactions that can be resource-intensive.
Consider adding performance notes or throttling mechanisms if these methods are used in performance-critical sections.
-Upgrading Appium Nugget to more updated version
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
Appium.WebDriver
package to version "5.0.0-rc.1" for better stability and new features.