public static void CreateReport() { if (_extent == null) { reportFolderName = ConfigurationManager.AppSettings["LOG_FOLDER_NAME"]; currentDate = DateTime.Now.ToString("yyyy-MM-dd"); screenshotsFolder = "Screenshots"; Utilities.CreateFolder(NunitTestHelpers.GetTestDirectoryName() + "\\" + reportFolderName); Utilities.CreateFolder(NunitTestHelpers.GetTestDirectoryName() + "\\" + reportFolderName + "\\" + currentDate); Utilities.CreateFolder(NunitTestHelpers.GetTestDirectoryName() + "\\" + reportFolderName + "\\" + currentDate + "\\" + screenshotsFolder); var htmlReporter = new ExtentHtmlReporter(NunitTestHelpers.GetTestDirectoryName() + "\\" + reportFolderName + "\\" + currentDate + "\\" + fileName); _extent = new ExtentReports(); _extent.AttachReporter(htmlReporter); htmlReporter.Configuration().ChartVisibilityOnOpen = false; } }
public static MediaEntityModelProvider AddScreenShot() { string screenshotPath = TakeScreenshot.TakeScreenShotHelpers.TakeScreenshot(NunitTestHelpers.GetTestDirectoryName() + "\\" + reportFolderName + "\\" + currentDate + "\\" + screenshotsFolder + "\\"); var mediaModel = MediaEntityBuilder.CreateScreenCaptureFromPath(screenshotPath).Build(); return(mediaModel); //_test.Log(GetTestStatus(), SeleniumBase.WebdriverHooks.Driver.Url, mediaModel); }