/// <summary> /// This methos is used to generate report based on the user options in the resources file /// </summary> public void CreateReport() { //Get the log object and verify if the user wants to write a text report or HTML reprot and call the appropriate method. List <String> log = GlobalTestController.GetLog(); if (TestConfigurationBuilder.frameworkConfiguration.HtmlReport) { CreateHTMLReport(log); } else if (TestConfigurationBuilder.frameworkConfiguration.TextReport) { CreateTextReport(log); } }
public void Teardown() { // lock (this) { String testName = TestContext.CurrentContext.Test.Name; String message = TestContext.CurrentContext.Result.Message; String result = TestContext.CurrentContext.Result.Outcome.Status.ToString(); DateTime endTime = DateTime.Now; TestControl tc = GlobalTestController.GetTestControl(testName); IWebDriver driver = tc.Driver; DateTime startTime = tc.TestStartTime; TimeSpan testDuration = endTime.Subtract(startTime).Duration(); String screenShotFilePath = ""; if (result.Contains("Fail")) { tc.CaptureScreenShot(tc); screenShotFilePath = tc.ScreenShotFileName; } GlobalTestController.AddLog(testName + "\t;" + message + "\t\t\t\t;" + result + "\t\t\t;" + startTime + "\t\t\t;" + endTime + ";" + testDuration + ";" + screenShotFilePath); tc.TearDown(); GlobalTestController.RemoveTestControl(tc, testName); } }
/// <summary> /// This method is used to instantiate all the test resources for the test /// </summary> /// <returns TestControl></returns> public TestControl GetTestResources(String browser) { InitializeResources(browser, null); GlobalTestController.AddTestControl(this); return(this); }
/// <summary> /// This method is used to instantiate all the test resources for the test /// </summary> /// <returns TestControl></returns> public TestControl GetTestResources() { InitializeResources(TestConfigurationBuilder.frameworkConfiguration.Browser, null); GlobalTestController.AddTestControl(this); return(this); }
/// <summary> /// This method is used to instantiate all the test resources for the test /// </summary> /// <param name="testDataObject"></param> /// <returns TestControl></returns> public TestControl GetTestResources(Dictionary <String, String> testDataObject) { InitializeResources(TestConfigurationBuilder.frameworkConfiguration.Browser, testDataObject); GlobalTestController.AddTestControl(this); return(this); }
/// <summary> /// This method is used to instantiate all the test resources for the specified browser. /// </summary> /// <param name="testDataObject"></param> /// <param name="browser"></param> /// <returns></returns> public TestControl GetTestResources(Dictionary <String, String> testDataObject, string browser) { InitializeResources(browser, testDataObject); GlobalTestController.AddTestControl(this); return(this); }
public DriverHelper GetTestResources(String browser) { ResourceInit(browser, null); GlobalTestController.AddTestControl(this); return(this); }