Skip to content

Additional listener attributes to differentiate suite/test setup/teardown from other keywords. #859

Closed

Description

@spooning

Originally submitted to Google Code by imranoftherings on 9 Jun 2011

Request for additional listener methods.

start_suite_setup
end_suite_setup
start_suite_teardown
end_suite_teardown

start_test_setup
end_test_setup
start_test_teardown
end_test_teardown

Activity

  1. added this to the 2.6 milestone on Jun 29, 2014
  2. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 10 Jun 2011

    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'.

  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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"

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 10 Jun 2011

    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.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 11 Jun 2011

    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.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 13 Jun 2011

    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.

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 13 Jun 2011

    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.

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 13 Jun 2011

    Included into 2.6 alpha 1.

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions