/** * Constructs an new event with specified name * * @param name initial name value */ public StepStartedEvent(String name) { setName(name); }
/** * Sets title using fluent-api * * @param title value to set * @return modified instance */ public StepStartedEvent withTitle(String title) { setTitle(title); return this; } }
@Override public void match(Match match) { if (match instanceof StepDefinitionMatch) { this.match = (StepDefinitionMatch) match; Step step = extractStep(this.match); synchronized (gherkinSteps) { while (gherkinSteps.peek() != null && !isEqualSteps(step, gherkinSteps.peek())) { fireCanceledStep(gherkinSteps.remove()); } if (isEqualSteps(step, gherkinSteps.peek())) { gherkinSteps.remove(); } } String name = this.getStepName(step); ALLURE_LIFECYCLE.fire(new StepStartedEvent(name).withTitle(name)); createDataTableAttachment(step.getRows()); } }
@Override public void step(String s, Object... args) { try { LIFECYCLE.fire(new StepStartedEvent(format(s, args).replace(".", ","))); super.step(s, args); LIFECYCLE.fire(new StepFinishedEvent()); } catch (Exception ex) { throw exception("Log Step with Allure issue: " + ex.getMessage()); } } }
@Before("anyMethod() && withStepAnnotation()") public void stepStart(JoinPoint joinPoint) { String stepTitle = createTitle(joinPoint); MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); StepStartedEvent startedEvent = new StepStartedEvent( getName(methodSignature.getName(), joinPoint.getArgs()) ); if (!stepTitle.isEmpty()) { startedEvent.setTitle(stepTitle); } ALLURE.fire(startedEvent); }
public void fire(StepStartedEvent event) { Step step = new Step(); event.process(step); stepStorage.put(step); }
private void fireCanceledStep(Step unimplementedStep) { String name = getStepName(unimplementedStep); ALLURE_LIFECYCLE.fire(new StepStartedEvent(name).withTitle(name)); ALLURE_LIFECYCLE.fire(new StepCanceledEvent()); ALLURE_LIFECYCLE.fire(new StepFinishedEvent()); //not to change FAILED status to CANCELED in the report ALLURE_LIFECYCLE.fire(new TestCasePendingEvent() { @Override protected String getMessage() { return "Unimplemented steps were found"; } }); currentStatus = SKIPPED; }
initialized = true; setLogAction(s -> { LIFECYCLE.fire(new StepStartedEvent(s)); logger.step(s); LIFECYCLE.fire(new StepFinishedEvent());
/** * Process StepStartedEvent. New step will be created and added to * stepStorage. * * @param event to process */ public void fire(StepStartedEvent event) { Step step = new Step(); event.process(step); stepStorage.put(step); notifier.fire(event); }
initialized = true; setLogAction(s -> { LIFECYCLE.fire(new StepStartedEvent(s)); logger.step(s); LIFECYCLE.fire(new StepFinishedEvent());
public StepStartedEvent(String name) { setName(name); }