Hi
Is there any specific reason why the “Test Tags” setting in the Settings section does not allow to remove tags in the same way as the “[Tags]” setting available for test cases does? Relevant documentation part: Robot Framework User Guide
Hi Roman,
Not sure what situation where you would need this?
Can you give an example where you tests would get a tag that you remove that tag from all tests?
I’m not a developer on robot framework, so I can only guess that they never saw a need to this functionality at the Test Tags, as this option in [Tags], just over ides Test Tags, so what would be the higher up location where you might set a tag that would need Test Tags to over ride?
I guess if you do have a use case where you need the functionality create a feature request here
Dave.
I probably still on my way to properly understand the meaning of tags. Probably there is a better way to achieve what I want.
I set multiple tags in the top-level suite initialization file __init__.robot
:
*** Settings ***
Test Tags tag1 tag2 tag3
And if that was possible to do Test Tags -tag1
in any suite then the suite could be completely excluded (now marking each test case from this suite with [Tags] -tag1
does the same). As a result all tests specific for a given tag can be run with robot -i tag1 .
.
In addition to this practical benefit, it would be more consistent as Test Tags -tag1
introduces a new tag called “-tag1” which is a bit surprising.
Hi Roman,
Tags can be used for lots of things, though I’ve only used them for filtering tests and quickly identifying what’s impacted when tests fail
So because of this I only apply tags using [Tags] section on a test, I’ve never used any global tags myself.
Sorry I can’t help more than that, hopefully someone else can chime in,
Dave.
The main reason was to avoid backwards compatibility problems in case someone already used
Test Tags -something
where -something
was a literal value. It probably also didn’t occur to us that someone would want to remove tags set in init files.
The current behavior with Test Tags
and [Tags]
is inconsistent and it probably would be a good idea to change it. We also didn’t hear anyone complaining that it’s not possible to anymore use
[Tags] -something
so that -something
is a literal value, so probably the change would also be safe with Test Tags
.
Please submit an issue about this and I promise well consider it!