public static void TakeScreenshot() { var now = DateTime.Now; _screenshots.Add(new Screenshot(now)); Taker.TakeScreenshot(Output.GetScreenshotsPath(NunitGoHelper.Configuration.LocalOutputPath), now); }
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); }
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"); } }