package testng
Type Members
- 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
@Testannotation, 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'sRunner, you must include TestNG's jar file on the class path or runpath. This version ofTestNGSuitewas tested with TestNG version 6.3.1. - 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.TestNGSuiteis 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 ofTestNGSuiteinto some other class, you can use this trait instead, because classTestNGSuitedoes nothing more than extend this trait.See the documentation of the class for a detailed overview of
TestNGSuite. - 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-tparameters. See the documentation forRunnerfor more information.To execute
TestNGWrapperSuites with ScalaTest'sRunner, you must include TestNG's jar file on the class path or runpath. This version ofTestNGSuitewas tested with TestNG version 6.3.1.