Chapter 13. Using Thucydides tags

13.1. Writing a Thucydides tags plugin
13.2. Bi-directional JIRA integration
13.3. Increasing the size of screenshots

Viewing test results is certainly useful, but, from a release and deployment point of view, it is just scratching the surface. Even more interesting is the ability to view test results in terms of stories, features, behaviors, scenarios, or whatever other categorizations you find useful.

Thucydides Tags provide a very flexible mechanism for categorizing and reporting on your test results, which serve as an alternative to the Story/Feature structure described earlier. You can decide on an appropriate set of tag types (such as "feature", "behavior", "epic", "scenario", "non-functional requirement", etc.), and then assign tags of the different types to your tests. To declare a tag type, you simply use a tag of the specified type - it will then automatically appear in the Thucydides reports.

You can assign a tag manually to a test using the @WithTag annotation:

    @WithTag(name="important functionality", type = "functionality")
    class SomeTestScenarioWithTags {
        @Test
        public void a_simple_test_case() {
        }

        @WithTag(name="simple story",type = "story")
        @Test
        public void should_do_this() {
        }

        @Test
        public void should_do_that() {
        }
    }

Note that tags can be assigned at the test or the class level. Tag names and types are free text -