Project

General

Profile

Actions

action #31198

closed

Multi area needles: support needle-checks relative to previous matches

Added by nicksinger almost 7 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
-
Start date:
2018-02-01
Due date:
% Done:

0%

Estimated time:

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

Actions #1

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?

Actions #2

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?

Actions #3

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.

Actions #4

Updated by coolo almost 7 years ago

this would make designing needles even more of an art - left aside designing an editor for that

Actions #5

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".

Actions #6

Updated by okurz over 5 years ago

  • Category set to Feature requests
Actions #7

Updated by okurz over 4 years ago

  • Priority changed from Normal to Low
Actions #8

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.

Actions #9

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.

Actions

Also available in: Atom PDF