Skip to content

DynamicTest should be able to provide tags and source information to TestDescriptor #1178

@jhorstmann

Description

@jhorstmann

Overview

Currently the source for dynamic tests is a always a MethodSource pointing to the @TestFactory annotated method. In case the dynamic tests are based on external files, like in a cucumber implementation, it should be possible to specify the source.

Example

Given a file "helloword.feature" containing
  """
  Feature: Hello World Feature

    @hello @world
    Scenario: Hello World Scenario
        Given the user name is 'World'
         When the user clicks the hello button
         Then the output is 'Hello World'
  """
  When dynamic tests are created for this feature
  Then the test description should have a file source of "helloworld.feature" line 4
   And the test description should have the tags ["hello", "world"]

Related Issues

Deliverables

  • DynamicTest / DynamicContainer should have additional factory methods allowing to specify TestSource
  • DynamicTest / DynamicContainer should have additional factory methods allowing to specify Set<TestTag>
  • The above information should be used when creating the DynamicTestTestDescriptor and DynamicContainerTestDescriptor

(The actual creation of the dynamic tests for a cucumber scenario is out of scope)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions