I am using athaydes spock-reports. I would like to insert some specific output texts in html reports. For that please refer below things which I have used so far. Below is my Spec file:
@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 "
}
}
Now when the execution is done then below is the snapshot of report.
Now my requirement is that, there is some receipt number is getting generated on web page, I would like to have that to be printed in html report, after the Then block. (then: "Reciept Number should be generated"). Could you please guide me how this can be done with the help of specific geb/spock keywords or athaydes - spock-reports.
I referred the material from below site as well, however it's not working for me. https://github.com/renatoathaydes/spock-reports#how-to-use-it
Thanks for your help on this.
Finally I got success and I believe I got the root cause as well.
If the spec file extends to
Specification
, thenreportHeader
andreportInfo
keywords are working fine.If you are using geb, by extending
GebReportingSpec
, thenreport()
needs to be used to get customized steps to be added in geb spock html reports.Thanks, Durgesh