public static void AddLogStep(string text) { if (frameworkType == "SpecflowTests") { var StepType = ScenarioHelpers.GetStepType(); string description = ScenarioHelpers.GetStepsDescription(); string status = ScenarioHelpers.GetScenarioStatus().ToString(); switch (StepType) { case TechTalk.SpecFlow.Bindings.StepDefinitionType.Given: _test.CreateNode <Given>(description).Pass(status + "<pre> Valor informado: [" + text + "]</pre>"); break; case TechTalk.SpecFlow.Bindings.StepDefinitionType.When: _test.CreateNode <When>(description).Pass(status + "<pre> Valor informado: [" + text + "]</pre>"); break; case TechTalk.SpecFlow.Bindings.StepDefinitionType.Then: _test.CreateNode <Then>(description).Pass(status + "<pre> Valor informado: [" + text + "]</pre>"); break; default: _test.CreateNode <And>(description).Pass(status + "<pre> Valor informado: [" + text + "]</pre>"); break; } } else if ((frameworkType == "NunitTests")) { var StepType = SeleniumTestHelper.GetClassNameTest(30); string description = SeleniumTestHelper.GetTestDescription(); string nase = SeleniumTestHelper.GetTestCaseName(); TestStatus status = SeleniumTestHelper.GetTestStatus(); Status logstatus; switch (status) { case TestStatus.Failed: logstatus = Status.Fail; break; case TestStatus.Inconclusive: logstatus = Status.Warning; break; case TestStatus.Skipped: logstatus = Status.Skip; break; default: logstatus = Status.Pass; break; } _test.Log(logstatus, "<pre> Valor informado: [" + text + "]</pre>"); } }
public static string GetPathTakeScreenShot() { String currentDateTime = DateHelper.GetDateTimeNow().Replace("/", "-").Replace(":", "-"); fileName = SeleniumTestHelper.GetTestDirectoryName() + @"\Screenshot " + currentDateTime + ".Png"; return(fileName); }