Jameleon - Test case (TEST CASES) - ZT

zhaozj2021-02-12  143

Jameleon - Test Cases - - Expand / Hide - Edit

Author / translation: slovenboy

Reserved / Publishing: Contact the author

Link: bonoy QA -

http://www.bonoy.com

Link: SlovenBoy's Blog -

http://slovenboy.blogdriver.com

This article:

Writing, to the Jameleon Forum of Bonoy QA View the latest progress

Links on BonoyQa: This article:

Http://www.bonoy.com/a/index.php?name=pnphpbb2&file=viewtopic&t=103&start=0&postdays=0&port=0&tdays=0&port=05E37079E88A8148433BB235AEF4EF94

Jameleon - Test case (TEST CASES)

Introduction

Write tests in Jameleon only need to write function tags (FunctionTag), let it inherit one

Feature labels provided by a suitable plugin. No need to write a session tag (sessionTAG) and test

Example tag (TestcaseTag). If you plan to use the HTTPUNIT plugin write function point (Function Point)

Then all function points must inherit httpunitfunctiontag.

Macro language

Jameleon uses Jelly as a macro engine. The macro language is XML, with a simple, language-independent party

Method describes the object. To use Jameleon, you need to have basic understanding of XML.

Three main parts of Jameleon

1. Test case tag (TestcaseTag)

2. Session tag (sessiontag)

3. Function Tag (FunctionTAG)

Test case tag (TestcaseTag)

Three classes listed above, only TestcaseTAG is not an abstract class. TestcasetAg should be enough

General, you can work with any type of application. Jameleon's three main parts are father and son

Relationship, testcasetag is my grandfather. View Testcasetag's Javadoc comments, learn more.

Currently, TestCaseTAG is expressed as in the macro language.

Attributes. The next mentioned Environment.properties file is a key = value (key = value)

Files must be placed in the classpath to be used. In this file, if

Test-case tag support, the value in the Test-Case tag will be overwritten.

Session tag (sessiontag)

Action in the Session Tag (SessionTAG) application. A test case tag (TestcaseTag)

Contains multiple session labels. Since the state of the application of the session label is dependent on the application type (such as web application, GUI application,

Console application, etc.), so the session label is an abstract class. A web application overwrites the appropriate application via cookie or URL

state. This requires some interface to interact with the browse. However, a state or session of a GUI application is maintained by applying yourself, this

Need a different interface to direct connection of the application. The session label has three extensions. One is a JWebUnit plugin, which is expressed as element in the macro language. another

Is the httpUnit plugin, expressed as . HTTPUNIT plugin outputs better error message with

Debug function. Another is the JUnit plugin, which is expressed as the element.

All session tags have the same basic properties:

Function Tag (FunctionTAG)

The function tag is an action applied in a session process. Just as a test case tag can have

Like multiple session tags, there can be multiple function tags in a session tag. There are three implementations of the functional label.

HTTPFunctionTAG is an implementation of a JWebUnit plugin. HttpUnitFunctionTAG is an implementation of HTTPUNIT plugins.

JUnitFunctionTAG is an implementation of the JUnit plugin.

However, the plugin is just a simple extension of the original API, and the API of the Javadoc through the plugin.

Several methods have been implemented for httpunitfunction, but simply call the HTTPUnit API. This makes writing

Function points become easy, but in order to better use the HTTPUNIT plugin, it is best to learn httpunit. For jwebunit

The plugin is also the same, in addition to the same method in the WebTest class in httpfunctionTag. In other words,

All available methods of the Webtester class in jwebunit are also available in httpfunctionTAG. JUnit plugin

Information can be obtained in JunitFunctionTag's Javadoc documentation.

Jameleon's Ant task = What is ANT? = Ant is a build tool written in Java. = Jameleon Ant Task = Jameleon provides three Ant tasks: == xjavadoc task == xjavadoc Automatic registration custom function point to Jameleon's macro (JLLY). Jameleon can automatically generate TestCaseTagDefs.properties files and prevent in any directory. In order to use this task, add the following lines in the build.xml file.

Code: jameleon.jar must be in the classpath defined above. The JameLeonXDoclet task has the following properties: Properties: OutputDir Description: Save the file directory. Must: Yes ----------------------------- Property: OutputFileName Description: The name of the file to be saved. Must: No - Default is TestcaseTagDefs ----------------------------- Property: Quiet Description: No file with no suitable label is not Output warning. Must: No - Default is False ---------------------------- Property: ISA Description: The type included in registration. In other words, all classes that inherit or implement the value of ISA will be registered. Must: No - By default is Net.sf.jameleon.Function.FunctionTag ---------------------------- == Test case Perform tasks == Two Ant tasks can be used to perform test cases. They are basically the same, except that ExecuteTestCaseTask performs test cases in the same virtual machine and ExecuteTestCaseSeparateVMTask performs each test case in a separate virtual machine. The task is used to perform test cases that meet certain modes. If any test case failed, Build failed, a file list, a line number, and a short description of the failed file.

Using this Ant task first, you need to define tasks: code: jameleon.jar must be placed in class path . ExecuteTestCaseTask tasks do not have properties. But it supports an ANT file set (FileSet) data type. The file set data type allows test cases to be performed in accordance with the file name and / or directory structure. Selector Option (Selector Option) is used to scan files with certain texts. This can be used to perform all test cases containing a keyword or a function point. Due to the characteristics of the macro engine, the labels that don't know will be ignored. That is, some specific content can be input, such as smoke In the test case, this use case is classified as a smoke type, then a selector can be set to perform all test cases containing the SMOKE word. Examples of such use may want to follow this:

Code: This will execute all test cases in directory TST / XML and contain smoke words, excluding with the Testall.xml file with the Testall.xml file with .fragment. Debug Option Print Stack Tracking to Standard Output. This option is used when you cannot determine what happened or because of a reason for test cases. ExecutetestCaseSeparateVmtask has an attribute called ClassPathRef or an Ant tag of ClassPath for setting classpaths for each executed virtual machine.

转载请注明原文地址:https://www.9cbs.com/read-6739.html

New Post(0)