Multi area needles: support needle-checks relative to previous matches
openQA already supports needles with more then one area to check. These needles can be used for e.g. assert_and_click while openQA will click in the last area created for the needle (from the docs: "[…] Then click $button in the middle of the last match region as defined in the needle JSON file.").
Right now the areas in the needle get matched independent of each other. It can happen that one area of the needle matches multiple places on a screenshot. If this smaller area gets (indirectly) used for an assert_and_click this can result in a click on the wrong UI element even though the bigger, second area of the needle matches the right region in the screenshot.
Implement some mechanism/flag to make sure the second needle matches inside the first one
#3 Updated by nicksinger over 2 years ago
Most of the time you could say it is only relevant for clicks.
But I also see the use-case for "normal" needles. Take our check for the root-console as example ("cleared-console-root-20170404" e.g. https://openqa.suse.de/tests/1483793#step/consoletest_setup/38). I've seen fails of this where the two parts of the needle get matched completely independent of each other. Check-boxes are also a pretty good example where you've multiple of them on the screen but only want to check (as in "needle-check") a specific one but you cannot cover it as one big region.
#5 Updated by nicksinger over 2 years ago
No, this is the reason I created this feature request. To reduce the "art" needed in some cases. Especially in cases where the greatest "art" can not help - e.g. (again): https://openqa.suse.de/tests/1483793#step/consoletest_setup/38
Also the editor could stay like it already is with the addition of a simple checkbox: "Match areas relative to each other" or "Keep distances between match areas".
#8 Updated by StefanBruens 6 months ago
- Status changed from New to Feedback
- Assignee set to nicksinger
I think the use case is completely covered by the click coordinates which can now be used.
Maybe we should check old needles for small areas completely contained in larger areas, and then migrate these to click points.