Amith
Amith

Reputation: 99

Isn't it possible to print the Reporter.log messages in Allure report?

I have recently integrated Allure reporting into my existing TestNG framework and it works fine. However I could not see any of the Reporter.log messages in the Allure report. Isn't this supported?

Upvotes: 2

Views: 8137

Answers (2)

Ru Cindrea
Ru Cindrea

Reputation: 733

I came up with a different way to log Reporter.log messages to the Allure report, for those interested simply in adding logs to the report besides saving the log file itself as an attachment.

I created an Allure step, like this:

@Step("{0}") 
public void logToReport(String message) {
    log(message); //or System.out.println(message);
}

@Step({0}) will then add the message to the Allure report.

Upvotes: 2

vania-pooh
vania-pooh

Reputation: 2977

Allure supports a lot of test frameworks for multiple languages and because of that it doesn't know about Reporter.log. However you can attach this file to any selected case as usually using @Attachment annotation. Take a look at the following question for more details about attachments.

Upvotes: 0

Related Questions