testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

Feature Request about test item id #2161

Closed hknerts closed 4 years ago

hknerts commented 4 years ago

TestNG Version

7.0.0

Expected behavior

an "id" variables can be added to Test annotation class as default

Actual behavior

There is no "id" variables in Test Annotation class.

testid

Is the issue reproductible on runner?

Test case sample

Please, share the test case (as small as possible) which shows the issue

krmahadevan commented 4 years ago

@hknerts - Can you please help elaborate as to why do you think that this changeset should be within TestNG?

You can very well build this as a custom annotation that can be used by an individual project to track this information no ?

krmahadevan commented 4 years ago

ping @juherr - Thoughts ?

hknerts commented 4 years ago

@krmahadevan @juherr We are considering developing plugins for integration with test management tools (like Xray-Jira). we will have to match the test ids and the platform ids.

if we do this with custom annotation classes, we will have to tell users to develop this constant class. this will adversely affect the integration process.

if this variable is in testng, we'll just ask users to assign this test id variable value, in easy way.

hknerts commented 4 years ago

@krmahadevan @juherr After that, i want to implement a common listener class to TestNG. It is about reporting test result to Jira-Xray and other management tools. I think ,it will very useful for huge projects and orgs

juherr commented 4 years ago

Like @krmahadevan, I think a custom annotation is a better solution and you can provide an external jar with the annotation for your customers. Another option is using the description attribute and uses it as an id attribute.

krmahadevan commented 4 years ago

@hknerts - Just to elaborate.

You can create a new project that contains the following two components:

  1. A custom annotation that can be used on top of @Test annotated test methods, which captures the TCMS (Test case management system) specific data such as ID, project etc.,
  2. A TestNG listener that implements say IInvokedMethodListener wherein in its afterInvocation you basically retrieve the custom annotation and using its values, you interact with the TCMS system.

For this you dont need the changes to reside in TestNG. They can very well reside outside of TestNG as 1 project which your users would add up as a dependency and work with it.

hknerts commented 4 years ago

ok, thanks for your response.