From Program Creek on the net.thucydides example sources I found a solution for altering the name of the test in my JUnit class, but it doesn't work. I still get one test name in my report (as shown in the image link)
My ultimate goal is to run the same Maven-Serenity JUnit Test multiple times and report the unique Testname feeded by a parameter coming from the spreadSheetData named "testCase" Maybe my solution doesn't make a change at all, and hopefully it is clear what I want.
Does anyone can help me going forward?
My fragments of code is shown below:
@RunWith(SerenityParameterizedRunner.class)
public class STP_Offer_Flow_Test {
...
public static Collection<Object[]> spreadsheetData() throws IOException {
InputStream spreadsheet = new FileInputStream("src/test/resources/testdata.xlsx");
return new SpreadsheetData(spreadsheet, null).getData();
...
public class AnnotatedDataDrivenScenario
{
private String name;
@Qualifier
public String getQualifier()
{
return name;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
@Test
public void STP_Offer_Flow_Basic() throws Throwable {
log.info(testCase);
log.info("applicantID = " + applicantID);
AnnotatedDataDrivenScenario testCaseAnnotation = new AnnotatedDataDrivenScenario();
testCaseAnnotation.setName(testCase);
...
}