Skip to content

Update to Selenium 4.34.0 +semver:feature #152

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

Merged
merged 5 commits into from
Jul 18, 2025

Conversation

mialeska
Copy link
Contributor

Sonatype deploy: publish with central-publishing-maven-plugin, use maven versions plugin

Sonatype deploy: publish with central-publishing-maven-plugin, use maven versions plugin
@mialeska mialeska self-assigned this Jul 17, 2025
@mialeska mialeska added enhancement New feature or request dependencies Pull requests that update a dependency file java labels Jul 17, 2025
@github-project-automation github-project-automation bot moved this to In progress in Aquality Selenium Jul 17, 2025
Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

This update upgrades Selenium DevTools protocol imports from version 137 to 138 across source and test files, adjusts Maven POM dependencies and plugins to newer versions, and modernizes the Maven Central publishing workflow. The Maven project version and repository configuration are also revised, with some plugins replaced or newly configured. Additionally, Azure pipeline tasks for SonarCloud integration and Maven usage were enhanced, and Chrome driver settings were added or updated in test resources. Minor test code improvements and UI navigation logic cleanup were also applied.

Changes

File(s) Change Summary
.github/workflows/release-maven-central.yml Updated Maven Central publishing workflow: changed server ID, split version setting and deploy steps, improved command flags.
pom.xml Set fixed project version, removed <revision> and <distributionManagement>, updated dependencies/plugins, replaced staging plugin.
src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java
src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java
src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java
Updated Selenium DevTools imports from v137 to v138.
src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java Updated DevTools Network API imports and method signatures from v137 to v138; adjusted enable command and post data handling.
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java
Updated DevTools imports in test files from v137 to v138.
src/test/java/tests/usecases/devtools/NetworkInterceptionTests.java Replaced ByteArrayInputStream with Contents.utf8String for HTTP response content; updated imports.
azure-pipelines.yml Enhanced SonarCloud integration with new tasks and upgraded Maven task versions; refined Java version specification and build goals.
src/test/resources/settings.json Added "pageLoadStrategy": "normal" property to Chrome driver settings configuration.
src/test/resources/settings.local.json Added "pageLoadStrategy": "normal", updated Chrome driver start/excluded arguments, and adjusted timeout values.
src/test/java/manytools/ManyToolsForm.java Removed explicit page load wait and Agree button click logic after navigation in open() method.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Maven Central

    Developer->>GitHub Actions: Push code / trigger release workflow
    GitHub Actions->>GitHub Actions: Set project version via Maven (versions:set)
    GitHub Actions->>GitHub Actions: Deploy to Maven Central (skip tests)
    GitHub Actions->>Maven Central: Publish artifacts
Loading

Poem

In the warren of code, we hop and we play,
Upgrading DevTools to a brand-new day.
Maven commands now split with care,
New versions and plugins everywhere!
With v138, we leap ahead—
A rabbit’s joy as bugs are shed!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1241154 and 86937e2.

📒 Files selected for processing (3)
  • src/test/java/manytools/ManyToolsForm.java (0 hunks)
  • src/test/resources/settings.json (1 hunks)
  • src/test/resources/settings.local.json (2 hunks)
💤 Files with no reviewable changes (1)
  • src/test/java/manytools/ManyToolsForm.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/resources/settings.json
  • src/test/resources/settings.local.json
✨ Finishing Touches
  • 📝 Generate Docstrings

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

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

🔭 Outside diff range comments (1)
.github/workflows/release-maven-central.yml (1)

23-27: setup-java step is given variable names instead of secret values

actions/setup-java expects the actual credentials, not the names of variables. With the current config, Maven settings.xml will contain the literals MVN_CENTRAL_USERNAME / MVN_CENTRAL_PASSWORD, causing 401s on deploy.

Fix:

-        server-id: central
-        server-username: MVN_CENTRAL_USERNAME
-        server-password: MVN_CENTRAL_PASSWORD
-        gpg-passphrase: MVN_GPG_PASSPHRASE
+        server-id: central
+        server-username: ${{ secrets.OSSRH_USERNAME }}
+        server-password: ${{ secrets.OSSRH_TOKEN }}
+        gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}

(or export the env vars before this step).
Without this adjustment the workflow will fail at the very first Maven invocation.

🧹 Nitpick comments (1)
pom.xml (1)

235-238: versions-maven-plugin is added but unused

Great to have the plugin pinned; however, no execution or profile invokes it.
If you intend to rely on it from the workflow only, that’s fine; otherwise consider adding a goal (e.g. versions:display-dependency-updates) to a maintenance profile.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f04443e and 6ffc85b.

📒 Files selected for processing (10)
  • .github/workflows/release-maven-central.yml (2 hunks)
  • pom.xml (10 hunks)
  • src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (1 hunks)
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (8 hunks)
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/NetworkInterceptionTests.java (3 hunks)
  • src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1 hunks)
  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (2)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
🔇 Additional comments (18)
src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (1)

15-17: Version bump looks safe – verify compile & runtime classpath alignment

Switching DevTools imports from v137 to v138 is a clean mechanical upgrade. Please double-check:

  1. selenium-devtools-v138 is present in the POM and on the runtime classpath.
  2. Dependent APIs (Page.removeScriptToEvaluateOnNewDocument, Runtime.*) kept compatible signatures between 137 → 138 – a full compile will surface any mismatch.
  3. No modules still reference v137; mixing versions typically results in ClassCastExceptions.

Assuming the rest of the PR aligns, this change looks good. 👍

pom.xml (1)

224-233: central-publishing-maven-plugin introduced, but remember it disables snapshot deployment

Switching from nexus-staging-maven-plugin to central-publishing-maven-plugin will successfully release to Central, but SNAPSHOT pushes now have no target repository because <distributionManagement> was removed.
Verify that you don’t rely on mvn deploy -DskipTests for nightly/snapshot builds, or add an alternate snapshot repository in the company settings if required.

.github/workflows/release-maven-central.yml (1)

57-63: Nice split between versions:set and deploy

Separating version bump from deployment keeps logs clear and avoids re-running the entire lifecycle if versioning fails. Good job.

src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (1)

12-13: Please manually verify Selenium dependency versions
I wasn’t able to locate any selenium-java or selenium-devtools coordinates in the build scripts via automated search. To ensure your v138 imports compile correctly, confirm that:

  • Your project depends on Selenium ≥ 4.34.0 (first release that includes v138 stubs).
  • You’ve declared the matching DevTools artifact (selenium-devtools-v138 or the umbrella selenium-devtools).

For Maven, check your pom.xml(s):

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>4.34.0</version>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-devtools-v138</artifactId>
  <version>4.34.0</version>
</dependency>

For Gradle:

implementation 'org.seleniumhq.selenium:selenium-java:4.34.0'
implementation 'org.seleniumhq.selenium:selenium-devtools-v138:4.34.0'

Once you’ve confirmed or updated these, the migration to v138 will be fully complete.

src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (1)

5-8: Confirm API compatibility after bumping to v138

RGBA, Emulation, MediaFeature, and ScreenOrientation moved to the v138 namespace, but their method signatures occasionally change between protocol revisions.
Compile-time will catch mismatches, but CI doesn’t always run locally—please run mvn test-compile (or the Gradle equivalent) before merging.

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

5-5: Import version updated – looks good

The test keeps the logic intact while aligning with DevTools v138.

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

11-11: Import bump acknowledged

No behavioural change; compilation only.

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

6-7: Import bump acknowledged

Device-emulation tests stay unchanged except for the namespace switch.

src/test/java/tests/usecases/devtools/NetworkInterceptionTests.java (4)

8-8: LGTM: Import updated for modernized API usage.

The import of Contents class aligns with the updated Selenium API and supports the more concise content setting approach used in the test methods.


22-22: LGTM: Static import enhances readability.

The static import for utf8String method improves code readability and follows modern Java practices.


90-90: LGTM: Modernized content setting approach.

The change from new ByteArrayInputStream(somePhrase.getBytes()) to Contents.utf8String(somePhrase) is a good modernization that:

  • Eliminates manual byte array handling
  • Uses the appropriate utility method from Selenium's API
  • Maintains the same functionality with cleaner code

109-109: LGTM: Consistent modernization of content setting.

This change mirrors the improvement in the request handler test, maintaining consistency across the test suite while using the modernized Selenium API.

src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (6)

11-11: LGTM: Import updated for DevTools v138.

The import statement correctly references the v138 network model classes, consistent with the broader upgrade.


25-25: LGTM: Static import updated consistently.

The static import correctly references the v138 Network class, maintaining consistency with the model import.


29-29: LGTM: Javadoc reference updated.

The Javadoc correctly references the v138 Network class, ensuring documentation accuracy.


202-202: LGTM: Response body retrieval updated to v138 namespace.

The fully qualified class name correctly references the v138 Network class for the getResponseBody() method call, ensuring consistency with the import changes.


182-182: Verify DevTools Request API method names
Please confirm that in your Selenium/CDP dependency (v138+), the Request class defines getPostDataEntries() and that getPostData() has been removed or renamed.

• Location: src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java:182
• Snippet:

request.getPostDataEntries().orElse(null)

This change assumes an API update in CDP v138—make sure your project’s DevTools version matches.


132-132: Verify Network.enable() signature
The calls to enable(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()) now include four parameters, suggesting the v138 API’s Network.enable method has expanded its signature. Please confirm that in org.openqa.selenium.devtools.v138.network.Network, the enable command indeed accepts four Optional arguments.

Applicable locations:

  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java:132
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java:142
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java:325
  • src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java:341

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6ffc85b and 67c90c4.

📒 Files selected for processing (2)
  • azure-pipelines.yml (1 hunks)
  • src/test/resources/settings.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/test/resources/settings.json
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#148
File: src/test/java/tests/usecases/devtools/DeviceEmulationTest.java:6-7
Timestamp: 2024-11-29T14:35:07.825Z
Learning: In this project, the use of custom DevTools Protocol version (v131) in test files is intentional, even if it differs from the version used in the main source code.
Learnt from: mialeska
PR: aquality-automation/aquality-selenium-java#150
File: src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java:121-121
Timestamp: 2025-05-28T19:55:33.768Z
Learning: The DevTools v137 `Emulation.setDeviceMetricsOverride` method has 14 parameters, not 13 as some documentation might suggest. Recent versions of the Selenium DevTools API have added additional parameters to this method.

Copy link

@mialeska mialeska merged commit 2445805 into master Jul 18, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Aquality Selenium Jul 18, 2025
@mialeska mialeska deleted the enhancement/update-to-selenium-4.34.0 branch July 18, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request java
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant