Skip to content

Update to Selenium 4.27.0 +semver:feature #148

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 1 commit into from
Nov 29, 2024

Conversation

mialeska
Copy link
Contributor

No description provided.

@mialeska mialeska added enhancement New feature or request java labels Nov 29, 2024
@mialeska mialeska self-assigned this Nov 29, 2024
Copy link

coderabbitai bot commented Nov 29, 2024

Walkthrough

The changes in this pull request involve updates to the pom.xml file, primarily focusing on modifying the versions of various dependencies and plugins. Notably, the aquality-selenium-core and jackson-databind dependencies were updated, along with several Maven plugins such as the maven-compiler-plugin and maven-surefire-plugin. Additionally, the test classes related to device emulation and network speed emulation were updated to reflect changes in the Selenium DevTools API, specifically updating import statements to utilize version 131 instead of version 129.

Changes

File Path Change Summary
pom.xml Updated dependency versions: aquality-selenium-core (4.2.0 to 4.3.0), jackson-databind (2.18.0 to 2.18.2). Updated plugin versions for maven-compiler-plugin, jacoco-maven-plugin, maven-surefire-plugin, maven-source-plugin, maven-javadoc-plugin, maven-gpg-plugin, and nexus-staging-maven-plugin.
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java Updated import statements for Emulation and DisplayFeature from version 129 to 131. Updated method to use new Emulation.setDeviceMetricsOverride command.
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java Updated import statement for ConnectionType from version 129 to 131. Test logic remains unchanged.
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java Updated import statement for Emulation from version 129 to 131. Test logic remains unchanged.

Possibly related PRs

  • Update to Selenium 4.22.0 #141: This PR updates the aquality-selenium-core dependency in pom.xml, which is directly related to the version update of the same dependency in the main PR.
  • Implement native scroll actions and use Selenium 4.23.0 #142: Similar to the main PR, this PR also updates the aquality-selenium-core dependency version, indicating a related effort to keep dependencies current.
  • Update to use Selenium 4.24.0 #146: This PR updates the jackson-databind dependency version in pom.xml, which aligns with the changes made in the main PR regarding the same dependency.
  • Update to Selenium 4.25.0 #147: This PR updates the aquality-selenium-core and jackson-databind dependencies, reflecting similar changes to those in the main PR, particularly in the context of dependency management.

Suggested labels

dependencies, feature

🐇 In the garden of code, we hop and play,
Updating our tools in a merry way.
From four point two to four point three,
New versions bring joy, oh can’t you see?
With plugins refreshed, our tests will gleam,
In the world of Selenium, we chase our dream! 🌼✨


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>, please review it.
    • 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 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 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 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 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 and nitpick comments (1)
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)

Line range hint 13-17: Add documentation for throughput constants

Consider adding comments to explain the throughput values (in bytes/second) and latency (in milliseconds) to improve code maintainability.

-    private static final int DOWNLOAD_THROUGHPUT = 53;
-    private static final int DOWNLOAD_THROUGHPUT_BIG = 530000;
-    private static final int UPLOAD_THROUGHPUT = 27;
-    private static final int UPLOAD_THROUGHPUT_BIG = 270000;
-    private static final int LATENCY = 27;
+    // Throughput values in bytes/second
+    private static final int DOWNLOAD_THROUGHPUT = 53;        // Slow: ~0.4 Kbit/s
+    private static final int DOWNLOAD_THROUGHPUT_BIG = 530000;// Fast: ~4.2 Mbit/s
+    private static final int UPLOAD_THROUGHPUT = 27;         // Slow: ~0.2 Kbit/s
+    private static final int UPLOAD_THROUGHPUT_BIG = 270000; // Fast: ~2.1 Mbit/s
+    // Latency in milliseconds
+    private static final int LATENCY = 27;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 974cf90 and c479492.

📒 Files selected for processing (4)
  • pom.xml (9 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 comments (6)
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java (1)

5-5: Verify DevTools API version compatibility

The update from v129 to v131 of the DevTools API should be verified against Selenium 4.27.0's recommended version to ensure compatibility.

✅ Verification successful

DevTools API version update is consistent and valid

The update to v131 of the DevTools API is verified to be consistent across the test suite, with all test files (NetworkSpeedEmulationTest.java, DeviceEmulationTest.java, and OverrideUserAgentTest.java) using the same version. The implementation correctly uses the ConnectionType enum from v131 for network condition emulation, and the test logic remains functionally equivalent to the previous version.

  • All DevTools test files consistently use v131 imports
  • Main implementation classes still use v85 which is correct as they're in the core library
  • The ConnectionType usage in the test remains compatible with the updated API version
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if v131 is the correct DevTools version for Selenium 4.27.0

# Search for Selenium version in pom.xml
echo "Selenium version defined in pom.xml:"
rg -A 1 "<selenium.version>" || echo "Selenium version not found in pom.xml"

# Search for other DevTools imports to ensure consistency
echo -e "\nOther DevTools imports in the codebase:"
rg "org\.openqa\.selenium\.devtools\.v\d+" --type java

Length of output: 2751


Script:

#!/bin/bash
# Let's check the build.gradle or gradle files for Selenium version
echo "Checking build files for Selenium version:"
fd "build.gradle" --type f --exec cat {} \; || echo "No build.gradle found"

# Let's also check if there's a gradle.properties
echo -e "\nChecking gradle.properties:"
fd "gradle.properties" --type f --exec cat {} \; || echo "No gradle.properties found"

# Let's check the actual test file to see how ConnectionType is used
echo -e "\nChecking NetworkSpeedEmulationTest.java content:"
cat src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java || echo "File not found"

Length of output: 2369

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

11-11: LGTM! Version update aligns with Selenium upgrade.

The update from v129 to v131 of the Selenium DevTools API is consistent with the PR objective of upgrading to Selenium 4.27.0.

Let's verify the consistency of DevTools API version across the codebase:

pom.xml (4)

95-95: Verify jackson-databind compatibility

The jackson-databind update appears to be a minor version bump. Let's verify there are no breaking changes or security fixes.

✅ Verification successful

Version update from 2.18.0 to 2.18.2 is safe to proceed

The update is a patch version bump (2.18.0 → 2.18.2) within the same minor version. Based on the security vulnerabilities data:

  • The latest reported vulnerabilities affect versions much older than 2.18.0
  • The most recent vulnerability was patched in 2.13.4, well before our current version
  • No known security issues exist for the 2.18.x series

This version update follows semantic versioning principles and contains only backwards-compatible bug fixes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for CVEs and breaking changes in jackson-databind
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: MAVEN, package: "com.fasterxml.jackson.core:jackson-databind") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 1574


Script:

#!/bin/bash
# Let's check the current version and previous version in pom.xml
git show HEAD~1:pom.xml | grep -A 2 "jackson-databind"
echo "=== Current version ==="
grep -A 2 "jackson-databind" pom.xml

Length of output: 376


85-85: Verify Selenium version alignment with aquality-selenium-core

The PR title indicates an update to Selenium 4.27.0, but we need to verify if aquality-selenium-core 4.3.0 includes this version.


159-159: Review maven-surefire-plugin's breaking changes

The update from 3.2.5 to 3.5.2 is a major version jump that might introduce breaking changes in test execution behavior.

✅ Verification successful

Let me check the specific surefire configuration in the pom.xml to understand if there are any custom configurations that might be affected by the version update.


Let me check the TestSuite.xml configuration to ensure there are no potential conflicts with the new surefire version.


Maven Surefire Plugin update appears safe to proceed

The update from 3.2.5 to 3.5.2 should not cause any issues because:

  • The project uses a standard TestNG configuration with basic Surefire settings
  • The Surefire configuration only uses well-established parameters (argLine, reuseForks, suiteXmlFiles)
  • The TestSuite.xml follows standard TestNG format without any version-specific features
  • The parallel execution configuration in TestSuite.xml uses basic TestNG features that are stable across Surefire versions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any test configurations in the project might be affected
fd -e xml -e java -t f . | xargs rg -l 'surefire|@Test'

Length of output: 2279


Script:

#!/bin/bash
# Check maven-surefire-plugin configuration in pom.xml
rg -A 10 'maven-surefire-plugin' pom.xml

Length of output: 542


Script:

#!/bin/bash
# Check TestSuite.xml content
cat src/test/resources/TestSuite.xml

Length of output: 3046


Line range hint 1-245: Verify Selenium version compatibility across the project

The PR indicates an update to Selenium 4.27.0 and the AI summary mentions DevTools API updates. Let's verify all Selenium-dependent code is properly updated.

✅ Verification successful

No Selenium version compatibility issues found

The codebase appears to be properly structured with Selenium dependencies managed through aquality-selenium-core v4.3.0. The DevTools implementation is browser-agnostic and doesn't contain any version-specific CDP references, making it compatible with the updated Selenium version. The code uses a flexible approach to handle CDP commands through abstraction layers.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for Selenium imports and DevTools usage
echo "Checking Selenium imports and DevTools usage..."
rg -l "org\.openqa\.selenium"

# Check for any remaining v129 DevTools references
echo "Checking for old DevTools API versions..."
rg "DevTools.*v129"

# Look for potential Selenium version references in properties
echo "Checking for Selenium version properties..."
rg "selenium\.version|seleniumVersion"

Length of output: 6462


Script:

#!/bin/bash
# Let's check the actual Selenium version being used
echo "Checking Selenium dependencies..."
rg -A 5 "selenium" pom.xml

# Check for DevTools API usage
echo "Checking DevTools API usage..."
rg -A 3 "DevTools.*v\d+" src/

# Check for any Selenium WebDriver imports
echo "Checking WebDriver imports..."
rg "import.*org\.openqa\.selenium\.WebDriver"

Length of output: 2223


Script:

#!/bin/bash
# Let's check the actual Selenium version from aquality-selenium-core
echo "Checking aquality-selenium-core dependencies..."
rg -A 10 "selenium-java|selenium-api|selenium-remote-driver|selenium-support" src/

# Check for any DevTools implementation classes
echo "Checking DevTools implementation..."
ast-grep --pattern 'class $_ implements DevTools {
  $$$
}'

# Check for Chrome DevTools Protocol usage
echo "Checking CDP usage..."
rg "ChromeDevTools|CDP|DevTools\.create"

Length of output: 840

@mialeska mialeska merged commit 4dcec7b into master Nov 29, 2024
3 checks passed
@mialeska mialeska deleted the enhancement/update-to-selenium-4.27.0 branch November 29, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request java
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant