public void AfterTest(ITest test)
 {
     if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed)
     {
         var now = DateTime.Now;
         ScreenshotSaver.Save(BrowserSetUp.browser.GetScreenshot().AsByteArray, TestContext.CurrentContext.Test.FullName, now);
     }
 }
 public void AfterTest(ITest test)
 {
     if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed)
     {
         var now = DateTime.Now;
         ScreenshotSaver.Save(Convert.FromBase64String(BrowserSetUp.browser.GetScreenshot()), TestContext.CurrentContext.Test.FullName, now);
     }
 }
Beispiel #3
0
        public void SaveScreenshot(string testName)
        {
            var screenshotBytesInBase64 = GetScreenshot();

            if (screenshotBytesInBase64 == null)
            {
                throw new Exception("Can't take screenshot");
            }
            ScreenshotSaver.Save(Convert.FromBase64String(screenshotBytesInBase64), testName, DateTime.Now);
        }
Beispiel #4
0
        public void SaveScreenshot(string testName)
        {
            var screenshot = GetScreenshot();

            if (screenshot == null)
            {
                throw new Exception("Can't take screenshot");
            }
            ScreenshotSaver.Save(screenshot.AsByteArray, testName, DateTime.Now);
        }
Beispiel #5
0
 public void AfterTest(ITest test)
 {
     if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed)
     {
         var now     = DateTime.Now;
         var context = TestContext.CurrentContext;
         ScreenshotSaver.Save(
             BrowserSetUp.browser.GetScreenshot().AsByteArray,
             string.Join(".", context.Test.ClassName, context.Test.Name),
             now);
     }
 }