Testify User Guide

This page contains details on using the Testify. For information on the design of Testify, go to the Testify Design Guide.

Download

Testify Source Code: https://github.com/testify

Testify Distribution Source Code: https://github.com/testify/testify.git

Latest Build (Zip File): Coming Soon

Stable Version: Coming Soon

 

Contents

Unzip the file (or build and unzip if working from source code). The folder will contain the following:

Testify
+ Testify
  + bin				# Testify Execution Scripts
    - testify
    - testify.bat
  + bundles			# Deploy Directory for Testify Service Bundles
    + actions
	+ assertions
	+ processors
  + etc  			# Testify Configuration Files
    - log4j.xml
  + lib				# Testify Libraries
    - testify-core.jar
  + README.md
On this page:

Related Pages:

How it works

Start by creating some tests. If you wish to run multiple tests at the same time, place all the tests into a single parent directory. You should then set the Testify test directory to this parent directory.

Test bundles can also include configuration files (files that end with .properties). The configuration files are used for information that the user would want to change in the test file without having to adjust the actual test file. Multiple configuration files can be used by pointing Testify at a directory. The system will gather properties from all the files contained in the directory.

For Windows

  1. From the command line, change the directory to the bin folder in Testify.
  2. Call the execution script in the following format: testifyRunner.bat -t <Test Files Directory> -r <Result Files Directory> -c <Configuration Path> -l <log level (info, debug, etc)>
    (e.g testifyRunner.bat -t "C:\Users\jsmith\Desktop\TestFiles" -r "C:\Users\jsmith\Desktop\ResultData" -c "C:\Users\jsmith\Desktop\configuration.properties" -l "debug")

    All parameters are optional. If the test directory is not included, it will default to your current directory. If the result directory is not included, the results and logs will be placed in a testify folder in your current directory. If the configuration path is not included, the system will search for configuration files in the test directory. If the log level is not included, it will default to INFO.

  3. To see usage details type testifyRunner.bat -h or testifyRunner.bat --help

For Linux

  1. From the command line, change the directory to the bin folder in testify.
  2. Call the execution script in the following format: testifyRunner -t <Test Files Directory> -r <Result Files Directory> -c <Configuration Path> -l <log level (info, debug, etc)>
    (e.g testifyRunner -t "/Users/jsmith/Desktop/TestFiles" -r "/Users/jsmith/Desktop/ResultData" -c "/Users/jsmith/Desktop/configuration.properties" -l "debug")

    All parameters are optional. If the test directory is not included, it will default to your current directory. If the result directory is not included, the results and logs will be placed in a testify folder in your current directory. If the configuration path is not included, the system will search for configuration files in the test directory. If the log level is not included, it will default to INFO.

  3. To see usage details type testifyRunner -h or testifyRunner --help

For Mac

  1. Install coreutils from Homebrew: brew install coreutils
  2. Follow instructions for Linux.

 

Data File Formats and Examples

Test Files

Each test data file must be located in the test directory given in the execution command. The files can be organized within any amount of sub-directories.

A test file is split into five main elements: type, endpoint, test, assertion, and action phases. The action phase sections are optional fields for the test engine. Additional fields may be set to optional in the test file depending on the type of test parser being used. The test file structure will be dependent on the test Parser in the Testify "bundles" folder. Consult the test parser wiki pages for more information. The specific test parser pages include example requests as well. In a test file, a variable can be defined using the following syntax: ${<PropName>} (ex ${SITE_IP}). The variable <PropName> symbolizes a property which will be set using a configuration file value. Below are details on each of the five main test file elements.

Processor Type

The processor type signifies the processor being used for this test. The type name must match (not case sensitive) to a processor class name in the "bundles" folder.

Endpoint

This is the full endpoint location.

Test

This includes all the test related elements (besides the endpoint) that will be passed to the processor. Different processors may require specific child elements within this element to identify specific pieces like operation and headers. Consult the specific processor wiki page for more information.

Assertions

This contains all the assertions (separated by line breaks) that will be run against the test response. The assertion names must match (not case sensitive) to an assertion class name in the "bundles" folder. If assertion information must be passed at well, it must be separated from the assertion class name by "::".

Action Phases

An action is grouped under a specific action phase depending on when the action needs to be run. These phases are:

    1. Pre Test Setter
    2. Pre Test Processor
    3. Post Test Processor

These sections contain all the actions (separated by line breaks) that will be performed by Testify. An action placed in the preTestSetterAction block will occur right before the configuration variables are set for a test. An action placed in the preTestProcessorAction block will occur right before the processor runs for a test. An action placed in the postTestProcessorAction block will occur right after the processor runs for a test.

The action names must match (not case sensitive) to an action class name in the "bundles" folder. If action information must be passed at well, it must be separated from the action class name by "::".

 

Test Results

Test results formats will vary depending on the installed writer services. Consult the writer wiki pages for more information.

 

Configuration Files

A configuration file (extension -> .properties) contains the values for the different variables in the test files. It also provides configuration values for Testify service bundles if needed. While configuration files are optional, it is important to check that the Testify services used in a test file do not require any configuration values before removing the configuration file. If multiple configuration files are provided, Testify will attempt to parse all files and combine the properties. The configuration file structure will be dependent on the Properties Parser in the Testify "bundles" folder. Consult the properties parser wiki pages for more information. The specific properties parser pages also include example configuration files.

Testify Services

Test file design and result format are dependent on the Testify services that are installed. You can view the full list of installed bundles by going to the bundles folder in the Testify root directory. Details on each Testify supported service can be found by clicking on the category of service listed below. Each category page provides links to every supported Testify service. To learn how to create a new service bundle, go to the Testify Design Page.