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

ExcludedArguments functionality for Chromium-based drivers #144

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

mialeska
Copy link
Contributor

…+semver: feature

closes #143
Also remove "--remote-allow-origins=*" workaround
Add --disable-search-engine-choice-screen to settings.json

…+semver: feature

closes #143
Also remove "--remote-allow-origins=*" workaround
Add --disable-search-engine-choice-screen to settings.json
@mialeska mialeska added enhancement New feature or request feature java labels Jul 25, 2024
@mialeska mialeska self-assigned this Jul 25, 2024
Copy link

coderabbitai bot commented Jul 25, 2024

Walkthrough

The recent changes enhance the configuration capabilities of Chromium-based drivers by introducing an excludedArguments feature. This allows users to specify command-line arguments to exclude during browser initialization, improving automation control and compatibility. The updates apply to Chrome, Edge, Firefox, and Yandex, providing a more flexible approach to setting browser options while also streamlining existing argument management.

Changes

Files Change Summary
src/main/java/aquality/selenium/configuration/driversettings/... Introduced excludedArguments functionality for Chrome and Edge. Updated method calls to include excluded arguments, enhancing driver options configuration.
src/main/resources/settings.json, src/test/resources/settings.json Added excludedArguments field for Chrome, Edge, Firefox, and Yandex in configuration files, allowing specific command-line arguments to be excluded during startup.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChromeSettings
    participant DriverSettings
    participant EdgeSettings

    User->>ChromeSettings: Initialize ChromeOptions
    ChromeSettings->>DriverSettings: Get Excluded Arguments
    DriverSettings-->>ChromeSettings: Return Excluded Arguments
    ChromeSettings->>ChromeOptions: Set Excluded Arguments
    User->>EdgeSettings: Initialize EdgeOptions
    EdgeSettings->>DriverSettings: Get Excluded Arguments
    DriverSettings-->>EdgeSettings: Return Excluded Arguments
    EdgeSettings->>EdgeOptions: Set Excluded Arguments
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement excludedArguments functionality for Chromium-based drivers (#143)
Enhance configurability of browser startup arguments (#143)

🐰 "Oh, the browsers dance with glee,
Excluded args, oh joy, you see!
Chrome and Edge, now configured fair,
With less clutter, they breathe fresh air.
In tests we trust, with each hop and skip,
Automation flows with a happier trip!" 🐇


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

@mialeska mialeska changed the title Implement excludedArguments functionality for Chromium-based drivers … ExcludedArguments functionality for Chromium-based drivers Jul 25, 2024
Copy link

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e59afe5 and 94834e5.

Files selected for processing (5)
  • src/main/java/aquality/selenium/configuration/driversettings/ChromeSettings.java (2 hunks)
  • src/main/java/aquality/selenium/configuration/driversettings/DriverSettings.java (6 hunks)
  • src/main/java/aquality/selenium/configuration/driversettings/EdgeSettings.java (1 hunks)
  • src/main/resources/settings.json (4 hunks)
  • src/test/resources/settings.json (4 hunks)
Additional comments not posted (17)
src/main/java/aquality/selenium/configuration/driversettings/EdgeSettings.java (1)

23-23: LGTM! The addition enhances flexibility.

The call to setExcludedArguments(edgeOptions) integrates well into the getDriverOptions method, enhancing flexibility in configuring the browser's startup behavior.

src/main/java/aquality/selenium/configuration/driversettings/ChromeSettings.java (2)

23-23: LGTM! The addition enhances flexibility.

The call to setExcludedArguments(chromeOptions) integrates well into the getDriverOptions method, enhancing flexibility in configuring the browser's startup behavior.


Line range hint 19-22:
LGTM! The removal of the workaround is appropriate.

The removal of the workaround for the --remote-allow-origins=* flag is appropriate, indicating that it is no longer necessary or the underlying issue has been resolved.

src/main/resources/settings.json (5)

23-24: LGTM! Enhances configurability.

The addition of the --disable-search-engine-choice-screen argument and the excludedArguments field enhances the configurability of the Chrome browser.


40-41: LGTM! Enhances configurability.

The addition of the excludedArguments field enhances the configurability of the Edge browser.


Line range hint 70-71:
LGTM! Enhances configurability.

The addition of the excludedArguments field enhances the configurability of the Firefox browser.


84-85: LGTM! Enhances configurability.

The addition of the excludedArguments field enhances the configurability of the Opera browser.


99-100: LGTM! Enhances configurability.

The addition of the excludedArguments field enhances the configurability of the Yandex browser.

src/test/resources/settings.json (5)

22-23: LGTM: Added startArguments and excludedArguments for Chrome.

The addition of --disable-search-engine-choice-screen to startArguments and enable-automation to excludedArguments aligns with the PR objectives and enhances automation control.


39-40: LGTM: Added excludedArguments for Edge.

The addition of enable-automation to excludedArguments aligns with the PR objectives and enhances automation control.


Line range hint 54-55:
LGTM: Added excludedArguments for Firefox.

The addition of enable-automation to excludedArguments aligns with the PR objectives and enhances automation control.


83-84: LGTM: Added excludedArguments for Opera.

The addition of enable-automation to excludedArguments aligns with the PR objectives and enhances automation control.


98-99: LGTM: Added excludedArguments for Yandex.

The addition of enable-automation to excludedArguments aligns with the PR objectives and enhances automation control.

src/main/java/aquality/selenium/configuration/driversettings/DriverSettings.java (4)

29-29: LGTM: Added excludedArguments field.

The addition of the excludedArguments field is necessary for managing excluded arguments and aligns with the PR objectives.


113-113: LGTM: Modified logCollection method visibility.

The change from private final to private allows for potential overrides, enhancing flexibility.


141-143: LGTM: Added setExcludedArguments method.

The method correctly sets the excluded arguments in ChromiumOptions using the setExperimentalOption method.


169-169: LGTM: Added EXCLUDED_ARGS entry to CapabilityType enum.

The addition of the EXCLUDED_ARGS entry is necessary for managing excluded arguments and aligns with the PR objectives.

Copy link

Copy link

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 94834e5 and fedfa8d.

Files selected for processing (6)
  • src/main/java/aquality/selenium/configuration/driversettings/DriverSettings.java (6 hunks)
  • src/main/resources/localization/be.json (1 hunks)
  • src/main/resources/localization/en.json (1 hunks)
  • src/main/resources/localization/pl.json (1 hunks)
  • src/main/resources/localization/ru.json (1 hunks)
  • src/main/resources/localization/uk.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/resources/localization/pl.json
Additional comments not posted (8)
src/main/java/aquality/selenium/configuration/driversettings/DriverSettings.java (4)

Line range hint 113-118:
LGTM!

The logCollection method is correctly implemented.


141-143: LGTM!

The setExcludedArguments method is correctly implemented.


169-171: LGTM!

The CapabilityType enum is correctly updated with the new entry for EXCLUDED_ARGS.


86-101: Fix logging issue in getExcludedArguments method.

The method correctly retrieves and logs excluded arguments, but it incorrectly logs startArguments instead of excludedArguments.

-  logCollection("loc.browser.excludedArguments", startArguments);
+  logCollection("loc.browser.excludedArguments", excludedArguments);

Likely invalid or redundant comment.

src/main/resources/localization/en.json (1)

3-3: LGTM!

The new localization entry for loc.browser.excludedArguments is correctly added.

src/main/resources/localization/be.json (1)

3-3: LGTM!

The new localization entry for loc.browser.excludedArguments is correctly added.

src/main/resources/localization/uk.json (1)

3-3: New localization entry approved.

The new entry "loc.browser.excludedArguments" is correctly translated and consistent with the existing entries.

src/main/resources/localization/ru.json (1)

3-3: New localization entry approved.

The new entry "loc.browser.excludedArguments" is correctly translated and consistent with the existing entries.

@mialeska mialeska merged commit c6f3d4a into master Jul 26, 2024
4 checks passed
@mialeska mialeska deleted the feature/excluded-switches branch July 26, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature java
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement excludedArguments functionality for Chromium-based drivers
1 participant