예제 #1
0
        public void TestCleanup()
        {
            var status     = TestContext.CurrentContext.Result.Outcome.Status;
            var stacktrace = string.IsNullOrEmpty(TestContext.CurrentContext.Result.StackTrace) ? ""
                : string.Format("{0}", TestContext.CurrentContext.Result.StackTrace);
            Status logstatus;

            switch (status)
            {
            case TestStatus.Failed:
                logstatus = Status.Fail;
                break;

            case TestStatus.Inconclusive:
                logstatus = Status.Warning;
                break;

            case TestStatus.Skipped:
                logstatus = Status.Skip;
                break;

            default:
                logstatus = Status.Pass;
                break;
            }
            test.Log(logstatus, "Test ended with " + logstatus + stacktrace);
            extent.Flush();
            test.Log(logstatus, "Flush() method of ExtentReports wil push/write everything to the document");
            hc.CloseDriver();
        }
예제 #2
0
 public void TestCleanup()
 {
     hc.CloseDriver();
 }