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 use Selenium 4.24.0 #146

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

mialeska
Copy link
Contributor

@mialeska mialeska commented Sep 9, 2024

Update to use Selenium 4.24.0 +semver:feature
Use new FindElements logic from aquality-selenium-core to avoid possible StaleElementReference while iterating WebElements list
Add Clear method to ITextBox interface
Fix error on clearAndType to close #145

Use new FindElements logic from aquality-selenium-core to avoid possible StaleElementReference while iterating WebElements list
Add Clear method to ITextBox interface
Fix error on clearAndType #145
@mialeska mialeska added bug Something isn't working enhancement New feature or request dependencies Pull requests that update a dependency file java labels Sep 9, 2024
@mialeska mialeska self-assigned this Sep 9, 2024
Copy link

coderabbitai bot commented Sep 9, 2024

Walkthrough

This pull request introduces updates to several dependencies in the pom.xml file, enhancing the versioning of libraries such as aquality-selenium-core, commons-lang3, and jackson-databind. Additionally, it adds a new clear method to the TextBox class and the ITextBox interface, improving text handling functionality. The ActionTests class receives a new test method to validate the clear functionality, while various test files are updated to reflect changes in the Selenium DevTools API version.

Changes

File Path Change Summary
pom.xml Updated dependency versions: aquality-selenium-core to 4.1.0, commons-lang3 to 3.17.0, jackson-databind to 2.17.2.
src/main/java/aquality/selenium/elements/TextBox.java Added clear() method and enhanced retry logic for element actions.
src/main/java/aquality/selenium/elements/interfaces/ITextBox.java Added clear() method to the interface.
src/test/java/tests/integration/ActionTests.java Added testClear() method to validate the clear functionality of text boxes.
src/test/java/tests/usecases/devtools/DeviceEmulationTest.java Updated import statements to reflect Selenium DevTools API version change from 127 to 128.
src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java Updated import statement for ConnectionType from version 127 to 128.
src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java Updated import statement for Emulation from version 127 to 128.

Possibly related PRs

Suggested labels

feature

Poem

🐇 In the garden where bunnies play,
New tools and methods brighten the day.
With a hop and a skip, we clear the way,
For smoother paths in our code ballet!
Dependencies updated, oh what a delight,
Let's celebrate changes that feel just right! 🎉

Tip

New review model

We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.


New features

Walkthrough comment now includes:

  • Possibly related PRs: A list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

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.
    • @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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bad9669 and fb35b6e.

Files selected for processing (7)
  • pom.xml (1 hunks)
  • src/main/java/aquality/selenium/elements/TextBox.java (3 hunks)
  • src/main/java/aquality/selenium/elements/interfaces/ITextBox.java (1 hunks)
  • src/test/java/tests/integration/ActionTests.java (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)
Files skipped from review due to trivial changes (3)
  • pom.xml
  • src/test/java/tests/usecases/devtools/DeviceEmulationTest.java
  • src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java
Additional comments not posted (5)
src/main/java/aquality/selenium/elements/interfaces/ITextBox.java (1)

18-21: LGTM!

The addition of the clear() method to the ITextBox interface is a valid enhancement. It provides a clear contract for implementers to define the behavior of clearing the text in a text box element.

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

5-5: LGTM, but verify the test behavior.

The update to the import statement for the ConnectionType class from version 127 to version 128 of the Selenium DevTools network model is approved.

Please verify that the networkSpeedEmulationTest still behaves as expected and produces the correct results with the updated ConnectionType class. Ensure that the emulation of different network conditions (offline, slow, and fast) works as intended and the assertions are met.

src/main/java/aquality/selenium/elements/TextBox.java (2)

44-51: LGTM!

The implementation of the clear() method is consistent with the other methods in the TextBox class. It follows the pattern of logging the action, highlighting the element, and performing the action with a retry mechanism. The use of doWithRetry ensures that transient issues during the clear operation are handled gracefully.


78-84: LGTM!

The inclusion of JavascriptException in the list of handled exceptions enhances the error handling capabilities of the TextBox class. It ensures that JavaScript-related exceptions are also subject to the retry mechanism, improving the resilience of the text box interactions.

src/test/java/tests/integration/ActionTests.java (1)

136-149: LGTM!

The new testClear method is a valuable addition to the test suite. It thoroughly validates the functionality of the clear method on a text box under different conditions:

  1. When the text box is initially empty
  2. After typing a value
  3. When the clear method is called multiple times consecutively

The assertions are clear and ensure that the clear method behaves as expected in each scenario. The use of StringUtils.isEmpty from the Apache Commons Lang library is a good practice to check if the text box's value is empty after the clear operations.

Overall, the test method is well-structured and enhances the test coverage for the clear functionality.

@mialeska mialeska merged commit 0491b03 into master Sep 10, 2024
3 checks passed
@mialeska mialeska deleted the enhancement/update-to-selenium-4.24.0 branch September 10, 2024 09:11
@coderabbitai coderabbitai bot mentioned this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 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.

Error on Clear: JavascriptException: Element is not currently interactable and may not be manipulated
1 participant