Skip to content

Only report the closest match which didn't fit #39

@DaniRey

Description

@DaniRey

In case we have the following HtmlElement

<select>
 <option value="foo">foo</option>
 <option value="bar1">bar</option>
</select>

and the following Gauge definition

elem fits(<option value="bar">bar</option>)

It would currently report
Misfitting Attribute: [value] in [HtmlOption[<option value="foo">]] with value[bar] didn't equal [bar]
Misfitting Attribute: [value] in [HtmlOption[<option value="bar1">]] with value[bar1] didn't equal [bar]

A human would immediately see, that the second element is what we where looking for, because the text is correct, but only the value attribute is off. While with the first candidate, both text and value are off.

If we would try every attribute instead of reporting a misfit, as soon as an attribute of the gauge definition doesn't fit, we could provide better Misfit reports.

In case we find a solution for this, we have to make sure it doesn't hurt performance too much. Maybe one could only execute the deeper analysis of misfits, in case the gauge doesn't fit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions