Package io.cucumber.core.plugin
Class TimelineFormatter
java.lang.Object
io.cucumber.core.plugin.TimelineFormatter
- All Implemented Interfaces:
ConcurrentEventListener,Plugin
Writes a timeline of scenario execution.
Note: The report is only written once the test run is finished.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final io.cucumber.query.Queryprivate final Fileprivate final io.cucumber.query.Repositoryprivate final io.cucumber.messages.ndjson.Serializer<Collection> private static final String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappendAsJsonToJs(BufferedWriter out, String pushTo, Collection<?> content) private static voidcopyFile(InputStream source, File dest) private voidprivate TimelineFormatter.TimeLineItemcreateTestData(io.cucumber.messages.types.TestCaseFinished testCaseFinished, io.cucumber.messages.types.TestCaseStarted testCaseStarted, TimelineFormatter.TimeLineGroup timeLineGroup) private TimelineFormatter.TimeLineItemcreateTestData(io.cucumber.messages.types.TestCaseFinished testCaseFinished, io.cucumber.messages.types.TestCaseStarted testCaseStarted, Function<String, TimelineFormatter.TimeLineGroup> timeLineGroupCreator) private StringgetFeatureName(io.cucumber.messages.types.TestCaseStarted testCaseStarted) private StringgetPickleName(io.cucumber.messages.types.TestCaseStarted testCaseStarted) private StringgetTagsValue(io.cucumber.messages.types.TestCaseStarted testCaseStarted) private StringgetTestStepStatusResult(io.cucumber.messages.types.TestCaseFinished event) voidsetEventPublisher(EventPublisher publisher) Set the event publisher.private voidwrite(io.cucumber.messages.types.Envelope event) private voidwriteReportJs(List<TimelineFormatter.TimeLineGroup> timeLineGroups, List<TimelineFormatter.TimeLineItem> timeLineItems) private voidprivate voidwriteTimeLineReport(List<TimelineFormatter.TimeLineGroup> timeLineGroups, List<TimelineFormatter.TimeLineItem> timeLineItems) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.cucumber.plugin.ConcurrentEventListener
setEventPublisher
-
Field Details
-
TEXT_ASSETS
-
repository
private final io.cucumber.query.Repository repository -
query
private final io.cucumber.query.Query query -
reportDir
-
serializer
-
-
Constructor Details
-
TimelineFormatter
- Throws:
FileNotFoundException
-
-
Method Details
-
setEventPublisher
Description copied from interface:ConcurrentEventListenerSet the event publisher. The plugin can register event listeners with the publisher.- Specified by:
setEventPublisherin interfaceConcurrentEventListener- Parameters:
publisher- the event publisher
-
write
private void write(io.cucumber.messages.types.Envelope event) -
writeTimeLineReport
- Throws:
IOException
-
createTestData
private TimelineFormatter.TimeLineItem createTestData(io.cucumber.messages.types.TestCaseFinished testCaseFinished, io.cucumber.messages.types.TestCaseStarted testCaseStarted, Function<String, TimelineFormatter.TimeLineGroup> timeLineGroupCreator) -
createTestData
private TimelineFormatter.TimeLineItem createTestData(io.cucumber.messages.types.TestCaseFinished testCaseFinished, io.cucumber.messages.types.TestCaseStarted testCaseStarted, TimelineFormatter.TimeLineGroup timeLineGroup) -
getTestStepStatusResult
-
getPickleName
-
getFeatureName
-
getTagsValue
-
writeTimeLineReport
private void writeTimeLineReport(List<TimelineFormatter.TimeLineGroup> timeLineGroups, List<TimelineFormatter.TimeLineItem> timeLineItems) throws IOException - Throws:
IOException
-
writeReportJs
private void writeReportJs(List<TimelineFormatter.TimeLineGroup> timeLineGroups, List<TimelineFormatter.TimeLineItem> timeLineItems) throws IOException - Throws:
IOException
-
appendAsJsonToJs
private void appendAsJsonToJs(BufferedWriter out, String pushTo, Collection<?> content) throws IOException - Throws:
IOException
-
copyReportFiles
- Throws:
IOException
-
copyFile
- Throws:
IOException
-