TestNG Example

From Documentation

This test case performs exactly the same as the JUnit one except that it is written in TestNG's annotation, please refer to [1].

To run a TestNG test case, please refer to Run TestNG.

public class HelloTestNg {
	public static void init() {

	public static void end() {

	public void after() {

	public void test() {
		DesktopAgent desktop = Zats.newClient().connect("/hello.zul");

		ComponentAgent button = desktop.query("button");
		ComponentAgent label = desktop.query("label");
		Assert.assertEquals("Hello Mimic", label.as(Label.class).getValue());
  • It has little difference to the JUnit test case. You only need to change @After to @AfterMethod and import org.junit.* to import org.testng.* .

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.