public static void AddTestOutcomeToReport(TestContext testContext) { var result = testContext.Result.Outcome.Status; var fullTestName = testContext.Test.FullName; switch (result) { case TestStatus.Failed: CurrentTest.Fail($"{testContext.Result.Message} {testContext.Result.StackTrace}") .AddScreenCaptureFromPath(ScreenshotHelper.ScreenshotFilePath); break; case TestStatus.Inconclusive: break; case TestStatus.Passed: CurrentTest.Pass($"Test Passed: {fullTestName}"); break; case TestStatus.Skipped: CurrentTest.Skip($"Test Skipped: {fullTestName}"); break; default: break; } }
public static void AddErrorLogToReport(Exception e) { CurrentTest.Fail(e); }