Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks
AwareTo opened this issue Jul 24, 2019 · 1 comment
Open
2 tasks

Comments

@AwareTo
Copy link

AwareTo commented Jul 24, 2019

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: Factory dataprovider parameters not displayed in testresult testng#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

  • [ x] Windows
  • Linux
  • OSX
@balrajdacha
Copy link

Any update on when this will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants