public void beginExecution() { var currentDateTime = DateTime.Now.ToString("dd-MM-yyyy-(hh-mm-ss)"); var pathToLog = Path.Combine(TestContext.CurrentContext.WorkDirectory, $"{folderName}", $"{currentDateTime}", "InfoLog.txt"); string pathToDetailedLog = Path.Combine(TestContext.CurrentContext.WorkDirectory, $"{folderName}", $"{currentDateTime}", "DetailedLog.txt"); var template = "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"; Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.Console(outputTemplate: template) .WriteTo.File(pathToLog, Serilog.Events.LogEventLevel.Information, outputTemplate: template) .WriteTo.File(pathToDetailedLog, Serilog.Events.LogEventLevel.Debug, outputTemplate: template) .CreateLogger(); Log.Information("One Time Setup finished"); Log.Information("Configuration finished"); DriverProvider.Init(); Base_Page.thread.Value = DriverProvider.getDriver; PageLogin login = PageLogin.Instance; login.Open(); login.loginUser(); }
public void finishExecution() { Log.Information("One Time Tear Down"); DriverProvider.Close(); }