Quite by co-incidence, yesterday I got told about two unrelated bugs, but in both cases, the symptom was that a particular bit of user-interface was appearing twice. In one case it was an unfortunate renderer override which had not been updated when Moodle core changed, and in the other case it was just a bug in the logic in a for loop.
Anyway, having slept on it, I now realise that it would not be easy to make a Behat test that caught these bugs. Steps like
Then "Try another question like this one" "button" should be visible
Will pass providing at least one such button exists. It is quite happy if there are two or more. (And, often that is what you want.)
Does anyone have a good trick for testing this?
We could certainly make a new step
Then exactly 1 "Try another question like this one" "button" should be visible
but is that necessary?