public void RunningATestCreatesLogFileByDefault() { System.Console.WriteLine($"Thread used in test: {Thread.CurrentThread.ManagedThreadId}"); TestLogs.Attach(); Assert.True(File.Exists(WebTestContext.Get <string>(Constants.TestLogFileKey)), "Test Log file not found."); logfile = WebTestContext.Get <string>(Constants.TestLogFileKey); }
public virtual void TestTearDown() { try { if (TestContext.CurrentContext.Result.Outcome != ResultState.Success) { Screenshot.Attach(); } TestLogs.AddSection($"Test {TestContext.CurrentContext.Test.Name} Ends"); TestLogs.Attach(); } catch (Exception e) { throw new Exception($"Teardown failed. Urgent attention required!!! Exception: \n {e}"); } finally { MobileDriver.Dispose(); } }