@Override public boolean isBaseStepListenerRegistered() { return super.isBaseStepListenerRegistered(); }
@Override public void disposeWorld() { if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) { LOGGER.warn("It looks like you are running a feature using @RunWith(Cucumber.class) instead of @RunWith(CucumberWithSerenity.class). Are you sure this is what you meant to do?"); } }
@Override public void disposeWorld() { if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) { LOGGER.warn("It looks like you are running a feature using @RunWith(Cucumber.class) instead of @RunWith(CucumberWithSerenity.class). Are you sure this is what you meant to do?"); } }
private Optional<TestOutcome> latestTestOutcome() { if (!getStepEventBus(currentFeaturePath()).isBaseStepListenerRegistered()) { return Optional.empty(); } List<TestOutcome> recordedOutcomes = getStepEventBus(currentFeaturePath()).getBaseStepListener().getTestOutcomes(); return (recordedOutcomes.isEmpty()) ? Optional.empty() : Optional.of(recordedOutcomes.get(recordedOutcomes.size() - 1)); }
private Optional<TestOutcome> latestTestOutcome() { if (!getStepEventBus(currentFeaturePath()).isBaseStepListenerRegistered()) { return Optional.empty(); } List<TestOutcome> recordedOutcomes = getStepEventBus(currentFeaturePath()).getBaseStepListener().getTestOutcomes(); return (recordedOutcomes.isEmpty()) ? Optional.empty() : Optional.of(recordedOutcomes.get(recordedOutcomes.size() - 1)); }
private Optional<TakeScreenshots> classOverride() { if (StepEventBus.getEventBus().isBaseStepListenerRegistered()) { Optional<Method> currentStepMethod = StepEventBus.getEventBus().getBaseStepListener().getCurrentStepMethod(); if (currentStepMethod != null && currentStepMethod.isPresent()) { return overriddenScreenshotPreferenceForClass(currentStepMethod.get().getDeclaringClass()); } } return Optional.empty(); }
private void initialiseThucydidesListenersFor(String featurePath) { if (getStepEventBus(featurePath).isBaseStepListenerRegistered()) { return; } SerenityListeners listeners = new SerenityListeners(getStepEventBus(featurePath), systemConfiguration); baseStepListeners.add(listeners.getBaseStepListener()); }
private void initialiseThucydidesListenersFor(String featurePath) { if (getStepEventBus(featurePath).isBaseStepListenerRegistered()) { return; } SerenityListeners listeners = new SerenityListeners(getStepEventBus(featurePath), systemConfiguration); baseStepListeners.add(listeners.getBaseStepListener()); }
public static void castActor(String name) { if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) { return; } StepEventBus.getEventBus().castActor(name); }
public void assignFactToActor(Actor actor, String fact) { if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) { return; } StepEventBus.getEventBus().getBaseStepListener().latestTestOutcome().ifPresent( testOutcome -> testOutcome.assignFact(actor.getName(), fact) ); }
public void assignAbilityToActor(Actor actor, String ability) { if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) { return; } if (StepEventBus.getEventBus().getBaseStepListener().latestTestOutcome() == null) { return; } StepEventBus.getEventBus().getBaseStepListener().latestTestOutcome().ifPresent( testOutcome -> testOutcome.assignAbility(actor.getName(), ability) ); }