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
Test Tags from *** Settings *** and [Tags] from Test Case behave differently when removing tags: while it is possible to remove tags with Test Case's [Tag] -something, Settings Test Tags -something introduces a new tag -something.
Running tests with these robot files (also attached):
__init__.robot:
*** Settings ***
Test Tags something
-SomethingInSettings.robot:
*** Settings ***
Test Tags -something
*** Test Cases ***
-Something In Settings
Should Be Empty ${TEST TAGS}
-SomethingInTestCase.robot:
*** Test Cases ***
-Something In Test Case
[Tags] -something
Should Be Empty ${TEST TAGS}
The current behavior is actually be design. When the -tag syntax was introduced in RF 7.0 (#4374), it was specifically designed to work only with [Tags]. The main motivation was making the change as little backwards incompatible as possible, by not changing how tags set using Test Tags work. I also believe it didn't occur to us that someone would like to remove tags set in initialization files using this syntax.
Now that I think about this again, I believe the use case to remove tags set in initialization files is pretty important. I also agree that the current behavior that -tag works with [Tags] but not with Test Tags is inconsistent. I think it makes sense to change this, but due to the aforementioned backwards compatibility concerns, the change needs to wait for a major release and we should also deprecate using -tag syntax as a literal tag name in Test Tags first. I thus propose the following:
Let's use this issue for actually making the change. I'll update the title accordingly and assign this to RF 8.0 scope. I'll also submit a separate issue about deprecation and assign it to RF 7.2.
pekkaklarck
changed the title
Inconsistent behavior with Test Tags from Settings and [Tags] from Test Case
Allow removing tags using -tag syntax also in Test TagsNov 1, 2024
Test Tags
from*** Settings ***
and[Tags]
from Test Case behave differently when removing tags: while it is possible to remove tags with Test Case's[Tag] -something
, SettingsTest Tags -something
introduces a new tag-something
.Running tests with these robot files (also attached):
__init__.robot
:-SomethingInSettings.robot
:-SomethingInTestCase.robot
:gives the following output:
(https://forum.robotframework.org/t/removing-tags-from-the-test-tags-setting/7513/6?u=romanliv confirms this as an issue to be fixed)
The text was updated successfully, but these errors were encountered: