I have Java/Groovy/Spock tests and Allure 2 report. I use allure.Step()
annotation to describe all steps that I want to see in Allure report. For example:
def "some test"() {
when: "do some request"
Request.getRequest()
}
class Request {
@Step("GET https://some.request")
static Response getRequest() {
return given().log().all()
.filter(new AllureRestAssured())
.when()
.get(conf.url())
}
}
In that case I see two basically same blocks in report:
AllureRestAssured()
.log().all()
console output.Is there a way to remove all console output from Allure report and leave only methods that have @Step
annotation?
Ma college have found a solution. Separate object with all required RestAssured filters:
class BeforeAll {
BeforeAll() {
filters(new AllureRestAssured(), new RequestLoggingFilter(), new ResponseLoggingFilter())
}
}
And call this object on test or extended Specification:
static BeforeAll beforeAll = new BeforeAll()