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

Update to Selenium 4.25.0 #147

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

mialeska
Copy link
Contributor

No description provided.

@mialeska mialeska added dependencies Pull requests that update a dependency file java labels Oct 15, 2024
@mialeska mialeska self-assigned this Oct 15, 2024
Copy link

coderabbitai bot commented Oct 15, 2024

Walkthrough

The changes in this pull request involve updates to the pom.xml file and several test classes. The pom.xml has been modified to update the versions of three dependencies: aquality-selenium-core, jackson-databind, and slf4j-simple. Additionally, the import statements in the test classes have been updated to reflect the new version (v129) of the Selenium DevTools API, specifically for classes related to device emulation and network speed emulation. Furthermore, a constant in the ChromeDownloadsForm class has been modified to change the method of locating a nested shadow root element.

Changes

File Change Summary
pom.xml Updated dependency versions: aquality-selenium-core from 4.1.0 to 4.2.0, jackson-databind from 2.17.2 to 2.18.0, slf4j-simple from 2.0.13 to 2.0.16.
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java Updated import statements for Emulation and DisplayFeature from v128 to v129.
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java Updated import statement for ConnectionType from v128 to v129.
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java Updated import statement for Emulation from v128 to v129.
src/test/java/forms/ChromeDownloadsForm.java Changed NESTED_SHADOW_ROOT_LOCATOR from By.id("moreActionsMenu") to By.cssSelector("cr-toolbar").
src/test/java/tests/integration/elements/HiddenElementsTests.java Added import for AqualityServices and updated testHiddenElementsNotDisplayed method to use conditional wait.

Possibly related PRs

  • Implement native scroll actions and use Selenium 4.23.0 #142: The changes in this PR involve updates to the pom.xml file for the aquality-selenium-core dependency, which is also updated in the main PR from 4.1.0 to 4.2.0, indicating a related effort to keep dependencies current.
  • Update to use Selenium 4.24.0 #146: This PR also updates the jackson-databind dependency in the pom.xml, similar to the main PR, which updates it from 2.17.2 to 2.18.0, showing a common focus on dependency management.
  • Update to Selenium 4.22.0 #141: This PR updates the aquality-selenium-core dependency from 4.0.2 to 4.0.3, which is a related change as it reflects ongoing updates to the same dependency mentioned in the main PR.

Suggested labels

feature

🐇 In a world of code, we hop and play,
New versions come, brightening the day.
Dependencies fresh, tests now align,
With every change, our code will shine!
So here's to updates, both big and small,
In the garden of code, we nurture them all! 🌱


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 163314f and 9bf66d3.

📒 Files selected for processing (1)
  • src/test/java/tests/integration/elements/HiddenElementsTests.java (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
src/test/java/tests/integration/elements/HiddenElementsTests.java (2)

3-3: LGTM: Import statement added for AqualityServices

The addition of this import statement is necessary for the changes made in the test method. It's consistent with the PR objective of updating to Selenium 4.25.0.


60-60: Excellent improvement: Replaced direct assertion with conditional wait

This change enhances the test's reliability by introducing a conditional wait mechanism. Instead of immediately asserting the elements' state, it allows for a short wait period, which can help prevent flaky tests, especially when dealing with dynamic web pages or slow-loading elements.

The logic remains the same (checking if all elements are not displayed), but the implementation is more resilient. This aligns well with best practices in Selenium testing and the overall objective of updating to Selenium 4.25.0.


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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0491b03 and 039d704.

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

5-5: LGTM! Verify test execution with the updated Selenium version.

The import statement has been correctly updated to use the latest version (v129) of the Selenium DevTools API, which aligns with the PR objective of updating to Selenium 4.25.0. This change should introduce the latest features and bug fixes from the Selenium DevTools API.

To ensure the test still functions correctly with the new version, please run the following verification:

This script will run the NetworkSpeedEmulationTest and verify that it still passes with the updated Selenium version.

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

Line range hint 41-54: Verify test behavior after Selenium update.

The Emulation and DisplayFeature classes from the updated Selenium version are used in the setAndClearDeviceMetricsOverrideWithVersionSpecificParametersTest method. While the code structure remains the same, it's crucial to ensure that the behavior of these classes hasn't changed in a way that could affect the test results.

Please run this test class and verify that:

  1. All tests pass successfully.
  2. The behavior of the setDeviceMetricsOverride method in the Emulation class remains consistent with the previous version.
  3. The DisplayFeature class still functions as expected within the test.

If you encounter any issues or unexpected behavior, please update the test code accordingly.

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

Line range hint 1-103: Verify test compatibility with the updated Selenium version.

While the import statement has been updated correctly, it's crucial to ensure that all tests in this file still pass with the new version of the Selenium DevTools API (v129).

Please run these tests and confirm that they all pass successfully. If any failures occur, they may need to be addressed to maintain compatibility with the updated Selenium version.

Additionally, consider adding a note in your PR description or comments indicating that these tests have been run and verified with the new version.


11-11: LGTM: Import statement updated correctly.

The import statement has been successfully updated to use the latest version (v129) of the Selenium DevTools API for the Emulation class. This change aligns with the PR objective of updating to Selenium 4.25.0.

To ensure that this change doesn't introduce any compatibility issues, please run the following command to check for any other occurrences of v128 in the codebase:

If the command returns any results, those files may need to be updated as well.

✅ Verification successful

Verification Successful: No Remaining v128 Imports

All v128 imports have been successfully updated to v129. No remaining v128 imports were found in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining v128 imports that might need updating

rg --type java "import org\.openqa\.selenium\.devtools\.v128\."

Length of output: 65


Script:

#!/bin/bash
# Description: Verify if there are any remaining v128 imports in Java files

# Search for v128 imports and store the results
results=$(rg --type java "import org\.openqa\.selenium\.devtools\.v128\.")

# Check if the command was successful
if [ $? -ne 0 ]; then
  echo "Error: Failed to execute the search command."
  exit 1
fi

# Evaluate the search results
if [ -z "$results" ]; then
  echo "No remaining v128 imports found."
else
  echo "Remaining v128 imports detected:"
  echo "$results"
fi

Length of output: 203


Script:

#!/bin/bash
# Description: Verify if there are any remaining v128 imports in Java files using find and grep

# Search for v128 imports in Java files
matches=$(find . -type f -name "*.java" -exec grep -H "import org\.openqa\.selenium\.devtools\.v128\." {} \;)

# Check if the find and grep commands were successful
if [ $? -ne 0 ]; then
  echo "Error: Failed to execute the search commands."
  exit 1
fi

# Evaluate the search results
if [ -z "$matches" ]; then
  echo "No remaining v128 imports found."
else
  echo "Remaining v128 imports detected:"
  echo "$matches"
fi

Length of output: 224

pom.xml (4)

95-95: Approve jackson-databind update and request update rationale.

The update of jackson-databind from 2.17.2 to 2.18.0 is a minor version increment, which is generally good for keeping dependencies up-to-date.

Could you please provide the rationale for updating jackson-databind? While keeping dependencies updated is important, it would be helpful to understand if this update is necessary for the Selenium 4.25.0 upgrade or if it addresses any specific issues.


100-100: Approve slf4j-simple update and request update rationale.

The update of slf4j-simple from 2.0.13 to 2.0.16 is a patch version increment, which typically includes bug fixes and minor improvements. This is good for maintaining up-to-date dependencies.

Could you please clarify the reason for updating slf4j-simple? While it's generally good to keep dependencies updated, it would be helpful to understand if this update is related to the Selenium 4.25.0 upgrade or if it addresses any specific issues in the project.


Line range hint 85-100: Verify completeness of Selenium 4.25.0 update.

The changes in this file include updates to three dependencies: aquality-selenium-core, jackson-databind, and slf4j-simple. While these updates are generally good for keeping the project up-to-date, there seems to be a discrepancy between these changes and the PR title, which mentions updating to Selenium 4.25.0.

Please confirm if additional changes are needed to complete the Selenium 4.25.0 update. You may want to check the following:

  1. Are there any direct Selenium dependencies that need to be updated in this file?
  2. Are the current changes sufficient to support Selenium 4.25.0, or are there other files that need modification?
  3. If the Selenium update is handled indirectly through aquality-selenium-core, consider updating the PR title or description to clarify this.

85-85: Approve aquality-selenium-core update and verify Selenium version.

The update of aquality-selenium-core from 4.1.0 to 4.2.0 is a minor version increment, which is good. This change likely contributes to the Selenium update mentioned in the PR title.

Please confirm that this update includes or is compatible with Selenium 4.25.0 as mentioned in the PR title. You can verify this by checking the aquality-selenium-core 4.2.0 release notes or dependencies.

@mialeska mialeska changed the title Update to Selenium 4.25.0 +semver:feature Update to Selenium 4.25.0 Oct 16, 2024
@mialeska mialeska merged commit 974cf90 into master Oct 16, 2024
3 checks passed
@mialeska mialeska deleted the enhancement/update-to-selenium-4.25.0 branch October 16, 2024 10:11
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 java
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant