public static void BeforeTestRun() { CleanUpAllDriver(); BaseDriver.StartBrowser(BrowserType.Chrome); // Create the folder report DateTime now = DateTime.Now; var dirReport = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Report " + now.ToString("ddd dd-MMM-yyyy HH-mm-ss/"); var htmlReporter = new ExtentHtmlReporter(dirReport); htmlReporter.LoadConfig(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\extent-config.xml"); // Klov*************** BaseValues.KlovReport.InitMongoDbConnection("127.0.0.1", 27017); // URL of the KLOV server BaseValues.KlovReport.InitKlovServerConnection("http://127.0.0.1:5689"); BaseValues.KlovReport.ProjectName = "Extent Report - Klov"; BaseValues.KlovReport.ReportName = "Test results " + DateTime.Now.ToString(); try { BaseValues.ExtentReports.AttachReporter(BaseValues.KlovReport, htmlReporter); } catch (TimeoutException) { throw new TimeoutException("Please check the connection to Mongo DB server. A timeout occured after 30s selecting a server using CompositeServerSelector"); } }
protected TestFixture() { CleanUpAllDriver(); BaseDriver.StartBrowser(BrowserType.Chrome); // Create the folder report DateTime now = DateTime.Now; var dirReport = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Report " + now.ToString("ddd dd-MMM-yyyy HH-mm-ss/"); var htmlReporter = new ExtentHtmlReporter(dirReport); htmlReporter.LoadConfig(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\extent-config.xml"); // Klov*************** BaseValues.KlovReport.InitMongoDbConnection("localhost", 27017); // URL of the KLOV server BaseValues.KlovReport.InitKlovServerConnection("http://localhost:5689"); BaseValues.KlovReport.ProjectName = "Extent Report - Klov"; BaseValues.KlovReport.ReportName = "Test results " + DateTime.Now.ToString(); BaseValues.ExtentReports.AttachReporter(BaseValues.KlovReport, htmlReporter); }