/********* Reporting ***********/ public void ReportTest(String browserName) { string reportPath = ReadExcel.GetCurrentPath() + "Reports\\TestRunReport.html"; htmlReporter = new ExtentHtmlReporter(reportPath); GetInstance(); extent.AttachReporter(htmlReporter); htmlReporter.Config.Theme = Theme.Dark; htmlReporter.Config.DocumentTitle = "Vodafone POC - Test Report"; htmlReporter.Config.ReportName = "Vodafone POC - Test Report"; extent.AddSystemInfo("System Under Test", "Vodafone Website"); extent.AddSystemInfo("Environment", "Windows 10 - " + browserName); extent.AddSystemInfo("Owner", "Integrant inc - Mahmoud Yasser"); test = extent.CreateTest("Test searching and sorting", "This test contains 3 test cases 1)Launching Vodafone website and assert its URL " + " 2)Navigate to Eshop page and search for a query(Data Driven) then assert that items count" + " 3)Sort items by price and assert the sorting"); }
/********* Take screenshot *****/ public void TakeScreenShout(string screenShotName, string browserName) { Screenshot image = ((ITakesScreenshot)driver).GetScreenshot(); image.SaveAsFile(ReadExcel.GetCurrentPath() + "\\Screen Shots\\" + browserName + "\\" + screenShotName + ".png"); }