private bool DeleteVideoDependingOnTestOutcome(bool haveTestPassed, string videoRecordingPath) { bool isFileDeleted = false; if (_isEnabled) { // Release the video file then delete it. _videoRecorder?.Stop(); if (haveTestPassed && File.Exists(videoRecordingPath)) { File.Delete(videoRecordingPath); isFileDeleted = true; } } return(isFileDeleted); }
private void DeleteVideoDependingOnTestOutcome(bool haveTestPassed) { if (_recordingMode != VideoRecordingMode.DoNotRecord) { bool shouldRecordAlways = _recordingMode == VideoRecordingMode.Always; bool shouldRecordAllPassedTests = haveTestPassed && _recordingMode.Equals(VideoRecordingMode.OnlyPass); bool shouldRecordAllFailedTests = !haveTestPassed && _recordingMode.Equals(VideoRecordingMode.OnlyFail); if (!(shouldRecordAlways || shouldRecordAllPassedTests || shouldRecordAllFailedTests)) { // Release the video file then delete it. _videoRecorder.Stop(); if (File.Exists(_videoRecordingPath)) { File.Delete(_videoRecordingPath); } } } }
private bool DeleteVideoDependingOnTestOutcome(bool haveTestPassed) { bool isFileDeleted = false; if (VideoWorkflowPluginContext.RecordingMode != VideoRecordingMode.DoNotRecord) { bool shouldRecordAlways = VideoWorkflowPluginContext.RecordingMode == VideoRecordingMode.Always; bool shouldRecordAllPassedTests = haveTestPassed && VideoWorkflowPluginContext.RecordingMode.Equals(VideoRecordingMode.OnlyPass); bool shouldRecordAllFailedTests = !haveTestPassed && VideoWorkflowPluginContext.RecordingMode.Equals(VideoRecordingMode.OnlyFail); if (!(shouldRecordAlways || shouldRecordAllPassedTests || shouldRecordAllFailedTests)) { // Release the video file then delete it. _videoRecorder.Stop(); if (File.Exists(_videoRecordingPath)) { File.Delete(_videoRecordingPath); isFileDeleted = true; } } } return(isFileDeleted); }
/// <summary> /// Остановить процесс записи видео /// </summary> public void StopRecord() { _videoRecorder.Stop(); }