recordOverriddenMessage function
The sentence a record run owes scenario, or null when nothing is wrong.
The one losing combination in the ladder worth interrupting for, because it
is the only one where nothing on the screen and nothing in the output says
what happened: the suite passes, every picture is the one replay already
had, and the store the run was for stays exactly as it was. Every other
pairing shows itself — a scenario keeping off against a live run draws
the blank image and reports the refusal on the step.
A scenario that said replay is not one of them: a record run records it
— see _reachOf. What is left is off and live, and a message rather
than the same exception, because both are a scenario deliberately saying
it wants no recording: one keeps the network shut, the other wants today's.
Implementation
@visibleForTesting
String? recordOverriddenMessage(
String scenario,
ScenarioNetwork? own,
ScenarioNetwork? run,
) {
if (run != ScenarioNetwork.record) return null;
if (own == null ||
own == ScenarioNetwork.replay ||
own == ScenarioNetwork.record) {
return null;
}
return '"$scenario" sets `network: ${own.name}`, so this `record` run '
'skipped it and recorded nothing for it. The nearest setting wins: a '
'`scenario(network: ...)` overrides the run, and a run only overrides '
'the folder and the project. To record it, move the setting to the '
'folder with `runScenarios(network: ...)` in `flutter_test_config.dart`, '
'where `--network=` can override it.';
}