/
How to run final code at the end of the test
How to run final code at the end of the test
Summary
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.
Example
@Grab(group='org.swift.tools', module='gint', version='2.7.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
Output
gant -f helloworld [start] hello Hello World [ending] hello [complete] hello - 0.01 secs [info] Successful testcases . . . . . . . . . . : 1 <<< TEST SUCCESSFUL [info] Total testcases . . . . . . . . . . . . . : 1 [info] Elapsed run time . . . . . . . . . . . . : 0.684 secs = = = = = = helloworld completed at Wed Sep 12 07:41:21 CDT 2012 = = = = = = [info] Final code gets run here BUILD SUCCESSFUL Total time: 1.78 seconds
, multiple selections available,
Related content
How to run Selenium as a GINT test
How to run Selenium as a GINT test
More like this
How to test Hello World
How to test Hello World
More like this
How to use GINT for unit testing
How to use GINT for unit testing
More like this
How to add GINT integration test to Maven build
How to add GINT integration test to Maven build
More like this
How to have a Bamboo build with a manual IM request
How to have a Bamboo build with a manual IM request
More like this