Confluence Macros
Children Macro
Description: This macro can execute a batch of documents resulting from a page hierarchy.
Wiki 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.) - sort Default --> 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). - reverse Default --> false
You can reverse the sorting sequence. - openInSameWindow Default --> false
You can control whether or not the link to the specification will open in the same window.
EXAMPLE
{greenpepper-children:spaceKey=BNKT|pageTitle=Example - Banking Account System|expanded=true}
Example macro
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 background 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
Example |
---|
{greenpepper-group:title=My Group 1|group=Group 1} |
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
{greenpepper-historic:pageTitle=Cell Decoration| spaceKey=GREENPEPPER| sut=GreenPepperOpen - Core Java| maxresult=20| width=700| height=500| border=true| showignored=true}
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.
Example using the GreenPepper Maven Plugin :
<repositories> <repository> <type>com.greenpepper.runner.repository.GreenPepperRepository</type> <root> <![CDATA[http://.../confluence/rpc/xmlrpc?handler=greenpepper1&sut=Java&includeStyle=false&postExecutionResult=true]]> </root> <name>greenpepper</name> <suites> <suite>GreenPepper Confluence-GREENPEPPER</suite> </suites> </repository> </repositories>
Import Macro
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 | ... }
{greenpepper-import:my.class.to.import|some.other.class.to.import}
This will generate the following hidden table:
import |
my.class.to.import |
some.other.class.to.import |
Include Macro
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}
Mandatory parameteres:
- 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 --> falseNEW in 2.4
You can ask for the included page to be expanded on page load.
{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.
- If you omit to close your info section, the end of the document will be considered as the end of it
Wiki Markup | Result |
---|---|
{greenpepper-info} A sentence {info}some info{info} {greenpepper-info} | A sentence some info |
Wiki Markup | Result |
---|---|
{greenpepper-info} * My bullet list * Some information {greenpepper-info} |
|
Labels macro
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.
{greenpepper-labels} {greenpepper-labels:spaceKey=GREENPEPPER} {greenpepper-labels:spaceKey=GREENPEPPER|labels=resolution & seed|expanded=true}
Wiki macro
Description: This macro will allow you to write your specification in wiki format.
Syntax: {greenpepper-wiki}
{greenpepper-wiki} ||Table|| title|| |bigger | number | of | columns | {greenpepper-wiki}
Table | title | ||
---|---|---|---|
bigger | number | of | columns |