public static void Attach()
 {
     if (!WebTestContext.ContainsKey(Constants.TestLogFileKey))
     {
         TestContext.WriteLine($"No test logs generated, test logs will not be attached");
         return;
     }
     if (!File.Exists(WebTestContext.Get <string>(Constants.TestLogFileKey)))
     {
         TestLogs.Write("No test log file exists, no screenshot will be attached.");
         return;
     }
     TestContext.AddTestAttachment(WebTestContext.Get <string>(Constants.TestLogFileKey), "Test Log File");
 }
Exemple #2
0
        public static void Attach()
        {
            if (!WebTestContext.ContainsKey(Constants.ScreenshotFileKey))
            {
                TestLogs.Write("No screenshot file exists, no screenshot will be attached.");
                return;
            }

            string screenShotName = WebTestContext.Get <string>(Constants.ScreenshotFileKey);

            CaptureScreenshot(screenShotName);
            if (!File.Exists(screenShotName))
            {
                TestLogs.Write("No screenshot file exists, no screenshot will be attached.");
                return;
            }
            TestContext.AddTestAttachment(WebTestContext.Get <string>(Constants.ScreenshotFileKey), $"Error screenshot");
        }