Skip to content
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

Pending Patch/claro 23.5 fix #3665

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Pending Patch/claro 23.5 fix #3665

wants to merge 14 commits into from

Conversation

aditydha
Copy link
Contributor

@aditydha aditydha commented May 6, 2024

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Copy link
Contributor

coderabbitai bot commented May 6, 2024

Walkthrough

The recent updates across the Ginger software focus on refining event handling, enhancing UI components, and simplifying code for better maintainability. Changes include shifting from WeakEventManager to direct event subscriptions, tweaking UI properties like scrollbar visibility and margins, and modifying method implementations for efficiency. Additionally, there's a strategic removal and addition of properties to support backward compatibility and streamline configurations.

Changes

File Path Change Summary
.../AddActionMenu/.../*.xaml.cs Replaced WeakEventManager with direct event subscriptions in multiple files.
.../UserControlsLib/UCListView/UcListView.xaml Changed HorizontalScrollBarVisibility from "Disabled" to "Auto".
.../UserControlsLib/UCListView/UcListViewItem.xaml Adjusted HorizontalAlignment and added MaxWidth for text blocks.
.../GingerCore/Actions/UIAutomation/*.cs Added a blank line and a new conditional line in a loop.
.../GingerCoreCommon/*.csproj Removed AssemblyVersion and FileVersion elements.
.../GingerCoreCommon/ReportsLib/*.cs Introduced CentralizedHTMLURL property.
.../CoreDrivers/Mobile/Appium/*.cs Modified SwipeScreen method and simplified BuildTouchAction.
.../CoreDrivers/Web/Selenium/*.cs Updated StartDriver() method to use a custom path method.
.../WorkSpaceLib/*.cs Adjusted settings for CentralizedHtmlReportServiceURL and removed a line from OpenSolution.

🐰✨
O hark! The code doth change, refine,
With swipes and clicks aligned just fine.
Events direct, UI so bright,
Ginger's update takes flight tonight.
From rabbit's burrow, cheers resound,
For code that's sleek, and bounds unbound!
🌟🐇


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Out of diff range and nitpick comments (1)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (1)

Line range hint 1412-1441: Adjust swipe logic to ensure compatibility with Appium 2.0.

- startX = sz.Width * 0.8 * impact;
- endX = sz.Width * 0.1;
- startX = sz.Width * 0.1;
- endX = sz.Width * 0.8 * impact;
+ startX = sz.Width * 0.7 * impact;
+ endX = sz.Width * 0.3;
+ startX = sz.Width * 0.3;
+ endX = sz.Width * 0.7 * impact;

Ensure that the new swipe logic is tested across different devices to confirm that the swipe actions perform as expected.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fbd2dc9 and 673b63d.
Files selected for processing (14)
  • Ginger/Ginger/AutomatePageLib/AddActionMenu/ActionsLibrary/ActionsLibraryNavPage.xaml.cs (1 hunks)
  • Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActionsRepositoryPage.xaml.cs (1 hunks)
  • Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActivitiesGroupsRepositoryPage.xaml.cs (1 hunks)
  • Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActivitiesRepositoryPage.xaml.cs (1 hunks)
  • Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml (1 hunks)
  • Ginger/Ginger/UserControlsLib/UCListView/UcListView.xaml (1 hunks)
  • Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml (2 hunks)
  • Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs (1 hunks)
  • Ginger/GingerCoreCommon/GingerCoreCommon.csproj (1 hunks)
  • Ginger/GingerCoreCommon/ReportsLib/HTMLReportsConfiguration.cs (3 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (3 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (1 hunks)
  • Ginger/GingerCoreNET/WorkSpaceLib/SolutionOperations.cs (1 hunks)
  • Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs (1 hunks)
Files skipped from review due to trivial changes (5)
  • Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml
  • Ginger/Ginger/UserControlsLib/UCListView/UcListView.xaml
  • Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs
  • Ginger/GingerCoreCommon/GingerCoreCommon.csproj
  • Ginger/GingerCoreNET/WorkSpaceLib/WorkSpace.cs
Additional comments not posted (9)
Ginger/GingerCoreCommon/ReportsLib/HTMLReportsConfiguration.cs (2)

34-39: The addition of the CentralizedHTMLURL property is well-documented with comments explaining its purpose for backward compatibility. This is a good practice as it helps maintain clarity in the codebase.


157-159: The update in the SerializationError method to handle the CentralizedHtmlReportServiceURL by assigning its value to the new CentralizedHTMLURL property ensures backward compatibility. This change is crucial for maintaining the functionality with older configurations.

Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActionsRepositoryPage.xaml.cs (1)

121-121: The addition of the grdActions_grdMain_ItemMouseDoubleClick event handler to xActionListView.ItemMouseDoubleClick is appropriate for enhancing UI interactivity by allowing users to trigger actions through double-clicks.

Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActivitiesGroupsRepositoryPage.xaml.cs (1)

86-86: The addition of multiple event handlers (grdActivitiesGroupsRepository_grdMain_ItemMouseDoubleClick, grdActivitiesGroupsRepository_ItemDropped, grdActivitiesGroupsRepository_PreviewDragItem) to xActivitiesGroupsRepositoryListView enhances the page's interactivity and functionality, allowing for more dynamic user interactions.

Ginger/Ginger/AutomatePageLib/AddActionMenu/SharedRepositoryLib/ActivitiesRepositoryPage.xaml.cs (1)

145-145: The addition of multiple event handlers (grdActivitiesRepository_grdMain_ItemMouseDoubleClick, grdActivitiesRepository_ItemDropped, grdActivitiesRepository_PreviewDragItem) to xActivitiesRepositoryListView enhances the page's interactivity and functionality, allowing for more dynamic user interactions.

Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml (1)

Line range hint 102-135: The adjustments made to the text alignment and width settings for the xItemNameTxtBlock and xItemDescriptionTxtBlock improve the readability and visual appeal of list items. These changes are likely to enhance the user experience by providing a cleaner and more organized display.

Ginger/GingerCoreNET/WorkSpaceLib/SolutionOperations.cs (1)

314-320: The update to set the CentralizedHtmlReportServiceURL in executionLoggerConfiguration based on the presence of a selected HTML report configuration ensures that the system remains backward compatible and functional with existing configurations.

Ginger/Ginger/AutomatePageLib/AddActionMenu/ActionsLibrary/ActionsLibraryNavPage.xaml.cs (1)

206-206: The addition of the ActionsListViewItem_MouseDoubleClick event handler to ucListView.ItemMouseDoubleClick is appropriate for enhancing UI interactivity by allowing users to trigger actions through double-clicks.

Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (1)

685-685: Ensure GetDriversPathPerOS() correctly handles all supported OS environments.

Verification successful

The implementation of GetDriversPathPerOS() in the SeleniumDriver.cs file has been verified to handle different operating systems correctly. The method includes specific checks for Windows, macOS (OSX), and Linux, returning appropriate paths based on the operating system and browser type. This ensures that the driver paths are set correctly for the supported environments.

  • Windows: Handles both 64-bit browsers specifically for Internet Explorer and Firefox, and provides a general case for other situations.
  • macOS (OSX) and Linux: Returns the general driver path without specific conditions for browser types.

This implementation aligns with the requirements for a method that needs to adapt to different OS environments in a Selenium-based automation framework.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of `GetDriversPathPerOS` handles all supported OS environments.

# Test: Search for the function definition and usage. Expect: Proper handling for each OS.
rg --type cs $'GetDriversPathPerOS'

Length of output: 689



Script:

#!/bin/bash
# Description: Inspect the implementation of `GetDriversPathPerOS` to verify handling of different OS environments.

# Test: Extract the function implementation to see if it includes specific handling for different OS environments.
rg --type cs --context 10 'public string GetDriversPathPerOS()'

Length of output: 2469



Script:

#!/bin/bash
# Description: Further inspect the implementation of `GetDriversPathPerOS` to verify handling of macOS and Linux environments.

# Test: Extract more of the function implementation to see if it includes specific handling for macOS and Linux OS environments.
rg --type cs --context 20 'public string GetDriversPathPerOS()'

Length of output: 4794

Comment on lines +1451 to +1459
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor BuildTouchAction to enhance readability and maintainability.

- 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();

Adjust the indentation for better readability and ensure that each action in the chain is on a new line.


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.

Suggested change
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();
public ITouchAction BuildTouchAction(AppiumDriver driver, double startX, double startY, double endX, double endY, int waitDuration = 200)
{
ITouchAction touchAction;
touchAction = new TouchAction(driver)
.Press(startX, startY)
.Wait(waitDuration)
.MoveTo(endX, endY)
.Release();

@@ -682,7 +682,7 @@ public override void StartDriver()

SetCurrentPageLoadStrategy(ieOptions);
ieOptions.IgnoreZoomLevel = true;
driverService = InternetExplorerDriverService.CreateDefaultService();
driverService = InternetExplorerDriverService.CreateDefaultService(GetDriversPathPerOS());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider the implications of setting IgnoreZoomLevel to true, as it might affect element interaction accuracy on web pages not set to 100% zoom.

@aditydha aditydha requested a review from digvijayAMDX May 6, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants