6.3.5 Configuring an Agent with JBehave

The Agent Configuration pop-up inludes 3 blocks:

  1. General Information
  2. Test Scripts
  3. Execution

General Information

  • Agent name: Define the agent's name. It is also the displayed name of the agent in qTest
  • qTest project: It lists out all qTest projects which are accessible using the agent's credentials. Select one of the projects in your qTest application. An agent can work with only one qTest project
  • Automation framework: The frameworks whose plugins have been installed will be listed out. Select your desired framework
JBehave Agent - General Info

Test Scripts

  • Directory: Specify the home directory of your JBehave source code project
  • Story Root Directory: the configured directory where all JBehave stories

      IMPORTANT: The Story Root Directory must be a local folder on your automation host and match with what is configured in your source code, for example:

    JBehave Agent - Story Root Dir
  • Scripting libs: Provide the paths to your project's dependencies. You can input more than one paths, separated by a comma
  • Include: You can use ANT Style Pattern Matcher to define the patterns of files which will be scan for tests. Use comma as separators between the patterns. It is the required information so that the agent can scan your coding directory for stories and automatically create Test Cases in qTest

      HINT: ANT Style Pattern Matcher uses the following rules

    • ? matches one character
    • * matches zero or more characters
    • ** matches zero or more 'directories' in a path
  • Exclude: You can optionally define patterns to excludes files from the scanning
  • Scan jar files: If you stick on this checkbox, the agent will also scan files in jar files
JBehave Agent - Test Scripts

Execution

Currently, the Automation Agents support 3 modes to build and run your test projects. Based on your selected mode, you will need to provide different information.

Select one of the execution modes below:

Maven

The automation agents support using Maven to build and run your coding projects.

  • Executable home: Input the path to your Maven's home directory
  • POM file: Provide the path to your project's POM file

      IMPORTANT: It is the relative path under the home directory defined in Test Scripts section above

  • Goal: input the goal defined in your POM file above to deploy your project
  • Command arguments: Provide any additional arguments to execute the target
JBehave Agent - Execution - Maven
Field Value Description
Executable home D:\Tools\apache-ant-1.10.1 This is where my Maven's home directory is located
Goal integration-test The goal defined in the POM file to deploy my project
POM file pom.xml This file is located under the home directory defined in Test Script section

Ant

The automation agents support using Ant to build and run your coding projects.

  • Executable home: Input the path to your Ant's home directory
  • Target: Specify which Ant target will be executed. This is the name of the target which is defined in your build file
  • Build file: Provide the path to your Ant build file in which the above target is defined

      IMPORTANT: It is the relative path under the home directory defined in Test Scripts section above

  • Command arguments: Provide any additional arguments to execute the target
JBehave Agent - Execution - Ant
Field Value Description
Executable home D:\Tools\apache-ant-1.10.1 This is where my Ant's home directory is located
Target clean test
Build file build.xml This file is located under the home directory defined in Test Script section

Command

  • Executable home: Specify the path to the home directory of your program development environment. For example, if you are using JDK, input the folder where you have installed it
  • Command: the command to execute your scripts. In case you are using Java, input java. You are also able to provide a path to an executable file on your automation host
  • Command arguments: You will need to provide the target directory where all built output are located and any needed arguments

The agent will use the above information to generate a full command to execute your scripts

JBehave Agent - Execution - Command

  IMPORTANT:

  • If you are using other command than java, please add a system variable on the automation host for your Executable home directory

Configure qTest's Log Collector in your JBehave source code

You will need to add qTest's Log Collector, which is a Story Reporter, to your JBehave project. It collects your JBehave test results and sends over to our JBehave agent.

  1. Download qTest's Log Collector here. It is actually a jar file
  2. Add the downloaded jar file to your JBehave source code. There are various ways to configure Story Reporter in JBehave, the image below is just an example:
    JBehave Agent - Execution - LogCollector