Concordion extenstion that conditionally executes child tests.
Java HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
LICENSE.txt
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat

README.md

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">
  2. 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;
      }
  3. 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;
      }
    

Further info