runTests method
Implementation
Future<bool> runTests(String fileName, bool record,
[String outputPath = '/']) async {
var res = false;
print('Will record video? $record');
if (record) {
var recordingProcess = await Process.start('xcrun', [
'simctl',
'io',
_id,
'recordVideo',
p.join(outputPath, '${fileName.split("/").last.split(".").first}.mp4')
]);
print('Executing flutter test');
try {
await runAsync('flutter', ['test', '-d', _id, '--pub', fileName]);
recordingProcess.kill(ProcessSignal.sigint);
return true;
} on RuntimeException catch (e) {
recordingProcess.kill(ProcessSignal.sigint);
return false;
}
}
print('Running flutter test');
try {
await runAsync('flutter', ['test', '-d', _id, '--pub', fileName]);
return true;
} on RuntimeException catch (e) {
return false;
}
}