If you want to use the hooks for the Test Suite you will need to use @SetUp
.
Something like this could work:
@SetUp(skipped = false)
def setUp() {
//create the custom report file using methods linked here: https://www.tutorialspoint.com/groovy/groovy_file_io.htm
}
@SetupTestCase(skipped = false)
def setupTestCase() {
// write to file whatever you want
}
@TearDownTestCase(skipped = false)
def tearDownTestCase(TestCaseContext testCaseContext){
// get test case status and write it to file
def status = testCaseContext.getTestCaseStatus()
}
You will need to play around with the groovy file methods to learn exactly how to create files and write to files but this is the way to go if you wish to create a custom report.