Example #1
0
        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;
            }
        }
Example #2
0
 public static void AddErrorLogToReport(Exception e)
 {
     CurrentTest.Fail(e);
 }