org.scalatest

testng

package testng

Visibility
  1. Public
  2. All

Type Members

  1. class TestNGSuite extends TestNGSuiteLike

    A suite of tests that can be run with either TestNG or ScalaTest.

    A suite of tests that can be run with either TestNG or ScalaTest. This class allows you to mark any method as a test using TestNG's @Test annotation, and supports all other TestNG annotations. Here's an example:

    import org.scalatest.testng.TestNGSuite
    import org.testng.annotations.Test
    import org.testng.annotations.Configuration
    import scala.collection.mutable.ListBuffer
    
    class MySuite extends TestNGSuite {
    var sb: StringBuilder = _ var lb: ListBuffer[String] = _
    @Configuration(beforeTestMethod = true) def setUpFixture() { sb = new StringBuilder("ScalaTest is ") lb = new ListBuffer[String] }
    @Test(invocationCount = 3) def easyTest() { sb.append("easy!") assert(sb.toString === "ScalaTest is easy!") assert(lb.isEmpty) lb += "sweet" }
    @Test(groups = Array("com.mycompany.groups.SlowTest")) def funTest() { sb.append("fun!") assert(sb.toString === "ScalaTest is fun!") assert(lb.isEmpty) } }
    To execute TestNGSuites with ScalaTest's Runner, you must include TestNG's jar file on the class path or runpath. This version of TestNGSuite was tested with TestNG version 6.3.1.

  2. trait TestNGSuiteLike extends Suite

    Implementation trait for class TestNGSuite, which represents a suite of tests that can be run with either TestNG or ScalaTest.

    Implementation trait for class TestNGSuite, which represents a suite of tests that can be run with either TestNG or ScalaTest.

    TestNGSuite is a class, not a trait, to minimize compile time given there is a slight compiler overhead to mixing in traits compared to extending classes. If you need to mix the behavior of TestNGSuite into some other class, you can use this trait instead, because class TestNGSuite does nothing more than extend this trait.

    See the documentation of the class for a detailed overview of TestNGSuite.

  3. class TestNGWrapperSuite extends TestNGSuite

    Suite that wraps existing TestNG test suites, described by TestNG XML config files.

    Suite that wraps existing TestNG test suites, described by TestNG XML config files. This class allows existing TestNG tests written in Java to be run by ScalaTest.

    One way to use this class is to extend it and provide a list of one or more names of TestNG XML config file names to run. Here's an example:

    class MyWrapperSuite extends TestNGWrapperSuite(
      List("oneTest.xml", "twoTest.xml", "redTest.xml", "blueTest.xml")
    )
    

    You can also specify TestNG XML config files on Runner's command line with -t parameters. See the documentation for Runner for more information.

    To execute TestNGWrapperSuites with ScalaTest's Runner, you must include TestNG's jar file on the class path or runpath. This version of TestNGSuite was tested with TestNG version 6.3.1.

Ungrouped