...
JUnit 5:
@DisplayName
gives a way to specify generic information in the test name instead of the hard rule based Java method names. This can be used to specify an existing AIO Case Key.
For example,@DisplayName("SCRUM-TC-1973 : Test forest gets created.")
Testcase key in Underscores : Since Java and Python, do not allow hyphens in their method signatures, AIO Tests allows case keys with underscores as valid mapping. The AIO Test key can be used in the method name by replacing the hyphen with underscores. eg. if AT-TC-123 is being automated by a test, the test method can be named as
verifyNotNullType_AT_TC_123
and the results of this method will be marked against AT-TC-123.Automation Key: The mapping of an AIO Case to an automated JUnit case can happen through a field Automation Key, which can be specified in the Case in AIO Tests app as shown below. The automation key is the fully qualified name of the test method i.e packagename.classname.methodname.
This can be useful at places where you do not want to add AIO case keys in the name or annotations or where automation is happening first without a manual case being created in AIO Tests.New Case creation: If no case key (e.g. SCRUM-TC-xx) or automation key is found with existing cases, a new case is created with
- title as thename
value from <testcase> tag of the JUnit report
- automation key asclassname.name
from the JUnit report.
- status as Published
- automation status as Automated
- automation owner as user uploading the resultsThe following flow summarizes the logic of JUnit case mapping when a key is not found via @DisplayName and via Automation key
Examples
Below are few examples that show results on testing the ForestCreator.java class.
...