Skip to content

← All questions

Healing picked the wrong one of three matching elements and the test still passed

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Product grid, several cards, each with an "Add" button. The context on our add-to-basket locator is:

ts
{ role: 'button', name: 'Add', text: 'Add', description: 'add to basket' }

The primary broke after a class rename. The healer found three matching buttons, scored the candidate above minScore anyway, took the first one and added the wrong product. The scenario passed, because the assertion afterwards only checks the basket count.

The event records count: 3, so the healer knew. I understand that uniqueness lowers the score rather than disqualifying the candidate, and that it resolves to the first match. What I would like to know is whether there is a supported way to say "refuse to heal when more than one thing matches", short of raising minScore far enough that non-unique candidates fall below it — which also takes out plenty of heals I do want.

No answers yet

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related