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

Add browser window navigation +semver:feature #140

Merged
merged 2 commits into from
May 6, 2024

Conversation

mialeska
Copy link
Contributor

@mialeska mialeska commented May 6, 2024

  • Update to Selenium 4.20.0

@mialeska mialeska self-assigned this May 6, 2024
Copy link

coderabbitai bot commented May 6, 2024

Walkthrough

Enhancements in browser window and tab management in the Aquality Selenium framework include improved navigation functions and localization. This update introduces new JavaScript utilities for window operations, updates dependency versions, and refines integration tests to align with the latest changes.

Changes

Files Summary
pom.xml Updated various dependency versions.
src/main/java/aquality/selenium/browser/... Added BrowserWindowNavigation class, updated Browser.java, and enhanced navigation interfaces.
src/main/java/aquality/selenium/browser/JavaScript.java Added new JavaScript actions for opening windows.
src/main/resources/js/... Introduced JavaScript files for window operations.
src/main/resources/localization/... Updated localization files with new entries for navigation and window handling.
src/test/java/tests/integration/... Updated integration tests and adjusted imports for Selenium DevTools versions.

🐇✨
In the realm of code, where browsers leap,
A rabbit hopped, not missing a beat.
Tabs to windows, it danced with grace,
Updating, upgrading, at a brisk pace.
With a twirl and a click, new paths it weaves,
"Hop along," it chirps, "to the web we cleave!"
🌐🚀

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

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

@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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8107606 and 0521504.
Files selected for processing (20)
  • pom.xml (2 hunks)
  • src/main/java/aquality/selenium/browser/Browser.java (1 hunks)
  • src/main/java/aquality/selenium/browser/BrowserWindowNavigation.java (1 hunks)
  • src/main/java/aquality/selenium/browser/IBrowserTabNavigation.java (1 hunks)
  • src/main/java/aquality/selenium/browser/IBrowserWindowNavigation.java (1 hunks)
  • src/main/java/aquality/selenium/browser/JavaScript.java (1 hunks)
  • src/main/resources/js/openInNewWindow.js (1 hunks)
  • src/main/resources/js/openNewWindow.js (1 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)
  • src/test/java/tests/integration/BrowserTabsTests.java (3 hunks)
  • src/test/java/tests/integration/BrowserTests.java (1 hunks)
  • src/test/java/tests/integration/BrowserWindowsTests.java (1 hunks)
  • src/test/java/tests/usecases/devtools/DevToolsSessionTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1 hunks)
Files skipped from review due to trivial changes (7)
  • pom.xml
  • src/main/java/aquality/selenium/browser/JavaScript.java
  • src/main/resources/js/openInNewWindow.js
  • src/main/resources/js/openNewWindow.js
  • src/test/java/tests/integration/BrowserTests.java
  • src/test/java/tests/integration/BrowserWindowsTests.java
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java
Additional comments not posted (12)
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)

5-5: Updated import statement aligns with the new Selenium version.

src/main/java/aquality/selenium/browser/IBrowserWindowNavigation.java (1)

1-125: Interface IBrowserWindowNavigation correctly implements the new window navigation functionalities.

src/main/java/aquality/selenium/browser/BrowserWindowNavigation.java (1)

1-130: Class BrowserWindowNavigation correctly implements the IBrowserWindowNavigation interface with detailed logging.

src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1)

11-11: Updated import statement aligns with the new Selenium version.

src/main/java/aquality/selenium/browser/IBrowserTabNavigation.java (1)

9-178: Interface IBrowserTabNavigation correctly deprecates old tab-specific methods and extends IBrowserWindowNavigation.

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

91-99: New localization strings correctly describe the functionalities for browser window and tab operations.

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

91-99: Ensure the new localization strings are consistent with the feature's functionality.

The new strings for navigating in new windows and tabs, switching to specific windows or tabs, and opening or closing them are correctly added and reflect the intended functionality.

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

91-99: Ensure the new localization strings are consistent with the feature's functionality.

The new strings for navigating in new windows and tabs, switching to specific windows or tabs, and opening or closing them are correctly added and reflect the intended functionality.

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

91-99: Ensure the new localization strings are consistent with the feature's functionality.

The new strings for navigating in new windows and tabs, switching to specific windows or tabs, and opening or closing them are correctly added and reflect the intended functionality.

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

91-99: Ensure the new localization strings are accurate and clear.

The newly added localization strings for managing browser windows and navigating in new windows are clear and seem to accurately reflect the intended functionalities. Good job on maintaining consistency with existing localization patterns.

src/main/java/aquality/selenium/browser/Browser.java (2)

139-144: Review the deprecation of the tabs() method.

The tabs() method has been deprecated and replaced with a new method windows(). Ensure that all references to the tabs() method in the codebase are updated to use windows(). This change aligns with the new focus on window navigation.


147-151: Review the implementation of the new windows() method.

The new windows() method is implemented correctly and provides an interface to manage browser windows. This is a crucial part of the new feature set introduced in this PR, and it has been integrated well with the existing architecture.

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: 2

Out of diff range and nitpick comments (1)
src/test/java/w3schools/forms/SelectMultipleForm.java (1)

49-49: Ensure detailed logging for exceptions.

While logging the exception in the submit method, consider adding more contextual information to help with debugging. For example, log the state of the form or other relevant details at the time of the exception.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0521504 and e3fdbb8.
Files selected for processing (1)
  • src/test/java/w3schools/forms/SelectMultipleForm.java (4 hunks)
Additional comments not posted (2)
src/test/java/w3schools/forms/SelectMultipleForm.java (2)

34-34: Optimize waiting strategy for cookie acceptance.
[PERFORMANCE]
The method acceptCookies uses a fixed timeout for waiting for the cookie button to display. Consider using a more dynamic waiting strategy, such as polling the button state at intervals, to potentially reduce waiting time and improve test execution speed.


21-21: Ensure consistent use of static imports.
[CONSISTENCY]
The static import of getConfiguration is used in the acceptCookies method. Ensure that this style is consistent across the project. If other parts of the project use direct method calls instead of static imports, consider aligning this usage to maintain consistency.

Copy link

sonarqubecloud bot commented May 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
16 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mialeska mialeska merged commit de3307a into master May 6, 2024
4 checks passed
@mialeska mialeska deleted the enhancement/update-to-selenium-4.20.0 branch May 6, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant