Skip to content

Item tree reporter

Ivan edited this page Dec 1, 2019 · 6 revisions

Item tree reporter

ItemTreeReporter is required for sending requests to the Report Portal instance right from the test context using TestItemTree(wiki) content.

Method for new TestItem under the provided TestItemLeaf's parent creation:

    public static Maybe<String> startItem(ReportPortalClient reportPortalClient, final StartTestItemRQ startTestItemRQ, final Maybe<String> launchId, final TestItemTree.TestItemLeaf testItemLeaf) . 

Method to send TestItem finish request:

    public static Maybe<OperationCompletionRS> finishItem(final ReportPortalClient reportPortalClient, final FinishTestItemRQ finishTestItemRQ, final Maybe<String> launchId, final TestItemTree.TestItemLeaf testItemLeaf)

Methods to attach Log to the provided TestItemLeaf entity in the Report Portal instance:

    public static boolean sendLog(final ReportPortalClient reportPortalClient, final String level, final String message, final Date logTime,TestItemTree.TestItemLeaf testItemLeaf)
    public static boolean sendLog(final ReportPortalClient reportPortalClient, final String level, final String message, final Date logTime, final File file, TestItemTree.TestItemLeaf testItemLeaf)

All arguments for ItemTreeReporter methods should be created by agent and then required method should be invoked.