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"); }
private void AfterInvocation(IInvocation invocation) { string logcontent = $"---------Script Call Successful =>[{invocation.Method.DeclaringType}.{invocation.Method.Name}] "; TestLogs.Write(logcontent + "---------"); }