Skip to content

Support adding tags for all keywords using Keyword Tags setting #4373

Closed

Description

@pekkaklarck

Currently it is possible to give tags to user keywords only so that all keywords use the [Tags] setting separately. Often all keywords in a resource files have some common tags, and it would be convenient to be able to list them only once. We can support that by adding new Keyword Tags setting that can be used in the Settings section. Although the primary use case would we with keywords in resource files, the new setting should work also in test case and suite initialization files. When used in the latter, it should not recurse to lower levels suites or to resource files in the same directory.

With tests it's possible to use Force Tags and Default Tags setting, but there's a proposal to rename the former to Test Tags and removing the latter altogether (#4365). That proposal is related to this issue in two ways:

  • If we add Keyword Tags, it would be a lot better if the test related setting was Test Tags and not Force Tags.
  • Regardless do we remove Default Tags or not, I don't think keyword tags would need that kind of a separate setting. I instead believe we should come up with some new syntax that allows removing tags set globally both from tests and keywords. I'll submit a separate issue about that.

Activity

  1. added this to the v5.1 milestone on Jun 20, 2022
  2. aaltat commented on Jun 21, 2022

    @aaltat
    Contributor

    Have you tough what one can do with the keyword tags? Will it have same functionality as library keyword tags or is there plan for something else?

  3. oboehmer commented on Jun 22, 2022

    @oboehmer
    Contributor

    so the scope of Keyword Tags would be all the keywords defined in the file the setting is specified in? I think this is what you mean, @pekkaklarck and what would make sense..

  4. pekkaklarck commented on Jun 22, 2022

    @pekkaklarck
    MemberAuthor

    User keywords already can have [Tags]. This planned new setting just makes it possible to specify tags for all keywords in a single resource file or a test case file. Instead of

    *** Keywords ***
    K1
        [Tags]    common
        K
    K2
        [Tags]    common
        K
    K3
        [Tags]    common    custom
        K

    you could have

    *** Settings ****
    Keyword Tags    common
    
    *** Keywords ***
    K1
        K
    K2
        K
    K3
        [Tags]    custom
        K
  5. pekkaklarck commented on Jun 22, 2022

    @pekkaklarck
    MemberAuthor

    We could consider adding something similar to libraries so that you didn't need to repeat same tags with all keywords. Something like @library(keywords_tags=['common']) could work well. That would require its own issue, though.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions