public TestResult GetScenarioResult(Scenario scenario) { CucumberObjects.Element cucumberScenario = null; CucumberObjects.Feature cucumberFeature = this.GetFeatureElement(scenario.Feature); if (cucumberFeature != null) { cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name); } return(this.GetResultFromScenario(cucumberScenario)); }
private TestResult GetResultFromScenario(CucumberObjects.Element cucumberScenario) { if (cucumberScenario == null) { return(TestResult.Inconclusive); } bool wasSuccessful = CheckScenarioStatus(cucumberScenario); return(wasSuccessful ? TestResult.Passed : TestResult.Failed); }
private static bool CheckScenarioStatus(CucumberObjects.Element cucumberScenario) { return(cucumberScenario.steps.All(x => x.result.status == "passed")); }