ZTL Concepts

From Documentation



Package

The package of the test case will depend on the location of the file within the root directory. In this project, the directory is named test(however, you can use your own directory, please refer to this for more information).

For example, the B30-123456 file is under test/org/zkoss/zkdemo/test2/B30-123456.ztl, its package is org.zkoss.zkdemo.test2.B30_123456Test.java. The dash '-' is replaced with an underscore '_' for the legal Java class name convention.

File Name

The file name of the ZTL file will be converted to a Java class name, there it should be a legal Java class name which JUnit can recognize. i.e. The class name should end with Test.

Test

The root tag in the ZTL file can enclose one or many Cases.

Property Description Default Value Require
import the package that is required to import this test case none optional
tags the tags to filter the test case, like button, window, listbox, and so on. none optional
context-path the name (zkdemo) of the context path, for example http://localhost:8080/zkdemo according to config.properties optional
server the URL of the ZK server according to config.properties optional
action the path that is visited by the Selenium server according to config.properties optional
delay the delay time of each command run by Selenium according to config.properties optional
timeout the timeout for waiting response from ZK server, in millisecond according to config.properties optional
browser the test case should be tested with all of the browser types according to config.properties optional

Case

The tag is like a method of a JUnit test case, and each Case in the same Test won't impact on each other. It can also enclose one or many Servers or Clients

Property Description Default Value Require
id the name of the method in the JUnit test case that starts with "test" none yes

Server

The content of the tag is run on the ZK server, and each tag will fire an Ajax request to execute the code.

Property Description Default Value Require
id the id of the server tag used for the ref property to identify. For example none optional
ref refer to the content of the server which matches the id. i.e. the content of the tag will be copied from the content of the server whose id is a match. For example none optional
lang the content of the language like *Java*, *Ruby*, and so on. (only ZK supported languages are allowed) For example zul optional

Client

The content of the tag is run on the Selenium server.

Property Description Default Value Require
wait the delay time of the tag command, in millisecond. For example none optional



Last Update : 2011/11/08

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