-
Notifications
You must be signed in to change notification settings - Fork 35
Update to Selenium 4.38.0 +semver:feature #155
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
Conversation
Update DevTools references to use V142
WalkthroughUpdated Maven dependency for aquality-selenium-core from version 4.9.0 to 4.10.0. Systematically upgraded Selenium DevTools imports across source and test files from v140 and v139 to v142 and v141 respectively. Minor API signature adjustments made to NetworkHandling method calls. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
|
There was a problem hiding this 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
🧹 Nitpick comments (1)
src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (1)
203-203: v142 getResponseBody usage is correct; you can simplify with the existing static importCalling
tools.sendCommand(org.openqa.selenium.devtools.v142.network.Network.getResponseBody(requestId))correctly targets the v142 Network API. Given the static import forv142.network.Network.*at the top of the file, you can simplify this line slightly:- String responseBody = tools.sendCommand(org.openqa.selenium.devtools.v142.network.Network.getResponseBody(requestId)).getBody(); + String responseBody = tools.sendCommand(getResponseBody(requestId)).getBody();This keeps the version in one place (the import) and improves readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
pom.xml(1 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(7 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)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 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.
📚 Learning: 2024-11-29T14:35:07.825Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 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.
Applied to files:
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.javasrc/main/java/aquality/selenium/browser/devtools/NetworkHandling.javasrc/main/java/aquality/selenium/browser/devtools/DevToolsHandling.javasrc/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.javasrc/test/java/tests/usecases/devtools/DeviceEmulationTest.javasrc/main/java/aquality/selenium/browser/devtools/EmulationHandling.javasrc/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java
📚 Learning: 2025-05-28T19:55:33.768Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 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.
Applied to files:
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.javasrc/main/java/aquality/selenium/browser/devtools/DevToolsHandling.javasrc/test/java/tests/usecases/devtools/DeviceEmulationTest.javasrc/main/java/aquality/selenium/browser/devtools/EmulationHandling.java
📚 Learning: 2025-07-17T16:29:16.404Z
Learnt from: mialeska
Repo: aquality-automation/aquality-selenium-java PR: 152
File: azure-pipelines.yml:51-63
Timestamp: 2025-07-17T16:29:16.404Z
Learning: Maven3 task in Azure DevOps pipelines was officially deprecated in June 2024. Maven4 is the current supported version that should be used in Azure DevOps pipelines. Maven3 emits warnings and may be removed without further notice.
Applied to files:
pom.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: aquality-automation.aquality-selenium-java (Run tests)
- GitHub Check: aquality-automation.aquality-selenium-java (Analyse code with SonarQube)
🔇 Additional comments (9)
src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java (1)
5-8: DevTools Emulation imports bumped to v142 – confirm key method signatures still matchImports for
RGBA,Emulation,MediaFeature, andScreenOrientationnow targetv142. The rest of the class (including the 14‑argumentEmulation.setDeviceMetricsOverrideandsetUserAgentOverridecalls) is unchanged, so this should be a straight version bump; please just confirm that the v142 signatures still match the existing usages when building against Selenium 4.38.0 / aquality‑selenium‑core 4.10.0. Based on learnings.src/test/java/tests/usecases/devtools/DeviceEmulationTest.java (1)
6-7: Device emulation tests moved to DevTools v141 – consistent with pattern, verify compile against new APIsSwitching
EmulationandDisplayFeatureimports tov141keeps tests slightly behind main code (v142), which matches the project’s prior approach of using custom DevTools versions in tests. Please verify that theEmulation.setDeviceMetricsOverrideandDisplayFeatureusages still compile cleanly with the v141 API under Selenium 4.38.0. Based on learnings.src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)
5-5: ConnectionType import updated to v141 – ensure enum values are unchangedThe
ConnectionTypeimport now targetsv141, and the existing uses (BLUETOOTH,CELLULAR4G) are unchanged. This looks like a safe mechanical bump; just confirm those enum constants still exist with the same names in the v141 network model. Based on learnings.src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java (1)
15-17: JavaScript DevTools imports switched to v142 – behavior unchanged if APIs are compatible
Page,ScriptIdentifier, andRuntimenow come fromv142, while the calling code (removing scripts, adding/removing bindings, enabling runtime) is unchanged. Assuming v142 maintains these methods and parameter shapes, this is a pure version bump; please confirm it compiles and runtime behavior in your JS‑monitoring tests remains the same.src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java (1)
11-11: OverrideUserAgent tests now use Emulation v141 – keep an eye onsetUserAgentOverridesignaturePointing
Emulationtov141aligns these tests with the other DevTools test updates while main code uses v142. The directEmulation.setUserAgentOverridecalls (both viasendCommandand CDP command name) should still be valid, but please confirm v141’ssetUserAgentOverrideparameter list matches your usages (UA, accept‑language, platform, etc.). Based on learnings.pom.xml (1)
73-73: Core library bumped to 4.10.0 – validate it’s the intended companion for Selenium 4.38.0Updating
aquality-selenium-coreto4.10.0matches the DevTools v142/v141 migration in this PR. Please confirm that this core version is explicitly built against Selenium 4.38.0 so you don’t get subtle DevTools API mismatches at runtime; a full Maven build plus test run should surface any issues.src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java (1)
12-13: Performance domain moved to v142 – confirmEnableTimeDomainvalues are still valid
PerformanceandMetricnow come fromv142, while the code still usesPerformance.disable(),Performance.enable(Optional.of(EnableTimeDomain.fromString(timeDomain))), andPerformance.getMetrics(). This looks correct; just ensure thetimeDomainvalues you pass (timeTicks,threadTicks) are still the allowed values in v142 and that the metrics map returned bygetMetrics()hasn’t changed shape.src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java (2)
11-30: Network DevTools moved to v142 – imports and references look coherentThe network model import has been updated to
v142.network.model.*, the static import now targetsv142.network.Network.*, and the class Javadoc points at the v142 Network class. Given the existing usages (RequestWillBeSent,ResponseReceived,ConnectionType, and the static event factories) are unchanged, this is a consistent version bump; compilation against Selenium 4.38.0 should confirm everything lines up.
133-133: Updated Network.enable(...) calls to new v142 signature – verify that defaulted options are acceptableThe calls to
enable(...)in both listeners and bothemulateConditionsoverloads now pass fiveOptional.empty()arguments, matching the newer v142 Network API shape. That’s a sensible default if you don’t rely on any of the extra configuration knobs; please double‑check the v142enableJavadoc to ensure that leaving all these parameters empty keeps behavior equivalent to the previous version (e.g., no unintended throttling or buffer limits).Also applies to: 143-143, 325-325, 342-342



+Update DevTools references to use V142