我正在使用athaydes spock-report。我想在html报告中插入一些特定的输出文本。为此,请参考我到目前为止已经使用过的东西。下面是我的Spec文件:
@Stepwise
class TC001_SMO_Scenario_Spec extends GebReportingSpec {
def "Step 1:Go to the login page of the WU"() {
when: "User open the Login page"
to LoginPage
then: "Login page should get open"
at LoginPage
when: "User enters credentials"
page.Login()
then: "Home Page should get open"
at HomePage
}
def "Step 2:User initiates transfer process"() {
when: "Clicks on the Start New Transfer button"
page.selectionOfItem()
sleep(2000)
then: "Reciept Number should be generated"
at ManageConnections
def recieptNumber = tabConnections.text()
reportInfo(recieptNumber )
reportInfo " Reciept Number is $recieptNumber "
}
}现在,当执行完成后,下面是报表的快照。

现在我的要求是,有一些收据号码是在网页上生成的,我想有这是打印在html报告中,然后块。(然后:“应该生成接收号”)。您能指导我如何通过特定的geb/spock关键字或athaydes - spock-reports来实现这一点吗?
我也参考了下面网站的材料,但是它对我不起作用。https://github.com/renatoathaydes/spock-reports#how-to-use-it
谢谢你在这方面的帮助。
发布于 2018-06-22 20:24:11
最后我成功了,我相信我也找到了根本原因。
如果spec文件扩展到Specification,那么reportHeader和reportInfo关键字就可以正常工作。
如果您通过扩展GebReportingSpec来使用geb,那么需要使用report()来获取要添加到geb spock html报告中的自定义步骤。
谢谢,杜吉什
https://stackoverflow.com/questions/50459596
复制相似问题