Class PrettyFormatter

java.lang.Object
io.cucumber.core.plugin.PrettyFormatter
All Implemented Interfaces:
ColorAware, ConcurrentEventListener, Plugin

public final class PrettyFormatter extends Object implements ConcurrentEventListener, ColorAware
Prints a pretty report of the scenario execution as it happens.

When scenarios are executed concurrently the output will interleave. This is to be expected.

  • Field Details

    • out

      private final OutputStream out
    • writer

      private io.cucumber.prettyformatter.MessagesToPrettyWriter writer
  • Constructor Details

    • PrettyFormatter

      public PrettyFormatter(OutputStream out)
  • Method Details

    • createBuilder

      private static io.cucumber.prettyformatter.MessagesToPrettyWriter.Builder createBuilder()
    • setEventPublisher

      public void setEventPublisher(EventPublisher publisher)
      Description copied from interface: ConcurrentEventListener
      Set the event publisher. The plugin can register event listeners with the publisher.
      Specified by:
      setEventPublisher in interface ConcurrentEventListener
      Parameters:
      publisher - the event publisher
    • write

      private void write(io.cucumber.messages.types.Envelope event)
    • setMonochrome

      public void setMonochrome(boolean monochrome)
      Description copied from interface: ColorAware
      When set to monochrome the plugin should not use colored output.

      For the benefit of systems that do not support ANSI escape codes.

      Specified by:
      setMonochrome in interface ColorAware
      Parameters:
      monochrome - true if monochrome output should be used