我在 Geb 测试中使用 Spock Reports 扩展。我正在尝试查找是否有任何方法可以让日志消息显示在 Spock 报告中。
我有大致这样的东西:
@Slf4j
class SpockReportExample extends GebReportingSpec {
def expectedVar = "5"
when: "I click the button."
button.click()
then: "The new value is displayed."
def value = formElement.value()
value==expectedValue
log.info("The new value is $value")
}
我想在我的 spock 报告中看到说明要输出的实际值的日志,但我找不到方法。我尝试在信息、警告、调试、错误和跟踪级别发送日志,但没有运气。这可能吗?