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

            _screenshots.Add(new Screenshot(now));
            Taker.TakeScreenshot(Output.GetScreenshotsPath(NunitGoHelper.Configuration.LocalOutputPath), now);
        }
Exemplo 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);
        }
Exemplo 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");
     }
 }