jeudi 5 septembre 2019

How Do I Create A TestNG Suite In Java?

The TestNG docs say to use xml to create a test suite.

How do I write a TestNG suite without XML?

Something like how JUnit specifies the test classes with annotations.

https://github.com/junit-team/junit4/wiki/aggregating-tests-in-suites

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
  TestFeatureLogin.class,
  TestFeatureLogout.class,
  TestFeatureNavigate.class,
  TestFeatureUpdate.class
})

public class FeatureTestSuite {
  // the class remains empty,
  // used only as a holder for the above annotations
}

Aucun commentaire:

Enregistrer un commentaire