Is it possible to use contents from a file within setup/teardown
I have a testsuite where I need to do a setup and teardown for each of the testcases. Currently I have the same code copy pasted in all the tests. But from a maintenance point of view this is not scalable. Is there a way I can load contents of an external groovy script from disk and then use it within setup or teardown?
Solved! Go to Solution.
In case if you still need to load from your files as setup and teardown, then you can use below project(crated with the API I was talking about earlier and created project for ease of use instead of a script) and run it on command line as per the sample given
All you need to do is pass the parameters and run the project which is provided. that will add setup and teardowns to your project.
Note that here your project path is passed as parameter value for PROJECT.