Exemplo n.º 1
0
 protected override void PostTestCleanup(object sender, TestExecutionEventArgs e)
 {
     if (_recordingMode != VideoRecordingMode.DoNotRecord)
     {
         try
         {
             bool hasTestPassed = e.TestOutcome.Equals(TestOutcome.Passed);
             DeleteVideoDependingOnTestOutcome(hasTestPassed);
         }
         finally
         {
             _videoRecorder.Dispose();
         }
     }
 }
Exemplo n.º 2
0
 protected override void PostTestCleanup(object sender, TestExecutionEventArgs e)
 {
     try
     {
         var videosFolderPath = ConfigurationManager.AppSettings["videosFolderPath"];
         var testName         = e.TestName;
         var hasTestPassed    = e.TestOutcome.Equals(TestOutcome.Passed);
         SaveVideoDependingOnTestoutcome(videosFolderPath, testName, hasTestPassed);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         throw;
     }
     finally
     {
         _videoRecorder.Dispose();
     }
 }
Exemplo n.º 3
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);
             }
         }
     }
 }
Exemplo n.º 4
0
 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);
             }
         }
     }
 }