Skip to content

[py] fix driver_element_finding_tests.py #15863

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 3 commits into from
Jun 5, 2025
Merged

[py] fix driver_element_finding_tests.py #15863

merged 3 commits into from
Jun 5, 2025

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Jun 5, 2025

User description

Fixes CI issue from the latest commit

🔗 Related Issues

💥 What does this PR do?

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)
  • New feature (non-breaking change which adds functionality and tests!)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR Type

Bug fix


Description

  • Fixes regex in test for NoSuchElementException

  • Ensures test matches correct exception documentation link


Changes walkthrough 📝

Relevant files
Tests
driver_element_finding_tests.py
Update NoSuchElementException regex in test                           

py/test/selenium/webdriver/common/driver_element_finding_tests.py

  • Updated regex pattern for NoSuchElementException in test
  • Ensures test matches updated exception documentation link
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Fixes CI issue from the latest commit
    @selenium-ci selenium-ci added the C-py Python Bindings label Jun 5, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 5, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ❌

    1234 - Not compliant

    Non-compliant requirements:

    • Fix issue where Selenium 2.48 doesn't trigger JavaScript in link's href on click()

    Requires further human verification:

    • Need to verify if the regex change for exception documentation is related to the JavaScript click() issue

    5678 - Not compliant

    Non-compliant requirements:

    • Fix "ConnectFailure (Connection refused)" error when instantiating ChromeDriver

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

    Ticket Mismatch

    The PR changes a regex pattern for exception documentation but doesn't address the JavaScript click() issue mentioned in ticket #1234 or the ChromeDriver connection issue in ticket #5678.

    msg = r"\/errors#nosuchelementexception"
    with pytest.raises(NoSuchElementException, match=msg):

    @Delta456 Delta456 mentioned this pull request Jun 5, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 5, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Add case-insensitive regex matching

    The regex pattern should use a case-insensitive match to handle potential
    variations in URL casing. This makes the test more robust against documentation
    URL format changes.

    py/test/selenium/webdriver/common/driver_element_finding_tests.py [97]

    -msg = r"\/errors#nosuchelementexception"
    +msg = r"(?i)\/errors#nosuchelementexception"
    • Apply / Chat
    Suggestion importance[1-10]: 3

    __

    Why: The suggestion is technically valid but the existing_code doesn't exactly match the PR (shows \\/ instead of \/). Making the regex case-insensitive might reduce test precision unnecessarily since documentation URLs typically have consistent casing.

    Low
    • Update

    @Delta456 Delta456 requested a review from cgoldberg June 5, 2025 15:11
    Copy link
    Contributor

    @cgoldberg cgoldberg left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    LGTM, I already reverted the other PR... I'll merge it again then this on top of it. thanks!

    @cgoldberg cgoldberg merged commit dc5e0fe into trunk Jun 5, 2025
    3 of 4 checks passed
    @cgoldberg cgoldberg deleted the Delta456-patch-1 branch June 5, 2025 15:21
    @cgoldberg
    Copy link
    Contributor

    ok, should be all fixed now

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

    Successfully merging this pull request may close these issues.

    3 participants