Confluence is an enterprise wiki that makes it easy to create and share documents.
It also offers a powerful Plugin architecture that allows us to write plugins that change the way things work or add entirely new functionalities.
So this led us to the conclusion that Confluence was a good choice for a Test document repository.
1. Installation
Do not use the Plugin Manager In most cases, the plugin manager have class loading issue that will make GreenPepper to not work properly. Instead of using the plugin manager, copy the confluence-greenpepper-plugin-xx-complete.jar to directory WEB-INF/lib of your Confluence.
If you previously installed GreenPepper using the plugin manager, uninstall it before doing the file copy.
Note : You will need to shutdown and restart Confluence between the file copy.
The installation of GreenPepper is no different from any other Confluence plugin installation.
Simply upload your confluence-greenpepper-plugin-xx-complete.jar via your Plugin Manager
Confluence - Administration - Plugins.
Upgrade
The upgrade of GreenPepper is no different from any other Confluence plugin upgrade.
1. Uninstall your confluence-greenpepper-plugin-old.jar via your Plugin Manager
2. Re-Upload your confluence-greenpepper-plugin-new.jar via your Plugin Manager
Uninstall
If you really want to uninstall GreenPepper, simply uninstall your confluence-greenpepper-plugin-xxx.jar via your Plugin Manager
2. Configure GreenPepper Confluence plugin
GreenPepper plugin setup
Confluence Server Base Url
If you expose the Confluence server to the oustide world (other than localhost), make sure the Server Base Url of Confluence found is the external URL of the server.
This property is found under the General Configuration of the Administration of Confluence.
Note : If you change this URL when existing Spaces have been registered as GreenPepper project, you will need to refresh each project by clicking the Edit link then the Save link on the Space Registration form of the Space Administration or on the Project Management tab of the configuration of the GreenPepper plugin.
Here are the panes that will be accessible from your GreenPepper Toolbox plugin Configuration.
Database setup: GreenPepper has its own database to store multiple data such as executions results, references and so on.
You will have two options:
Quick install: a HSQL will be created locally. This setup is not suggested for a production environment, it was put inplace for quick trial setup purposes.
Custom install: This will allow you to setup GreenPepper to use an external DBMS via a JNDI name.
Licence manager: From where you will be able upload your licence and see your licence details
Runner: Your runners configuration pane.
You will be able to add/remove/update your runners (GreenPepper Open; Test engine)
Java Runner
The most recent Java runner will be available by default. At each start of Confluence, we make sure there is a Java Runner matching the GreenPepper plugin version.
.Net Runner
Default command line :
.../GreenPepper.exe ${inputPath} ${outputPath} -a ${classpaths} -r ${repository} -f ${fixtureFactory} --xml
All required assemblies are found in the GreenPepper Open .Net binaries. Note : You need to specify the full path for the Assembly files and the GreenPepper.exe file.
Note : You need to specify the full path for the classpath files.
More info Maven Runner.
Project Management: Your Space registration to GreenPepper.
From this pane you will be able to:
Associate your Confluence spaces to GreenPepper projects.
Set your GreenPepper credentials to be able to run the tests if the space is secured.
Add/Remove/Edit your System under tests for a specific GreenPepper project.
Confluence Space setup
I. Using GreenPepper theme
The Theme is a plug-and-play plugin giving access to all GreenPepper functionalities once it has been set.
You can set the GreenPepper Theme from the Space admin panel or Global admin panel.
The drawback of using the Theme is that you will not be able to customize your layouts (e.g. page, space, template) or, if already customized, your customization will be ignored.
Two themes are available.
The GreenPepper Colour Theme provides the GreenPepper colour palette.
The GreenPepper Theme provides the GreenPepper colour palette and overrides the default ( or custom) page layout.The page layout automatically includes:
the GreenPepper header (Execute button and reference list at the top of the page)
the GreenPepper body (allows GreenPepper to print out test results)
Caution with the GreenPepper theme We cannot guaranty the behavior of the theme between Confluence upgrades. We do not have control on the default page layout of Confluence. This one may vary from a version to another. We advise you to manually configure your page layout. SeeConfluence Plugin Setup.
Confluence 2.8 and up If you are not using the GreenPepper Plugin v2.2+, the theme should be configured manually (see below)
II. Manual configuration
First, you need to add the following to yourPage Layout:
Confluence version 2.8 and up
You need to replace the following in your Page Layout:
Copy#parse($greenPepper.header) at the designated place in the vm. (See bellow)
## VIEW
#if ($mode == "view")
#set ($labelable = $page)
#permitSearchEngines()
<table width="100%" style="margin-bottom: 5px" cellspacing="0"><tr><td align="left" valign="top"><span class="smalltext">
#editReport()
#parse ("/labels/labels-include.vm")
</span></td>
Test
<td align="right" valign="top">
#if(\!$action.anonymousUser && \!$action.isPrintableVersion())
<div style="padding: 5px; width: 40px; border: 1px solid #cccccc; margin: 0px">...
#end
</td></tr><\!-\\\\\\\- PLACE THIS HERE \-->
#parse($greenPepper.header)
<\!-\\\\\\\- PLACE THIS HERE \--></table>
#if ($helper.isHistoricalVersion())
Then, you need to replace the following in your Page Layout:
<div class="wiki-content">
$body
</div>
By
#parse($greenPepper.body)
Register a Space to use GreenPepper
I. Goal of the registration
The goal of the repository registration is to regroup available specifications and requirements repositories under a single common GreenPepper project so that, when linking specifications to requirements, we can concentrate on related repositories. Here is an overview of the domain:
II. How to register a repository
To register your repository to GreenPepper server, follow these steps:
Click the Space Registration tab, then click Register.
Select the GreenPepper project to which you want to associate your repository to.
Enter the alias to identify your JIRA project Or Confluence Space (i.e. MYJIRA-PROJECTNAME).
In order to restrict access, enter the username and password of a Confluence and/or JIRA user. This restriction will be applied to Confluence, JIRA and any other plugins accessing or executing the executable specifications.
From the list, select a system under test, if any available.
Click Save.
N.B.: You may add a new GreenPepper project by selecting New Project from the GreenPepper Project Name dropdown list.
3. Use
Make a page executable
As you might have already noticed, Pages in registered spaces have a checkbox labeled GreenPepperized. Checking it will automatically register the document in the server. The default System Under Test will be automatically associated to your newly executable page.
I. Configurating your executable page
You might want to associate your page to other Systems Under Test. To do so, click the Configuration button.
You can now remove or add System Under Test associations. This is important if you want the greenpepper-labels or greenpepper-children macro to select your page.
II. Executing your page
You can now Execute your page. Next to the Execute button you will find which System Under Test will be involved. If you need to select another System Under Test, click the Edit button and select the desired System Under Test. The dropdown list only contains the Systems Under Test configured in step I.
III Getting versioning information
You will see in the right-hand side of your GreenPepper header the versioning information of your page.
There is two possible states:
Implemented indicates that the specification has committed source code that verifies all its examples.
Working indicates that the document has been updated since the last Implemented state.
Both states are executable.
The most recent version is theImplementedversion
The Implemented version
The most recent version differs from the Implemented version
Clicking on Set as Implemented will set the current version of the page as the Implemented version.
IV Reverting to a previous version
An easy revert feature is provided. Reverting will set the previous implemented version as the actual implemented version.
GreenPepper Confluence Macros
Children Macro
Description: This macro can execute a batch of documents resulting from a page hierarchy. Syntax:{greenpepper-children} Optional parameters:
all:Default --> false
If set to true, the complete hierarchy of the parent page will be included in the execution list.
Otherwise only the first-level children will be included.
spaceKey:Default --> Macro's residing space
You can specify a specific space for your parent page.
pageTitle:Default --> Macro's residing page
You can specify a specific title for the parent page.
title:Default --> blank
You can specify your own title.
expanded:Default --> false
You can ask for the list to be expanded on page load.
suts:Default --> All
You can narrow the list to specific Systems Under Test (1 or more; if more than one they must be separated by a comma).
group:Default --> PAGE
You can regroup all your macros in a page under a group name. (See Group Macro.)
sortDefault --> Hierarchical sort
You can configure the way children are sorted. Choose Creation to sort by content creation dates, Title to sort alphabetically by titles and Modified to sort by modification dates (last date first).
reverseDefault --> false
You can reverse the sorting sequence.
openInSameWindowDefault --> falseNEW in v2.1
You can control whether or not the link to the specification will open in the same window.
Description: This macro allows you in the lazy mode to annotate tables and/or bullet lists that you do want to be processed as executable specifications within your executable documents. Syntax:{greenpepper-example}your example table(s)/list(s){greenpepper-example} Optional parameters:
title:Default --> blank
You can specify your own title.
bgcolor:Default --> NONE
You can change the backgound color of the Info section (ex.: red, blue, grey, lightgrey, green and hexadecimal colors).
If you omit to close your example section, the end of the document will be considered as the end of it
Group Macro
Description: This macro regroups all GreenPepper macros labeled under the same group under a single execution button. Syntax:{greenpepper-group} Optional parameters:
group:Default -> PAGE
The group name
title:Default -> blank
EXAMPLE
{greenpepper-group:title=My Group 1|group=Group 1}
Description: This macro retrieves JIRA's version hierarchy for the given version name or link type of a project. Syntax:{greenpepper-hirearchy} Mandatoryparameters:
gpUrl: The URL of your server (i.e. http ://mydomain:8080/confluence).
gpService: The handler (i.e. *greenpepper1).
jiraUid: The Repository UID of your JIRA project. (See [Repository registration].)
versionName: The version name of your JIRA project for which you want to view the hierarcy.
linkName: The JIRA link type name to draw the hierarchy on.
Broken (It should be working in the next release.)
Begin Info
MACRO-{greenpepper-hierarchy}
This Space is not registered in GreenPepper Server.
End Info
Historic Macro
Description: This macro creates a Chart image of the latest historic data of a page execution. The image created provide clickable area to display the specific execution result. Syntax:{greenpepper-historic}
Optional parameters:
pageTitle:Default --> Macro's residing page
The page title you want to show historic.
spaceKey:Default --> Macro's residing space
You can specify a specific space for your page.
sut:Default --> selected System Under Test of the page
The System Under Test name of the page
maxresult:Default --> 30
The maximum number of the latest historic data entry to show
width:Default --> 500
The width of the chart in pixels
height:Default --> 500
The height of the chart in pixels
border:Default --> false
Indicate to use a border for the chart image
showignored:Default --> false
Indicate to show the count of ignored tests
children:Default --> false
This parameter present a summary Chart containing an aggregation of execution result. If set to first, aggregation will be done for all first level children of the specified page. If set to all, the aggregation will be done with the complete hierarchy of the specified page.
labels:Default --> none
Labels to base the search when doing the aggregation of execution result of pages
Using the , as the label separation is equivalent to an OR query. So label1,label2 will retrieve all pages labeled by label1 OR/AND label2
Using the & as the label separation is equivalent to an AND query. So label1&label2 will retrieve all pages labeled by label1 AND label2
Saving historic data from a local execution or a continuous build server
When executing specification locally or through a continuous build server, result are not saved automatically since they are deconnected from the Confluence plugin (only the specification page is retrieved).
Starting from version 2.2, we can post back the execution result using the repository implementation com.greenpepper.runner.repository.GreenPepperRepository (Java) or Greenpepper.Repositories.GreenPepperRepository (.Net). A new parameter must be added to the URL : postExecutionResult=true.
Description: This macro allows you to import classes into your executable document without polluting it with undesirable and unmeaningful user tables. Syntax:{greenpepper-import: my.class.to.import | some.other.class.to.import | ... }
Description: This macro allows you to include pages content into Executable document allowing for example, to define a setup and a tear down page and include it in executable pages avoiding duplication. Syntax: {greenpepper-include} Mandatoryparameteres:
pageTitle: The page title you want to include
Optional parameteres:
spaceKey:Default --> Macro's residing space
You can specify a specific space for your included page.
title:Default --> Macro's residing pageTitle
expanded:Default --> false NEW in 2.4
You can ask for the included page to be expanded on page load.
EXAMPLE
{greenpepper-include:pageTitle=My Setup}
Info Macro
Description: This macro allows you to create tables and/or bullet lists that you do not want to be processed as executable specifications within your executable documents. Syntax:{greenpepper-info}your body{greenpepper-info} Optional parameters:
title:Default --> blank
You can specify your own title.
bgcolor:Default --> NONE
You can change the backgound color of the Info section (ex.: red, blue, grey, lightgrey, green and hexadecimal colors).
This macro also allows you to insert into your executable document, other macros that generate tables or bullet lists.
For more information on the Info Tag, please refer to Info Tag example.
If you omit to close your info section, the end of the document will be considered as the end of it
EXAMPLES
Wiki Markup
Result
{greenpepper-info}
* My bullet list
* Some information
{greenpepper-info}
Description: This macro can execute a batch of documents resulting from a label search. Syntax:{greenpepper-labels} Optional parameters:
spaceKey:Default --> None
You can narrow the label search to a specific space.
If none is specified, the available GreenPepperized spaces will be in a select list.
labels:Default --> None
You can pre-enter the labels to base the search on.
Using the , as the label separation is equivalent to an OR query. Therefore, label1,label2 will retrieve all pages labeled by label1 OR label2.
Using the & as the label separation is equivalent to an AND query. Therefore, label1&label2 will retrieve all pages labeled by label1 AND label2.
title:Default --> blank
You can specify your own title.
expanded:Default --> false
You can ask for the list to be expanded on page load.
suts:Default --> All
You can narrow the list to specific Systems Under Test (1 or more; if more than one they must be separated by a comma).
group:Default --> PAGE
You can regroup all your macros in a page under a group name. (See Group Macro.)
sortDefault --> NONE
You can configure the way children are sorted. Choose Creation to sort by content creation dates, Title to sort alphabetically by titles and Modified to sort by modification dates (last date first).
reverseDefault --> false
You can reverse the sorting sequence.
openInSameWindowDefault --> falseNEW in v2.1
You can control whether or not the link to the specification will open in the same window.
Description: This macro retrieves JIRA references for a specific project filtered by the specified version name. Syntax:{greenpepper-manage} Mandatoryparameters:
gpUrl: The URL of your server (i.e. http ://mydomain:8080/confluence).
gpService: The handler (i.e. *greenpepper1).
jiraUid: The repository UID of your JIRA project. (See [Repository registration].)
versionName: The version name of the JIRA project you want to view. (ALL will view all versions.)
Note: Some functionalities are blocked such as the possibility to add references. The user that we used has restricted permissions to prevent undesired handling.
4. Advanced
GreenPepper logs
Activating the GreenPepper logs is helpful for the GreenPepper support team.
To activate the GreenPepper logs, browse to the Logging and Profiling menu under the Confluence Administration screens. Under the Add New Entry, specify com.greenpepper for the Class/Package Name, select the ALL (or DEBUG) level and then click the Add Entry button.
For older version of Confluence
To activate the GreenPepper logs, you need to add this line
log4j.category.com.greenpepper=TRACE
to the file WEB-INF/classes/log4j.properties under the Confluence webapp directory. You will need to restart Confluence.
Don't forget to de-activate the GreenPepper logs when no more needed
Maven Runner
These are the steps needed to configure the Maven runner.
Before you begin, you must verify the following:
Configuring a System Under Test can be tedious if you are having a lot of library dependencies. The Maven Runner allow you to use your existing pom.xml to resolve dependencies needed for the execution of specifications. Only the <dependencies> element of the pom.xml is read. Artifacts found will be resolved and added to the classpath of the runner. The artifact of the project itself will also be part of the classpath.
${classpaths} will be replaced by the Runner, SUT and Fixtures classpaths -(Mandatory for GP)
${mainClass} will be replaced by the Runner specified Main Class -(Mandatory for GP)
${inputPath} will be replaced by an input path -(Mandatory for GP)
${outputPath} will be replaced by an output path -(Mandatory for GP)
${locale} will be replaced by the user locale -Default: English (java only)
${repository} will be replace by the repository of the Specification resolver class -Default: FileSystemRepository
${fixtureFactory} will be replaced by the SUT Fixture Factory Class;Fixture Factory Args -Default: CoreFixtureFactory
${projectDependencyDescriptor} will be replaced by the project dependency descriptor file location-(Mandatory for the Maven runner) Example of a command line:
java -mx252m -cp ${classpaths} ${mainClass} ${inputPath} ${outputPath} -l ${locale} -r ${repository} -f ${fixtureFactory} --xml --pdd ${projectDependencyDescriptor}
The main class : com.greenpepper.maven.runner.Main -(Mandatory, main Maven runner class)
The Server name and port (if you are using the Remote agent)
Click Save
Enter the location of your Runner library and its dependencies.
GreenPepper Maven Runner library
greenpepper-maven-runner-x.x-complete.jar
Maven libraries
maven-2.x.x-uber.jar from the lib directory of your Maven home
classworlds-1.1.jar from the boot directory of your Maven home
System Under Test Configuration
Make sure your Confluence Space is registered as a GreenPepper Project (see)
From the Space Registration Panel, please follow these steps.
Click on Add a new System Under Test
Enter the name of your System Under Test (Mandatory)
Select your Maven runner (Mandatory)
Enter the Fixture factory to use (optional)
Enter the Fixture arguments (optional)
Enter the Project Dependency Descriptor (Mandatory)
Since we are using Maven, there is 2 possibilities :
You may need to add required repositories to the settings.xml of Maven (or routing all repositories using the mirrors) using the coordinates.
Click Save
Maven Plugin Fixture Artifact Dependency
By default, the Maven Runner will detect if the pom.xml is using the Maven Plugin to create fixture artifact. If so, the fixture artifact will be automatically added to the list of dependencies.
However, if you want to use a fixture artifact from another project, you will need to add the <dependency> of that project with <classifier>fixtures</classifier>.
NEW in 2.7.1/2.8.1/2.9 scopes
You can now specify scope on the command line (by default, runtime and compile are always use) :
--scope provided
Remote Agent
The remote agent is a small server that can be used to execute specifications from a GreenPepper Server to another machine.
This Agent is an answer to many purposes like this examples :
Your GreenPepper server is installed on a unix machine and you need to execute .Net specifications on a windows machine.
You do not want to execute your specifications directly on your GreenPepper Server.
Requirements
GreenPepper Remote Agent installation
The remote agent is a simple executable java application that can be found here.
Copy the remote agent Jar file on the machine where your GreenPepper Server will sends its remotes executions.
To launch the remote agent, just double-click on the Jar file or by command line.
Command line to start the remote agent with default settings :
By default, the Remote Agent is listening on port 56000
Secured mode
The communication between your GreenPepper server and your agent can be secured with SSL.
Requirements
1. On Remote Agent
Your Remote Agent must be version 1.3 or higher
You must have a KeyStore properly configured see Configuring my Agent keystore
2. On GreenPepper Server
Your GreenPepper Server must be version 1.3 or higher
You must have the agent certificate stored in your java cacerts file see Importing the Agent certificate
Enabling Secured Mode
On the remote agent
To enable Secured mode start the remote agent with this command line :
java -jar greenpepper-remote-agent-x.x-complete.jar -secured -keystore <path to your keystore file>
On GreenPepper Server
In Confluence or XWiki, get in GreenPepper Server Configuration, then Select the remote runner to be secured and just check the box "Secured Mode".
Configuration File
Starting with version 2.1, the remote agent can use a property file to specify parameters (instead of the command line parameters). By default, the remote agent will look for a property file remoteagent.properties in the current directory. You can also use the command line parameter -config [path of the configuration file] to override the default property file.
Command line parameter
Configuration file entry
Default Value
-port
greenpepper.remoteagent.port
56000
-secured
greenpepper.remoteagent.secured=[true or false]
false
-keystore
greenpepper.remoteagent.keystore.file=[path of the keystore file]
* Mandatory if secured=true
greenpepper.remoteagent.keystore.password=[the password of the keystore file]
* Mandatory if secured=true and the keystore require a password
The property greenpepper.remoteagent.keystore.password replace the command line input of the keystore password at remote agent startup.
Using SSL
HTTPS
You would need to setup your Web Container to server HTTPS requests.
When keytool will ask you to enter your First and Last name, you have to enter the network machine name (ex: myserver) or the domain name of your server (ex: www.myserver.com) where resides the your web container.
Adding SSL support for Tomcat with the test certificate
Uncomments the definition of the SSL HTTP/1.0 Connector and specify attribute keystoreFile and keystorePass :
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="c:\greenpepper.keystore"
keystorePass="[WIP:the password of the keystore]" />
Start tomcat and using your internet browser, navigate to https://www.myserver.com:8443. You should be alerted to accept the certificate.
If you are using Firefox, you should see :
Hint : Select Accept this certificate permanently and click ok
If you are using Internet Explorer, you should see :
Hint : Click on Continue to this web site (not recommended)
Hint : Click on Certificate Error
Hint : Click on View Certificates
Hint : Click on Install Certificate , follow the instructions and restart Internet Explorer when done
Runner Configuration
Java Runner
You would need to tell your runner the location of the trustStore and the password on the command line (Optional if you imported the certificate in the JVM)
java -Djavax.net.ssl.trustStore=c:\greenpepper.cacerts -Djavax.net.ssl.trustStorePassword=[WIP:the password of the trustStore] -mx252m ...
From Confluence / Jira, make sure the base url is using https on port 8443 (goto Adminstration / General Configuration).
For each Confluence Space's Registration repository, click edit and update (without changing anything, the repository url will be updated using the actual base url)
For each Jira Project Registration repository, click edit and update
Using the Eclipse Plugin
If you are using the Eclipse Plugin, you would need to perform the following steps :
Add information about the truststore and password to the eclipse.ini(Optional if you imported the certificate in the JVM)
-Djavax.net.ssl.trustStore=c:\greenpepper.cacerts
-Djavax.net.ssl.trustStorePassword=[WIP:the password of the trustStore]
I keep having an error message when I try to create a new test case.
To be able to create a test case (a link between a requirement and a test document), you need a registered TEST repository such as a space from Confluence and a registered Requirement repository (such as a JIRA project) on the same project. Make sure a system under test has been defined for your project .
I do not see the GreenPepperized checkbox
I click on the GreenPepperized checkbox but nothing happens.
This is because GreenPepper uses some AJAX calls and they cannot occur accross multiple domains. Make sure that the domain you are using in the url of your browser matches the domain in the Server Base Url configured in Confluence's General Configuration. A common case of this is when GreenPepper is installed on a local machine. We suggest you use the name of your local machine (http: //mymachine:8080/accept) instead of localhost in the URL (e.g. http: //localhost:8080/accept).
DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.