Comment #5 on issue 867 by pekka.klarck: New keyword , "Run Keyword If Tag"
http://code.google.com/p/robotframework/issues/detail?id=867
You wrote:
Solution which you are provided will work the same as my implementation.
Which is creating another deep level, hoped for solution which, a little
different.
If you think the user keyword and an unnecessary abstraction level, you can
also use just
Run Keyword If "DEBUG" in @{TEST TAGS} Log Variables
That is going to work 100% same way as below if we added Run Keyword If Tag.
Run Keyword If Tag DEBUG Log Variables
I agree that the second version is slightly more readable but even the
first one isn't that bad considering that you shouldn't use conditional
logic on the test case level anyway. A benefit of the former is that you
can construct the condition freely and can, for example, verify that a test
has two tags.
The main reason I'm against adding this keyword is that it would open a
door for adding keywords like Run Keyword If Variable Exists, Run Keyword
If Variables Are Equal, Run Keyword If Test Is Critical, etc. All of these
are probably valid in some cases but they are also easy to implement on top
of Run Keyword If and other existing keywords.
You wrote:
If test have tags then keyword is presented the same way as it would be
executed directly.
And when test doesn't have tag then this part isn't added to log.
Not showing the keyword at all when the condition is not true should be
submitted as a separate enhancement request. It's also related to issue 828.