Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Normally, clean up code should be part of tearDown testcases. However, is some situations, you may need to run some final code at the end of the test after the results have been tabulated. This is easy to do with a final target.  A specific example is How to run Selenium as a GINT test.

No Format
bgColorlightyellow
titleExample
@GrabResolver(name='atlassian', root='https://maven.atlassian.com/content/groups/public/')
@Grab(group='org.swift.tools', module='gint', version='1.5.0')
import org.swift.tools.*
includeTool << Gint

gint.initialize(this) // required

gint.add(
    name: 'hello', 
    inline: { println 'Hello World' },
)
 
target(name: 'final', description: 'Run this last', prehook: [], posthook: []) {
    message 'info', 'Final code gets run here'
}
 
gint.finalizeTest() // final preparations for running tests

...