action #31198
closedMulti area needles: support needle-checks relative to previous matches
0%
Description
Summary¶
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.").
Problem¶
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.
Suggested solution¶
Implement some mechanism/flag to make sure the second needle matches inside the first one
Updated by StefanBruens almost 7 years ago
So the click area is just a region fully contained in one of the other areas?
Wouldn't it be better to just allow an offset in this case?
Updated by coolo almost 7 years ago
that's a bit hard to support as is in the needle editor. But what this 2nd needle actually is, is a different type of area - it shouldn't be matched at all, but only used for clicking, no?
Updated by nicksinger almost 7 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.
Updated by coolo almost 7 years ago
this would make designing needles even more of an art - left aside designing an editor for that
Updated by nicksinger almost 7 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".
Updated by StefanBruens over 4 years 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.
Updated by okurz over 4 years ago
- Status changed from Feedback to Resolved
great to hear that. I think old needles will be eventually faded out, deleted, and recreated with click areas anyway when there is a mismatch.