Exemple #1
0
 protected override void PostAfterScenario(object sender, TestWorkflowPluginEventArgs e)
 {
     if (VideoWorkflowPluginContext.RecordingMode != VideoRecordingMode.DoNotRecord)
     {
         try
         {
             bool hasTestPassed = e.TestOutcome.Equals(TestOutcome.Passed);
             DeleteVideoDependingOnTestOutcome(hasTestPassed);
         }
         finally
         {
             _videoRecorder.Dispose();
             if (File.Exists(_videoRecordingPath))
             {
                 _videoPluginProvider.VideoGenerated(e, _videoRecordingPath);
             }
         }
     }
 }
 protected override void PostTestCleanup(object sender, TestWorkflowPluginEventArgs e)
 {
     if (_recordingMode != VideoRecordingMode.DoNotRecord)
     {
         bool hasTestPassed = e.TestOutcome.Equals(TestOutcome.Passed);
         bool isFileDeleted = false;
         try
         {
             string videoRecordingPath = e.Container.Resolve <string>("_videoRecordingPath");
             isFileDeleted = DeleteVideoDependingOnTestOutcome(hasTestPassed, videoRecordingPath);
         }
         finally
         {
             _videoRecorder = e.Container.Resolve <IVideoRecorder>("_videoRecorder");
             _videoRecorder?.Dispose();
             if (!isFileDeleted)
             {
                 string videoRecordingPath = e.Container.Resolve <string>("_videoRecordingPath");
                 _videoPluginProvider.VideoGenerated(e, videoRecordingPath);
             }
         }
     }
 }