Skip to content

Test case ID Key

Ivan edited this page Nov 26, 2019 · 1 revision

Test case ID Key

In case when a test method is a parametrized one approach with common Test case ID is not valid, because the same test method with different arguments should be represented as TestItem with different Test case ID in the Report Portal instance.
To provide different Test case ID for the same test method @TestCaseIdKey annotation was provided.
You should mark with TestCaseIdKey annotation either test method parameter or test class field (JUnit4), then test agent should retrieve invoked method and get Test case ID int value using TestCaseIdUtils by passing method with arguments.
@TestCaseIdKey annotation contains field numeric of type Boolean to define in test source code whether parameter is Integer and should be parsed as number or parameter is an object and its hashCode should be returned.