@Override public void testStarted(Description description) throws Exception { if (isItSingleScenario(description)) { ScenarioManager.startScenario(); ScenarioManager.currentScenario().withStory(story); } }
private ScenarioModel namedScenario(Description description) { Scenario scenarioAnnotation = description.getAnnotation(Scenario.class); Parameters parametersAnnotation = description.getAnnotation(Parameters.class); String name = null; if (scenarioHasDefinedName(scenarioAnnotation)) name = scenarioAnnotation.value(); else name = createScenarioNameFromTestMethodName(description, parametersAnnotation); if (parametersAnnotation != null && !scenarioAnnotation.pending()) name = name.substring(name.indexOf('(') + 1, name.indexOf(')')) + " (" + description .getMethodName() .substring(0, description.getMethodName().indexOf('(') - 1) + ")"; return ScenarioManager.currentScenario().withName(name).withDescription(description); }