Beispiel #1
0
        private IHtmlNode GetScenario(IScenarioResult scenario, int featureIndex, int scenarioIndex)
        {
            var toggleId   = string.Format("toggle{0}_{1}", featureIndex, scenarioIndex);
            var scenarioId = string.Format("scenario{0}_{1}", featureIndex, scenarioIndex + 1);

            return(Html.Tag(Html5Tag.Div).Class("scenario " + GetStatusClass(scenario.Status)).Attribute("data-categories", GetScenarioCategories(scenario)).Content(
                       Html.Checkbox().Id(toggleId).Class("toggle toggleS").Checked(),
                       Html.Tag(Html5Tag.H3).Id(scenarioId).Class("title").Content(
                           Html.Tag(Html5Tag.Label).For(toggleId).Content(
                               GetCheckBoxTag(),
                               GetStatus(scenario.Status),
                               Html.Text(scenario.Info.Name.Format(StepNameDecorator))),
                           Html.Tag(Html5Tag.Span).Content(scenario.Info.Labels.Select(GetLabel)).SkipEmpty(),
                           GetDuration(scenario.ExecutionTime),
                           GetSmallLink(scenarioId)),
                       Html.Tag(Html5Tag.Div).Class("categories").Content(string.Join(", ", scenario.Info.Categories)).SkipEmpty(),
                       Html.Tag(Html5Tag.Div).Content(scenario.GetSteps().Select(GetStep)),
                       GetStatusDetails(scenario.StatusDetails),
                       GetComments(scenario.GetAllSteps()),
                       Html.Br()));
        }
Beispiel #2
0
 /// <summary>
 /// Counts all steps with given status.
 /// </summary>
 public static int CountStepsWithStatus(this IScenarioResult result, ExecutionStatus status)
 {
     return(result.GetAllSteps().Count(s => s.Status == status));
 }