Skip to content

VRT Fixed and Not supported Log Added#4237

Merged
Maheshkale447 merged 2 commits into
Releases/Betafrom
BugFix/MobileVRTFixed
Jun 20, 2025
Merged

VRT Fixed and Not supported Log Added#4237
Maheshkale447 merged 2 commits into
Releases/Betafrom
BugFix/MobileVRTFixed

Conversation

@prashelke

@prashelke prashelke commented Jun 20, 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

  • Bug Fixes
    • Improved detection of mobile operating system and browser/agent for visual testing, ensuring more accurate reporting for Android and iOS devices.
    • Restricted certain mobile device actions (Push File, Pull File, Get Device Logs) to Android devices only, with clear error messages for unsupported platforms.

@coderabbitai

coderabbitai Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The updates enhance platform detection and error handling in two areas: the TrackVRT method now determines OS and browser strings based on the specific WebDriver type (Android or iOS), and mobile device actions in the Appium driver are restricted to Android devices, returning explicit errors for unsupported platforms.

Changes

File(s) Change Summary
Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs Enhanced TrackVRT to detect AndroidDriver or IOSDriver from IWebDriver and set OS/browser strings accordingly.
Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs Restricted PushFileToDevice, PullFileFromDevice, and GetDeviceLogs actions to Android only with error reporting.

Possibly related PRs

  • Ginger-Automation/Ginger#3708: Also modifies the TrackVRT method in VRTAnalyzer.cs, focusing on "Create Baseline" checkbox logic, affecting the same method as this PR.

Suggested reviewers

  • Maheshkale447

Poem

A bunny hopped through code so spry,
Detecting drivers on the fly.
Android or iOS? Now we know—
With tailored errors when things say no!
From platform checks to browser strings,
This rabbit’s joy in changes springs.
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 89127ca and 92bd9ed.

📒 Files selected for processing (2)
  • Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (3 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (1)
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.024Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.
🔇 Additional comments (7)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (4)

1567-1575: LGTM! Excellent implementation of the helper method pattern.

The ValidateAndroidOnlyOperation helper method is well-designed and addresses the previous feedback perfectly. It provides:

  • Consistent platform validation logic
  • Clear, parameterized error messaging
  • Reusable functionality across multiple operations
  • Proper return value semantics

This implementation eliminates code duplication and improves maintainability.


1422-1425: Perfect implementation of Android-only validation.

The PushFileToDevice operation now correctly uses the helper method to validate platform compatibility before proceeding. The conditional structure ensures the operation only executes on Android devices with appropriate error handling for other platforms.


1429-1432: Consistent platform validation implementation.

The PullFileFromDevice operation follows the same clean pattern as other Android-only operations, using the helper method for validation and proper conditional execution.


1444-1449: Well-implemented platform restriction for device logs.

The GetDeviceLogs operation correctly implements the Android-only restriction using the helper method. The implementation maintains consistency with other platform-specific operations and provides clear error messaging for unsupported platforms.

Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (3)

24-26: LGTM! Import statements correctly added for WebDriver type detection.

The new imports for Selenium WebDriver types are necessary for the enhanced platform detection functionality and are properly placed.


259-276: Enhanced OS detection logic looks good.

The WebDriver type-based OS detection provides more accurate platform identification for mobile scenarios while maintaining backward compatibility through the fallback to GingerPluginCore.OperatingSystem.GetCurrentOS().


305-325: Browser detection logic provides sensible defaults for mobile platforms.

The implementation correctly assumes Chrome for Android Web and Safari for iOS Web scenarios, which are the typical default browsers for these platforms. The fallback mechanism ensures existing functionality remains intact.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch BugFix/MobileVRTFixed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests 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

♻️ Duplicate comments (1)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (1)

1432-1441: Platform restriction correctly implemented with consistent error handling.

The PullFileFromDevice action now appropriately restricts functionality to Android devices. The error message is consistent with other platform-specific restrictions in the codebase.

This follows the same pattern as the PushFileToDevice action above - consider the refactoring suggestion from the previous comment to reduce code duplication.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf2f10 and 89127ca.

📒 Files selected for processing (2)
  • Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (3 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (1)
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.024Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.
🔇 Additional comments (3)
Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs (3)

24-26: LGTM: Appropriate using statements added.

The new using statements for OpenQA.Selenium driver types are correctly added to support the enhanced platform detection functionality.


259-259: LGTM: WebDriver instance retrieval for type checking.

Getting the WebDriver instance enables the enhanced platform detection logic that follows.


305-325: LGTM: Platform-aware browser/agent detection logic.

The enhanced logic correctly:

  • Differentiates between Web platform and other platforms
  • Assigns appropriate browser strings for mobile drivers on Web platform (chrome for Android, safari for iOS)
  • Falls back to agent app name for non-mobile Web drivers
  • Appends "App" suffix for non-Web platforms

This improves the accuracy of browser/agent identification for VRT tracking.

Comment thread Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs
@Maheshkale447
Maheshkale447 merged commit d337432 into Releases/Beta Jun 20, 2025
11 checks passed
@Maheshkale447
Maheshkale447 deleted the BugFix/MobileVRTFixed branch June 20, 2025 10:27
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