Hi we run Geb tests on the Spock framework. I am trying to take a screenshot in a module using report "Screenshot". It does not recognize the report function as it does on a Spec. How should I go about taking screenshots in a module.
Here is a example code which is in a module.
try{
$(By.xpath("//button[@ng-click=\"ok()\"]")).click()
}
catch (Throwable t){
failures.add("\n Could not click on the Ok button after the Ticket created successfully message appeared")
report "Failure"
}
The
report()
method is available onBrowser
class and an instance of that class is available asbrowser
property inside of modules, so you can call it from within a module using: