Skip to content

Feature/web smart sync all locator#3796

Closed
GokulBothe wants to merge 89 commits into
masterfrom
Feature/WebSmartSyncAllLocator
Closed

Feature/web smart sync all locator#3796
GokulBothe wants to merge 89 commits into
masterfrom
Feature/WebSmartSyncAllLocator

Conversation

@GokulBothe

@GokulBothe GokulBothe commented Jun 27, 2024

Copy link
Copy Markdown
Collaborator

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

    • Added a checkbox for "Try all supported locators" in the web element synchronization settings.
  • Bug Fixes

    • Improved alignment of menu icons for better visual consistency.
  • Tests

    • Introduced unit tests for enhanced validation of web element locator functionality in the Selenium driver.
  • Refactor

    • Enhanced flexibility in the POM (Page Object Model) methods to support overrides.
  • Style

    • Updated icon margins in the main menu for better alignment.

IamHarsimranjeet and others added 24 commits June 24, 2024 18:30
Also refactored the code for serializer wherever applicable
…ngToZeroOnReload

Bug fix/dev time resetting to zero on reload
[Defect Id: 40342]removed margin and added borders for DB action
…rPlaywrightSupportExistingPOM

Feature - 39520 - Tests For Playwright Support Existing POM
Fixed serializer so Empty Guid and Zero timespan won't get serialized
@GokulBothe
GokulBothe requested a review from Maheshkale447 June 27, 2024 09:32
@coderabbitai

coderabbitai Bot commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces enhancements to the ActWebSmartSyncEditPage.xaml interface by adding a new CheckBox for locators. It also extends the POMExecutionUtils methods for increased flexibility, improves synchronization operations in SeleniumDriver, and aligns various UI elements in the MainWindow.xaml. Additionally, new unit tests have been added to ensure robust locator functionality in Selenium-based web synchronization.

Changes

Files Change Summary
.../ActionEditPages/ActWebSmartSyncEditPage.xaml
.../ActionEditPages/ActWebSmartSyncEditPage.xaml.cs
Added CheckBox for locators and binding for UseAllLocators property. Introduced method for checkbox visibility.
.../Execution/POM/POMExecutionUtils.cs Made GetCurrentPOM() and GetCurrentPOMElementInfo() methods virtual for extensibility.
.../CoreDrivers/Web/Selenium/SeleniumDriver.cs Added locator operations and methods to improve web synchronization handling.
.../CoreDrivers/Web/Selenium/SeleniumUnitTest.cs Introduced unit tests for GetLocatorsForWebSmartSync method to validate locator functionality.
MainWindow.xaml Adjusted margins of ImageMakerControl elements for better alignment in menus.

Poem

Amidst the code, enhancements sprout,
Locators fine-tuned, without doubt.
Checkboxes now in dazzling array,
Bringing order to the fray.
🖥️ Web awaits in sync, precise,
In Ginger's glow, it's quite nice.


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.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

@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: CHILL

Commits

Files that changed from the base of the PR and between b3bab06 and 275441a.

Files selected for processing (6)
  • Ginger/Ginger/Actions/ActionEditPages/ActWebSmartSyncEditPage.xaml (1 hunks)
  • Ginger/Ginger/Actions/ActionEditPages/ActWebSmartSyncEditPage.xaml.cs (5 hunks)
  • Ginger/GingerCoreNET/ActionsLib/UI/ActWebSmartSync.cs (1 hunks)
  • Ginger/GingerCoreNET/Application Models/Execution/POM/POMExecutionUtils.cs (2 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (3 hunks)
  • Ginger/GingerCoreNETUnitTest/Drivers/CoreDrivers/Web/Selenium/SeleniumUnitTest.cs (1 hunks)
Additional comments not posted (7)
Ginger/Ginger/Actions/ActionEditPages/ActWebSmartSyncEditPage.xaml (1)

25-28: New UI Elements Added: StackPanel and CheckBox

The addition of xPomPanel StackPanel and xAlllocatorCheckbox CheckBox align with the UI enhancements described in the summary. Ensure that the naming convention and visibility settings are consistent with existing UI elements.

Ginger/Ginger/Actions/ActionEditPages/ActWebSmartSyncEditPage.xaml.cs (1)

38-38: Code Enhancements in ActWebSmartSyncEditPage.xaml.cs

  1. Import Statement Added: The import of Amdocs.Ginger.Common.Actions is appropriate for the new functionality.
  2. New Binding Added: The binding of UseAllLocators to xAlllocatorCheckbox is correctly implemented.
  3. New Methods: The setAlllocatorCheckboxVisbility method is implemented correctly and is called at appropriate control flow points to manage the visibility of xAlllocatorCheckbox based on the selected element.

Ensure that the method is robust against potential null values in control properties.

Also applies to: 63-63, 73-73, 175-185, 203-203

Ginger/GingerCoreNETUnitTest/Drivers/CoreDrivers/Web/Selenium/SeleniumUnitTest.cs (1)

21-255: Unit Tests Added in SeleniumUnitTest.cs

The new unit tests added for the GetLocatorsForWebSmartSync method cover various scenarios including:

  • Using primitive locators.
  • Using the first active locator.
  • Using the first supported locator.
  • Handling no active locator.
  • Handling no supported locator.
  • Handling no current POM.
  • Handling no current POM element info.
  • Handling unsupported LocateBy values.

These tests are well-structured and seem to thoroughly check the functionality of the method under different conditions.

Ginger/GingerCoreNET/ActionsLib/UI/ActWebSmartSync.cs (1)

285-298: New Property Added: UseAllLocators

The addition of the UseAllLocators property in ActWebSmartSync class is implemented correctly. The property is designed to handle both get and set operations with appropriate data type conversions and default values.

Ensure that the property is used consistently across the application where relevant.

Ginger/GingerCoreNET/Application Models/Execution/POM/POMExecutionUtils.cs (1)

58-58: Methods Made Virtual in POMExecutionUtils.cs

The methods GetCurrentPOM and GetCurrentPOMElementInfo have been made virtual, allowing them to be overridden in derived classes. This change enhances the flexibility and extensibility of the POM execution utility class.

Ensure that derived classes override these methods appropriately to maintain consistent behavior across different use cases.

Also applies to: 72-72

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

2441-2446: Proper handling of timeout values in WebSmartSyncGetMaxTimeout.

This method correctly checks for valid timeout values which is crucial for avoiding indefinite waits.


107-112: Static list operationsWithoutLocator initialization looks good.

Please ensure that these enum values are used correctly in conditions where operations do not require locators.

Verification successful

Static list operationsWithoutLocator initialization looks good.

The usage of operationsWithoutLocator in the WebSmartSyncHandler method appears correct. The condition checks if the act.SyncOperations is not in the operationsWithoutLocator list before proceeding with locator-related operations.

  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs: Line 107
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs: Line 131
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct usage of enum values in conditions.

# Test: Search for the enum usage. Expect: Correct conditional checks.
rg --type python $'operationsWithoutLocator'

Length of output: 74



Script:

#!/bin/bash
# Description: Verify the correct usage of enum values in conditions.

# Test: Search for the enum usage. Expect: Correct conditional checks.
rg --type cs 'operationsWithoutLocator'

Length of output: 338



Script:

#!/bin/bash
# Description: Extract and review the usage context of `operationsWithoutLocator`.

# Extract 10 lines before and after the usage of `operationsWithoutLocator`.
rg --type cs 'operationsWithoutLocator' -A 10 -B 10

Length of output: 5363

Comment thread Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs Outdated
@GokulBothe
GokulBothe changed the base branch from Releases/Beta to master June 27, 2024 09:40
@GokulBothe
GokulBothe changed the base branch from master to Releases/Beta June 27, 2024 09:41
Maheshkale447 and others added 20 commits July 4, 2024 12:23
2- fixing category related bugs
3- added check for mobile driver to validate the session is still active before taking screen shoot
…close the last opened tab manually. If we run any failing action, it is not able to take the screenshot.

RC: When we close the tab manually, our code doesn't get notified and it still tries to take screenshot from the already closed tab.
Fix: Add Close event listener to Playwright Page and handle manual tab close.
@GokulBothe
GokulBothe changed the base branch from master to Releases/Beta July 4, 2024 08:33

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 58a802c and 6b42e78.

Files selected for processing (2)
  • Ginger/Ginger/MainWindow.xaml (5 hunks)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs
Additional comments not posted (10)
Ginger/Ginger/MainWindow.xaml (10)

96-96: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


103-103: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


108-108: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


113-113: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


118-118: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


128-128: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


133-133: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


149-149: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


154-154: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.


159-159: Verify the consistency of margin values.

The margin values have been adjusted to 5,0,-5,0. Ensure that these values are consistent with the design guidelines and other similar elements.

@GokulBothe
GokulBothe changed the base branch from Releases/Beta to master July 4, 2024 08:45
@GokulBothe99
GokulBothe99 deleted the Feature/WebSmartSyncAllLocator branch July 8, 2024 12:39
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.

6 participants