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

[java] Add the debuggerAddress capability back to Firefox options #15227

Merged
merged 7 commits into from
Feb 11, 2025

Conversation

pujagani
Copy link
Contributor

@pujagani pujagani commented Feb 4, 2025

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Tests, Bug fix


Description

  • Removed specific assertions in Ruby DevTools tests for better compatibility.

  • Marked a Python test as expected to fail in remote environments.

  • Excluded a problematic Python test from the Firefox test suite in Bazel.

  • Improved test stability and compatibility across environments.


Changes walkthrough 📝

Relevant files
Tests
devtools_spec.rb
Adjust Ruby DevTools test to improve compatibility             

rb/spec/integration/selenium/webdriver/devtools_spec.rb

  • Removed an assertion checking for 'location' in logs.
  • Simplified the test to avoid potential failures.
  • +0/-3     
    devtools_tests.py
    Mark Python test as expected to fail remotely                       

    py/test/selenium/webdriver/common/devtools_tests.py

  • Added @pytest.mark.xfail_remote to mark test as expected to fail in
    remote environments.
  • Enhanced test annotations for better environment handling.
  • +1/-0     
    Configuration changes
    BUILD.bazel
    Exclude problematic test from Firefox suite in Bazel         

    py/BUILD.bazel

  • Excluded devtools_tests.py from the Firefox test suite.
  • Adjusted Bazel configuration for better test suite management.
  • +7/-4     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @pujagani pujagani marked this pull request as ready for review February 11, 2025 09:24
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Test Stability

    The test is marked as expected to fail in remote environments, but the root cause should be investigated to determine if this is the best long-term solution versus fixing the underlying issue.

    @pytest.mark.xfail_remote
    Test Coverage

    Excluding devtools_tests.py from Firefox test suite reduces test coverage. Consider if there are alternative approaches to handle Firefox-specific devtools testing.

    exclude = ["test/selenium/webdriver/common/devtools_tests.py"],

    @pujagani pujagani merged commit ad9c5cb into SeleniumHQ:trunk Feb 11, 2025
    26 of 33 checks passed
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Add timeout handling for logs

    Add error handling around the console log check to prevent test flakiness if
    logs are not received in time

    rb/spec/integration/selenium/webdriver/devtools_spec.rb [109-114]

     driver.execute_script('console.log(document);')
    -wait.until { !logs.empty? }
    +begin
    +  wait.until { !logs.empty? }
    +  expect(logs).to include(
    +    an_object_having_attributes(type: :log, args: [hash_including('type' => 'object')])
    +  )
    +rescue Selenium::WebDriver::Error::TimeoutError
    +  fail "Console logs were not received within the timeout period"
    +end
     
    -expect(logs).to include(
    -  an_object_having_attributes(type: :log, args: [hash_including('type' => 'object')])
    -)
    -
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion adds robust error handling for potential timeout issues when waiting for console logs, which would make the test more reliable and provide clearer failure messages. This is particularly important for integration tests involving browser console interactions.

    Medium

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant