Skip to content

Patch 1 for v2025.1#4134

Merged
Maheshkale447 merged 1 commit into
Releases/Published-Official-Releases/Official-Release-2025.1from
Enhancement/Patch_1_v2025.1
Mar 4, 2025
Merged

Patch 1 for v2025.1#4134
Maheshkale447 merged 1 commit into
Releases/Published-Official-Releases/Official-Release-2025.1from
Enhancement/Patch_1_v2025.1

Conversation

@IamHarsimranjeet

@IamHarsimranjeet IamHarsimranjeet commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

  • New Features

    • Introduced support for the Safari browser in remote web testing, expanding the range of supported browsers.
  • Refactor

    • Enhanced the application platform detection process to improve reliability and ensure appropriate default settings are applied.

2. Handled TA rename issue for POM page
3. Implemented RemoteWebDriver for Safari
@coderabbitai

coderabbitai Bot commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request refines the application platform retrieval in the workspace solution and introduces Safari browser support in the Selenium driver. The Solution.cs file now checks both application name and GUID for platform determination using explicit null checks. In the SeleniumDriver.cs file, a new conditional branch for the Safari browser is added, which creates a SafariOptions instance, configures proxy and remote settings, and initializes the remote driver accordingly.

Changes

File(s) Change Summary
Ginger/.../Solution.cs Updated GetTargetApplicationPlatform and GetApplicationPlatformForTargetApp to first verify input, check by application name, and fall back to GUID if needed; replaced LINQ queries with explicit null checks and streamlined return logic.
Ginger/.../SeleniumDriver.cs Enhanced StartDriver by adding a branch for Safari: creates SafariOptions, sets proxy and optional remote parameters, configures unhandled prompts, and initializes a RemoteWebDriver based on timeout and URL conditions.

Sequence Diagram(s)

Application Platform Lookup in Solution.cs

sequenceDiagram
    participant Client as Client Code
    participant Solution as Solution.cs
    participant Lookup as ApplicationPlatform Lookup

    Client->>Solution: Call GetTargetApplicationPlatform(TargetApplicationKey)
    Solution->>Lookup: Lookup using Application Name
    alt Platform Found
        Lookup-->>Solution: Return platform
    else Not found
        Solution->>Lookup: Lookup using GUID
        alt Platform Found by GUID
            Lookup-->>Solution: Return platform
        else
            Lookup-->>Solution: Return default value
        end
    end
    Solution-->>Client: Return final platform value
Loading

Safari Driver Initialization in SeleniumDriver.cs

sequenceDiagram
    participant Tester as Test Invoker
    participant Selenium as SeleniumDriver
    participant SafariOpts as SafariOptions
    participant Remote as RemoteWebDriver

    Tester->>Selenium: Call StartDriver()
    alt RemoteBrowserName == "safari"
        Selenium->>SafariOpts: Create and configure SafariOptions
        Selenium->>Selenium: Set unhandled prompt behavior
        Selenium->>Remote: Initialize RemoteWebDriver with SafariOptions
    else Other browser
        Selenium->>...: Execute existing driver initialization
    end
    Remote-->>Tester: Return active driver instance
Loading

Suggested reviewers

  • Maheshkale447

Poem

I'm a rabbit on the run through code,
Hopping over logic in work mode.
With checks by name and GUID so clear,
And Safari support now hopping near.
Lines of code dance with a cheerful tune,
As I nibble on bytes under the coding moon!

✨ Finishing Touches
  • 📝 Generate Docstrings

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bce6ba7 and 0b657d5.

⛔ Files ignored due to path filters (1)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerAgent.jar is excluded by !**/*.jar, !**/*.jar
📒 Files selected for processing (2)
  • Ginger/GingerCoreCommon/WorkSpaceLib/Solution.cs (1 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (2 hunks)
🔇 Additional comments (5)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (4)

56-56: Addition of Safari browser support.

The import statement for Safari browser capabilities has been properly added to extend browser support in the framework.


958-988: Well-implemented Safari browser support for RemoteWebDriver.

The implementation for Safari browser follows the same pattern as other browsers, maintaining code consistency. The code:

  1. Creates a SafariOptions instance with appropriate proxy configuration
  2. Adds platform and version options when provided
  3. Configures unhandled prompt behavior
  4. Creates the RemoteWebDriver with appropriate timeout and Healenium support

This is a clean addition that extends the framework's browser capabilities without introducing deviations from the existing patterns.


973-973: Verify consistent prompt behavior setup across browsers.

Ensures that Safari is correctly calling the SetUnhandledPromptBehavior method like other browsers. This is important for consistent behavior across different browser implementations.


975-985: Verify Safari remote connection configuration is complete.

The code correctly handles the HTTP server timeout and Healenium configuration for Safari, maintaining consistency with other browser implementations. The implementation follows the same pattern as used for Chrome, Firefox, and Edge browsers.

Ginger/GingerCoreCommon/WorkSpaceLib/Solution.cs (1)

408-416: Improved null-checking and return logic for platform lookup.

The method now properly checks for null/empty values before attempting to find the application platform, and uses a cleaner conditional expression for returning the platform or a default value.

Comment on lines +412 to +413
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetapp));
return appPlatform != null ? appPlatform.Platform : default;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consider supporting lookup by GUID for consistency with GetTargetApplicationPlatform.

For consistency with the GetTargetApplicationPlatform method, consider enhancing this method to also try finding the application platform by GUID if a string representation of a GUID is provided.

 ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetapp));
+// If not found by name, try parsing as GUID
+if (appPlatform == null && Guid.TryParse(targetapp, out Guid targetGuid))
+{
+    appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetGuid);
+}
 return appPlatform != null ? appPlatform.Platform : default;
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetapp));
return appPlatform != null ? appPlatform.Platform : default;
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetapp));
// If not found by name, try parsing as GUID
if (appPlatform == null && Guid.TryParse(targetapp, out Guid targetGuid))
{
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetGuid);
}
return appPlatform != null ? appPlatform.Platform : default;

Comment on lines +392 to +397
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
string targetapp = TargetApplicationKey.ItemName;
ePlatformType platform = (from x in ApplicationPlatforms where x.AppName == targetapp select x.Platform).FirstOrDefault();
return platform;
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
}
return ePlatformType.Web;
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consider adding logging for platform resolution failures.

When an application platform can't be found, the code silently returns a default value. Adding logging in these cases could help troubleshoot issues where applications aren't correctly mapping to their expected platforms.

 ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
 if (appPlatform == null)
 {
     appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
+    if (appPlatform == null)
+    {
+        Reporter.ToLog(eLogLevel.WARN, $"Could not find ApplicationPlatform for app name '{targetAppName}' or GUID '{targetAppGuid}'");
+    }
 }
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
string targetapp = TargetApplicationKey.ItemName;
ePlatformType platform = (from x in ApplicationPlatforms where x.AppName == targetapp select x.Platform).FirstOrDefault();
return platform;
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
}
return ePlatformType.Web;
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
if (appPlatform == null)
{
Reporter.ToLog(eLogLevel.WARN, $"Could not find ApplicationPlatform for app name '{targetAppName}' or GUID '{targetAppGuid}'");
}
}
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;

Comment on lines 386 to +401
public ePlatformType GetTargetApplicationPlatform(RepositoryItemKey TargetApplicationKey)
{
{
if (TargetApplicationKey != null)
{
string targetAppName = TargetApplicationKey.ItemName;
Guid targetAppGuid = TargetApplicationKey.Guid;
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
string targetapp = TargetApplicationKey.ItemName;
ePlatformType platform = (from x in ApplicationPlatforms where x.AppName == targetapp select x.Platform).FirstOrDefault();
return platform;
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
}
return ePlatformType.Web;
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;
return platform;
}
return ePlatformType.Web;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Improved application platform lookup by adding GUID check.

The method now intelligently attempts to find an ApplicationPlatform first by name, then by GUID, which makes the lookup more robust. This enhancement is particularly valuable when an application might be referenced by different identifiers in different parts of the system.

While the implementation is sound, I noticed inconsistent default return values between this method (returning ePlatformType.Web) and GetApplicationPlatformForTargetApp (returning ePlatformType.NA). Consider aligning these default values for consistency:

-            return ePlatformType.Web;
+            return ePlatformType.NA;
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ePlatformType GetTargetApplicationPlatform(RepositoryItemKey TargetApplicationKey)
{
{
if (TargetApplicationKey != null)
{
string targetAppName = TargetApplicationKey.ItemName;
Guid targetAppGuid = TargetApplicationKey.Guid;
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
string targetapp = TargetApplicationKey.ItemName;
ePlatformType platform = (from x in ApplicationPlatforms where x.AppName == targetapp select x.Platform).FirstOrDefault();
return platform;
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
}
return ePlatformType.Web;
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;
return platform;
}
return ePlatformType.Web;
}
public ePlatformType GetTargetApplicationPlatform(RepositoryItemKey TargetApplicationKey)
{
if (TargetApplicationKey != null)
{
string targetAppName = TargetApplicationKey.ItemName;
Guid targetAppGuid = TargetApplicationKey.Guid;
ApplicationPlatform appPlatform = ApplicationPlatforms.FirstOrDefault(ap => string.Equals(ap.AppName, targetAppName));
if (appPlatform == null)
{
appPlatform = ApplicationPlatforms.FirstOrDefault(ap => ap.Guid == targetAppGuid);
}
ePlatformType platform = appPlatform != null ? appPlatform.Platform : default;
return platform;
}
return ePlatformType.NA;
}

@Maheshkale447
Maheshkale447 merged commit 9370b93 into Releases/Published-Official-Releases/Official-Release-2025.1 Mar 4, 2025
@Maheshkale447
Maheshkale447 deleted the Enhancement/Patch_1_v2025.1 branch March 4, 2025 06:36
@coderabbitai coderabbitai Bot mentioned this pull request Mar 11, 2026
15 tasks
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.

2 participants