public void startQuestion(String title) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(title).asAQuestion()); }
private String annotatedStepNameWithParameters(String annotatedStepTemplate) { String annotatedStepName = annotatedStepTemplate; Iterable<String> parameters = getParamatersFrom(description.getName()); int counter = 0; for(String parameter : parameters) { annotatedStepName = annotatedStepName.replaceAll("\\{" + counter++ + "\\}", parameter); } return annotatedStepName; }
/** * We might not have the test class provided (e.g. at the end of a test). */ public static ExecutedStepDescription of(final Class<? extends Object> stepsClass, final String name) { return new ExecutedStepDescription(stepsClass, name); }
public static ExecutedStepDescription of(final Class<? extends Object> stepsClass, final String name, final Object[] arguments) { return new ExecutedStepDescription(stepsClass, name, convertArguments(arguments), NO_FIELDS, false); }
public Method getTestMethod() { if (getStepClass() != null) { return methodCalled(withNoArguments(getName()), getStepClass()); } else { return null; } }
@Override public void beforeStep(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle)); }
public void reportStepFailureFor(Performable todo, Throwable e) { ExecutedStepDescription taskDescription = ExecutedStepDescription.of(todo.getClass(),"attemptsTo"); StepEventBus.getEventBus().stepFailed(new StepFailure(taskDescription, e)); }
private void notifyStepStarted(final Object object, final Method method, final Object[] args) { ExecutedStepDescription description = ExecutedStepDescription.of(testStepClass, getTestNameFrom(method, args), args) .withDisplayedFields(fieldValuesIn(object)); StepEventBus.getEventBus().stepStarted(description); }
private Class<?> getTestClass() { return description.getStepClass(); }
private Method findMethodCalled(final ExecutedStepDescription method, final Class<?> testClass) { return MethodFinder.inClass(testClass).getMethodNamed(withNoArguments(method.getName()), method.getArguments().size()); }
public void stepStarted(ExecutedStepDescription description) { if (loggingLevelIsAtLeast(LoggingLevel.VERBOSE)) { getLogger().info("STARTING STEP {}", description.getTitle()); } }
public void reportNewStepWithTitle(String title) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(title)); }
public Method getTestMethod() { if (getStepClass() != null) { return methodCalled(withNoArguments(getName()), getStepClass()); } else { return null; } }
public void reportStepFailureFor(Performable todo, Throwable e) { ExecutedStepDescription taskDescription = ExecutedStepDescription.of(todo.getClass(),"attemptsTo"); StepEventBus.getEventBus().stepFailed(new StepFailure(taskDescription, e)); }
private void notifySkippedStepStarted(final Object object, final Method method, final Object[] args) { ExecutedStepDescription description = ExecutedStepDescription.of(testStepClass, getTestNameFrom(method, args), args) .withDisplayedFields(fieldValuesIn(object)); StepEventBus.getEventBus().skippedStepStarted(description); }
private boolean noClassIsDefined() { return description.getStepClass() == null; }
public void stepStarted(ExecutedStepDescription description) { if (loggingLevelIsAtLeast(getLoggingLevel().VERBOSE)) { getLogger().info("STARTING STEP " + description.getTitle()); } }
public void beforeStep(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle)); }
private String annotatedStepNameWithParameters(String annotatedStepTemplate) { String annotatedStepName = annotatedStepTemplate; Iterable<String> parameters = getParamatersFrom(description.getName()); int counter = 0; for(String parameter : parameters) { annotatedStepName = annotatedStepName.replaceAll("\\{" + counter++ + "\\}", parameter); } return annotatedStepName; }
public Method getStepMethod() { if (getStepClass() != null) { if (ScreenplayInspector.isAScreenplayClass(getStepClass())) { return ScreenplayInspector.performAsMethodIn(getStepClass()); } else { return methodCalled(withNoArguments(getName()), getStepClass()); } } else { return null; } }