concordion-executeonlyif-extension

An extension to Concordion that adds a `executeOnlyIf` command that conditionally executes child commands

License

License

GroupId

GroupId

org.concordion
ArtifactId

ArtifactId

concordion-executeonlyif-extension
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

concordion-executeonlyif-extension
An extension to Concordion that adds a `executeOnlyIf` command that conditionally executes child commands
Project URL

Project URL

https://github.com/concordion/concordion-executeonlyif-extension
Source Code Management

Source Code Management

https://github.com/concordion/concordion-executeonlyif-extension.git

Download concordion-executeonlyif-extension

How to add to project

<!-- https://jarcasting.com/artifacts/org.concordion/concordion-executeonlyif-extension/ -->
<dependency>
    <groupId>org.concordion</groupId>
    <artifactId>concordion-executeonlyif-extension</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.concordion/concordion-executeonlyif-extension/
implementation 'org.concordion:concordion-executeonlyif-extension:0.3.1'
// https://jarcasting.com/artifacts/org.concordion/concordion-executeonlyif-extension/
implementation ("org.concordion:concordion-executeonlyif-extension:0.3.1")
'org.concordion:concordion-executeonlyif-extension:jar:0.3.1'
<dependency org="org.concordion" name="concordion-executeonlyif-extension" rev="0.3.1">
  <artifact name="concordion-executeonlyif-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.concordion', module='concordion-executeonlyif-extension', version='0.3.1')
)
libraryDependencies += "org.concordion" % "concordion-executeonlyif-extension" % "0.3.1"
[org.concordion/concordion-executeonlyif-extension "0.3.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.concordion : concordion jar 2.2.0

Project Modules

There are no modules declared in this project.

Build Status

This Concordion extension provides the capability to conditionally execute child tests.

The demo project demonstrates this extension.

Introduction

Determines whether child test should be executed or not. Useful if parts of a specification cannot be executed in all environments a test suite may run against.

Usage

Requires:

  1. xmlns:ext="urn:concordion-extensions:2010" added to the html so concordion can call the extension from the specification
<html xmlns:c="http://www.concordion.org/2007/concordion" xmlns:ext="urn:concordion-extensions:2010">
  1. Place any concordion commands that you wish to conditionally execute as children of the executeOnlyIf command
  • Specification
  <div ext:executeOnlyIf="shouldNotExecute()">
  	<p>When I google "<span c:execute="searchFor(#TEXT)">6 * 9</span>" the answer should be "<span c:assertEquals="getCalculatorResult()">42</span>".</p>
  </div>
  • Fixture
  public boolean shouldNotExecute() {
  	return false;
  }
  1. Optionally you can use the Embed extension to give a reason you haven't executed part of the spec
  • Specification
<span ext:embed="getNotExecuteReason()"></span>
  • Fixture
public String getNotExecuteReason() {
 	String msg = "";

 	msg += "<p style=\"background-color: #FFCC99; padding: 8px; border: 1px solid #FF6600; margin: 10px 0px 10px 0px; font-weight: bold\">";
 	msg += "The following step has been skipped to prove we can.";
 	msg += "</p>";

 	return msg;
 }

Dependencies

Note that this extension is impacted by breaking API changes in Concordion 2.2.0. You will need to ensure the correct version is in use:

concordion version concordion-executeonlyif-extension version
< 2.2.0 <= 0.2.1
>= 2.2.0 >= 0.3.0

Further info

org.concordion

Versions

Version
0.3.1
0.3.0
0.2.1
0.2.0
0.1.0