use of io.cucumber.messages.types.ParameterType in project cucumber-jvm by cucumber.
the class HtmlFormatterTest method ignores_step_definitions.
@Test
void ignores_step_definitions() throws Throwable {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
HtmlFormatter formatter = new HtmlFormatter(bytes);
EventBus bus = new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID);
formatter.setEventPublisher(bus);
TestRunStarted testRunStarted = new TestRunStarted();
testRunStarted.setTimestamp(new Timestamp(10L, 0L));
Envelope testRunStartedEnvelope = new Envelope();
testRunStartedEnvelope.setTestRunStarted(testRunStarted);
bus.send(testRunStartedEnvelope);
StepDefinition stepDefinition = new StepDefinition();
Envelope stepDefinitionEnvelope = new Envelope();
stepDefinitionEnvelope.setStepDefinition(stepDefinition);
bus.send(stepDefinitionEnvelope);
Hook hook = new Hook();
Envelope hookEnvelope = new Envelope();
hookEnvelope.setHook(hook);
bus.send(hookEnvelope);
ParameterType parameterType = new ParameterType();
Envelope parameterTypeEnvelope = new Envelope();
parameterTypeEnvelope.setParameterType(parameterType);
bus.send(parameterTypeEnvelope);
TestRunFinished testRunFinished = new TestRunFinished();
testRunFinished.setTimestamp(new Timestamp(15L, 0L));
Envelope testRunFinishedEnvelope = new Envelope();
testRunFinishedEnvelope.setTestRunFinished(testRunFinished);
bus.send(testRunFinishedEnvelope);
String html = new String(bytes.toByteArray(), UTF_8);
assertThat(html, containsString("" + "window.CUCUMBER_MESSAGES = [" + "{\"testRunStarted\":{\"timestamp\":{\"seconds\":10,\"nanos\":0}}}," + "{\"testRunFinished\":{\"timestamp\":{\"seconds\":15,\"nanos\":0}}}" + "];\n"));
}
Aggregations