I am using GebReportingSpec.
I want to get name of test that will be executed by using setup method.
I am get null output from testName.methodName
my code snippet is as below:
class CRMAppLoginSpec extends GebReportingSpec {
@Rule
public TestName testName = new TestName()
setup()
{
String methodName = testName.methodName;
println (methodName)
}
def "mytest"(String myName)
{
given: "This is my test case in geb-spock"
when: "capture the parameter"
def var1 = myName
then: "Display input parameter"
println ("Welcome to geb-spock : ${var1}" )
where:
myName << ["Debasish", "Prashant"]
}