Esempio n. 1
0
        public static void TakeScreenshot()
        {
            var now = DateTime.Now;

            _screenshots.Add(new Screenshot(now));
            Taker.TakeScreenshot(Output.GetScreenshotsPath(NunitGoHelper.Configuration.LocalOutputPath), now);
        }
Esempio n. 2
0
        public static ITestRun TakeScreenshot(this ITestRun testRun, string testPath, bool takeScreenshotAfterFail)
        {
            if (!takeScreenshotAfterFail || !testRun.FailedOrBroken)
            {
                return(testRun);
            }
            var date = DateTime.Now;
            var s    = new TestScreenshot(date);

            Taker.TakeScreenshot(Path.Combine(testPath, "img"), date);
            testRun.Screenshots.Add(s);
            return(testRun);
        }
Esempio n. 3
0
 private void TakeScreenshotIfFailed()
 {
     try
     {
         if (!_nunitGoTest.IsSuccess() && _configuration.TakeScreenshotAfterTestFailed)
         {
             var now = DateTime.Now;
             _nunitGoTest.Screenshots.Add(new Screenshot(now));
             Taker.TakeScreenshot(_screenshotsPath, now);
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex, "Exception in TakeScreenshot");
     }
 }