Are Scenario names in a single file (feature) expected to be unique?

Hi.

Recently I’ve stumbled upon a problem where a test running a test file with two Scenarios with the same name was succeeding (exit code 0), even though the first scenario failed. The logged output was correct (one failure, one success).

After some investigation it became clear that the status of second Scenario (success) was overwriting the status of the first one (failure) and hence the exit code was 0.

Hence my question: are the names of Scenarios in a single file expected to be unique?
If so, should a warning be logged or the entire feature fail if that expectation isn’t met?

You can add uniqueScreenshotNames: true, in the codecept.conf to avoid overwriting the screenshots files