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

[py] Fix test for w3c touch pointer properties #15580

Merged
merged 2 commits into from
Apr 6, 2025

Conversation

cgoldberg
Copy link
Contributor

@cgoldberg cgoldberg commented Apr 6, 2025

User description

💥 What does this PR do?

This PR fixes the test_touch_pointer_properties test in the internal Python test suite. It was failing in CI runs.

This test would run fine in isolation, but fail when the entire test file was run because the pointer state was leaked from a previous test.

This change resets the pointer to position 0, 0 at the beginning of the test so it is always in a known state when running.

🔄 Types of changes

  • Bug fix (backwards compatible)

PR Type

Bug fix


Description

  • Fixes test_touch_pointer_properties to reset pointer state.

  • Adds pointer reset action to ensure test isolation.

  • Clears event state before running the test.


Changes walkthrough 📝

Relevant files
Tests
w3c_interaction_tests.py
Fix and enhance `test_touch_pointer_properties` setup       

py/test/selenium/webdriver/common/w3c_interaction_tests.py

  • Added pointer reset action to ensure known starting state.
  • Cleared event state before running the test.
  • Adjusted test setup for better isolation and reliability.
  • +11/-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.
  • @selenium-ci selenium-ci added the C-py Python Bindings label Apr 6, 2025
    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 6, 2025

    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

    Variable Scope

    The touch_input variable was moved outside the ActionBuilder call, but it's now used before it's defined in the reset_actions. Verify this doesn't cause issues in other test execution contexts.

    touch_input = PointerInput(interaction.POINTER_TOUCH, "touch")

    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 6, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @cgoldberg
    Copy link
    Contributor Author

    The touch_input variable was moved outside the ActionBuilder call, but it's now used before it's defined in the reset_actions.

    It was not moved outside the ActionBuilder call and is not defined in reset_actions (although it's used there).

    I love arguing with this AI PR reviewer :)

    @cgoldberg
    Copy link
    Contributor Author

    All tests pass in CI except the 1 failure caused by #15581 (unrelated to this PR)

    @cgoldberg cgoldberg merged commit c551357 into SeleniumHQ:trunk Apr 6, 2025
    16 of 17 checks passed
    @cgoldberg cgoldberg deleted the py-fix-w3c-interactions-test branch April 6, 2025 05:58
    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.

    2 participants