readState method
Reads a data-context path without asserting.
Implementation
dynamic readState(String path) {
final scope = _activeScope();
if (scope == null) {
throw EnsembleTestFailure(
'readState requires an active Ensemble screen (no ScopeManager found).',
);
}
if (path.contains(r'${') || path.contains(r'$(')) {
return scope.dataContext.eval(path);
}
return scope.dataContext.eval('\${$path}');
}