You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Additional listener attributes to differentiate suite/test setup/teardown from other keywords. #859
Listener methods start_keyword and end_keyword ought to be called when setups and teardowns are executed. Would it be enough to add the type of the keyword into the argument dictionary? Values could be 'setup', 'teardown', and 'keyword'.
Originally submitted to Google Code by imranoftherings on 10 Jun 2011
Even though what you suggest would be good enough, I think from a test case lifecycle perspective it would be better to have separate methods. We will clearly have all the test lifecycle methods in the listener interface and it will be much more obvious to the users. I leave the implementation up to your discretion.
If you decide to go with what you suggested, we would need a distinction between "suite setup" and "test setup"
A problem with adding new methods is that then multiple methods (e.g. both start_test_setup and start_keyword) would be called upon every setup and teardown. Just adding the attrs is also easier to implement. Most likely that's eay enough to be done in 2.6.
You are correct that suite and test level setup and teardown should be separated.
Implementation and tests done. Attributes to start_keyword and end_keyword now contain 'type' that is either keyword, suite setup, suite teardown, test setup, or test teardown.
This is now implemented so that if a user keyword is used as a setup or teardown, only the top level keyword gets 'setup/teardown' type and others get type 'keyword'. Is that ok? At least the implementation this way is easier.
This also needs to be documented in the User Guide.
Originally submitted to Google Code by imranoftherings on 13 Jun 2011
Your point in comment 5 is valid. Since we don't have an explicit end_suite method, the only way to properly determine the end of setp is the type. If the type is "setup" only for the top-level keyword then we wouldnt be able to find out when setup finishes and when the test begins
I haven't tested this yet. I will do that sometime this week
Activity
spooning commentedon Jun 29, 2014
Listener methods start_keyword and end_keyword ought to be called when setups and teardowns are executed. Would it be enough to add the type of the keyword into the argument dictionary? Values could be 'setup', 'teardown', and 'keyword'.
spooning commentedon Jun 29, 2014
Even though what you suggest would be good enough, I think from a test case lifecycle perspective it would be better to have separate methods. We will clearly have all the test lifecycle methods in the listener interface and it will be much more obvious to the users. I leave the implementation up to your discretion.
If you decide to go with what you suggested, we would need a distinction between "suite setup" and "test setup"
spooning commentedon Jun 29, 2014
A problem with adding new methods is that then multiple methods (e.g. both start_test_setup and start_keyword) would be called upon every setup and teardown. Just adding the attrs is also easier to implement. Most likely that's eay enough to be done in 2.6.
You are correct that suite and test level setup and teardown should be separated.
spooning commentedon Jun 29, 2014
This issue was updated by revision a1530c26bee6.
Implementation and tests done. Attributes to start_keyword and end_keyword now contain 'type' that is either keyword, suite setup, suite teardown, test setup, or test teardown.
This is now implemented so that if a user keyword is used as a setup or teardown, only the top level keyword gets 'setup/teardown' type and others get type 'keyword'. Is that ok? At least the implementation this way is easier.
This also needs to be documented in the User Guide.
spooning commentedon Jun 29, 2014
This issue was updated by revision 51a7b0202736.
I thought about this a bit myself and come to conclusion that it's better if all keywords executd as a part of setup/teardown got a correct type.
spooning commentedon Jun 29, 2014
This issue was updated by revision 36dc4f55cc18.
Now this is also documented in the user guide. I consider this done but comments are still appreciated.
spooning commentedon Jun 29, 2014
Included into 2.6 alpha 1.
spooning commentedon Jun 29, 2014
Your point in comment 5 is valid. Since we don't have an explicit end_suite method, the only way to properly determine the end of setp is the type. If the type is "setup" only for the top-level keyword then we wouldnt be able to find out when setup finishes and when the test begins
I haven't tested this yet. I will do that sometime this week