testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Results window do not display test parameters when using Factory annotation #437

Open AwareTo opened 5 years ago

AwareTo commented 5 years ago

Problem Statement

  1. Run the test below using Eclipse
  2. Check the results page Result: the result page do not show the test parameters sent by dataprovider. See screenshot at: http://prntscr.com/ohyej5 The parameters do appear at testng-results.xml. This issue happens only when Factory annotation is used together with dataprovider annotation. It does not happen when only dataprovider annonation is used by the test. It is related to the following fixed issue: https://github.com/cbeust/testng/issues/1041

Test to reproduce issue

public class Test3 {
    protected  List<String> data;

    @Factory (dataProvider = "getDataForInstances")
    public Test3(List<String> dataToSet) {
        this.data = dataToSet;
    }

  @Test
    public void Sanity(){
      String text = this.data.get(this.data.size()-1);
       System.out.println("Printing Parameters when running test method [" + text + "]");
       }

@DataProvider(name = "getDataForInstances")
public static Object[][] getDataForInstances( ITestNGMethod method) {
    System.out.println("Method name = " + method.getConstructorOrMethod().getName() + "()\n");

    return new Object[][] {
      {Collections.singletonList("Java")},
      {Arrays.asList("TestNG", "JUnit")},
      {Arrays.asList("Maven", "Gradle", "Ant")}
      };
    }

}

Operating System

balrajdacha commented 4 years ago

Any update on when this will be fixed.