Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium

New issue 1209 by [email protected]: add "parent" attribute to runnable objects
http://code.google.com/p/robotframework/issues/detail?id=1209

I would like a public attribute on RunnableTestCase, RunnableTestSuite and robot.running.Keyword that can be used to get the keyword, suite or test case that is the nearest ancestor. I recommend this be named "parent".

When combined with issue #1208 it would be possible for a listener to be able to generate the equivalent of a stack trace, as well as get attributes of the currently running test case or test suite from any of the main (start_*, end_) listener methods.

A third benefit kicks in when the public interface of those objects has methods for controlling a test run. For example, if each object had a `fail()` method, a listener could cause the current keyword, test case or suite to fail with 'self.ail()' or 'self.parent.fail()', etc.

I'm sure there are other uses, this was the one that seemed the most obvious.

This enhancement request is not about adding the fail method; it is only about adding the `parent` attribute.

Reply via email to