passsy / spot

Chainable powerful Flutter widget selector API, screenshots and assertions for awesome widget tests.
https://pub.dev/packages/spot
Apache License 2.0
62 stars 1 forks source link

Identify and Utilize Interactable Areas of Partially Covered Widgets for Act Events #60

Closed danielmolnar closed 2 months ago

danielmolnar commented 2 months ago

Background

Previously, our testing framework attempted to interact with widgets at their geometric center only. This resulted in tests failing even though some areas of the widget were in fact interactable.

New Approach: Perform multiple hit tests across the entire renderobject in two phases:

  1. Phase: Check predefined likely interaction points, including the center, corners, and edge midpoints of the widget. This phase quickly identifies interactable areas in most standard cases.
  2. Phase: Zigzag Grid Search: If the initial phase does not find any interactable points, the function systematically searches the entire widget area using a zigzag pattern across an 8px by 8px grid.