Reputation: 475
Is there a way to call a Suite Init and Suite Teardown before all tests and after all tests in robot framework.
I have dir structure like
XYZ
- X1
- X2
I tried writing a __init__.robot
in XYZ dir but that didn't help.
Upvotes: 1
Views: 1864
Reputation: 385830
The way to do this is to create a file named __init__.robot
in the parent folder. In that file you can put a suite setup or teardown (using normal robot syntax in the settings table) that will get run at the start and/or end of the suite.
When using this method, you must make sure that this parent directory is the suite that you run. In other words, you must run your test like robot XYZ
and not robot XYZ/X1
.
Upvotes: 1