RQM - Cucumber

IBM.com Jazz.net Documentation Cucumber
RQM - CMD Adapter

Contents

  1. Using
  2. Reporting
  3. Installation
  4. Other Resources
  5. Files

This pages shows the integration between Jazz/RQM and Cucumber.

Cucumber is a tool for running automated acceptance tests written in a behavior-driven development (BDD) style
So What? Why would an organization use Jazz/RQM to start Cucumber? Cucumber is a powerful test-execution engine. It does not MANAGE change in requirements, code or any other activity needed for software delivery. This integration leverage the power of Cucumber (and it's world) and the Jazz platform (and that world). Having this two you benefit from the combination of both worlds.

You could state it in a table (not all pro- and cons- are listed here).

RQM/CLM
  1. Transparancy
  2. Traceability
  3. Test Management
  4. Reporting
  5. Continuous Integration
Cucumber
  1. Clear Language - BDD
  2. Fast
  3. Continuous Integration
  1. Fixture development
  2. Traceability
  3. Code/Test Management
RPE
  1. Reporting
RQM/CLM+RPE+Cucumber
  1. Transparancy
  2. Traceability
  3. Code/Test Management
  4. Reporting
  5. Clear Language - BDD
  6. Continuous Integration

Make note that the Test Management and Reporting goes beyond Cucumber, it covers many test execution tools including manual execution.

As a testmanager once said to me "I use Executable Specifications(*1) to bring people together!" In combination wiht Rational you can bring more people together, and still keep control!
*1 - Or any other name you can give to this.

 

Using

When setup the using of the technology is very simple:

  1. Create Test Cases
  2. Place your cucumber feature 'text' in the Test Case Design section
  3. Assign the RQM-Testscript with the cucumber CMD-line to the Test Case
  4. Run it

Figure: The RQM Test Case with the feature script.

Figure: The RQM Test Case Results.

Figure: The RQM Test Case Cucumber log (34_Cucumber.html).

Reporting

Making use of the RQM/CLM environment one can create report using the RPE tool. This can reveal the fearture definitions in the Test Plan/Test Case listings. A simple example is shown here. More elaborated reporting can be found on Comprehensive test plan reporting with RPE and RRDG.

Output exampleTPCC.pdf
Template SourceTPCC.dta

Installation

The next two statements were true in the June 2013 timeframe. It cost me 1 day to figure that out.

  1. Don't use Ruby 64bits (there is a bug)
  2. Don't use Ruby 20 on Win7 for the moment (there is a bug)

Steps to install and configure:

  1. Installation of Ruby/Cucumber, check links at bottom of this page.
    1. Install Ruby (
      Bug: Win7&Ruby64 no good - use 32bits
      Bug: Ruby not 20!, preferred 193-p448)
    2. Install Ruby Additions and gems in line with this article
        gem install cucumber
        gem install rspec
        gem sources -a http://gems.github.com
        gem install mhennemeyer-matchy

        See: https://github.com/jm/matchy
  2. RQM Getting Started - To setup a CLM environement.
  3. Create adapter user cmduser, with adapter lics (Quality Manager Connector).
  4. Create a project e.g. "Proj BDD", make cmduser member of it, with appropriate role.
  5. Setup the Command Line Adapter
  6. Create the directory structure for the Cucumber sources, eg.
    C:/PRJ
    	features
    		step_definitions
    
    In the features directory a basic_feature is available.
    files/features.zip
  7. Create a test script, referencing the rqmcucumber.bat

    Figure: The RQM Testscript to Cucumber.

    Make sure the "include built-in variables" is selected.

    The built-in variables are needed to transfer the applicable Test Case ID to the RQMExtractor program.

Other Resources

Some more usefull links:

Files

The very basic Ruby Cucumber examples which are used can be found:

cucumber.bat

I use the following rqmcucumber.bat. Make note that the CMD Line does not have a Setup Java reference, the rqmcucumber.bat does.
That gives the option to have different Java versions in different CMD executions.

rem Prepare clean environment
rem
rem Set work directory
set WorkDir=C:\\PRJ\\RQM Extractor
rem Set common directory
set CommonDir=C:\\PRJ\\CMD
set FeatureFile=%qm_RQM_TESTCASE_WEBID%.feature
set LogFile=%qm_RQM_TESTCASE_WEBID%_logfile.txt
set CucumberResult=%qm_RQM_TESTCASE_WEBID%_Cucumber.html
cd %WorkDir%

if exist features goto continue
echo *** ERROR The features directory does not exists in %WorkDir% > %LogFile%
echo *** ERROR RQM Cucumber process aborted >> %LogFile%
set retvalue=999
goto end

:continue
rem Clean any previous generated files.
del /Q %FeatureFile%
del /Q %FeatureFile%.txt
del /Q %LogFile%
del /Q %CucumberResult%

echo Starting Cucumber %FeatureFile% > %LogFile%
echo Current date and time >> %LogFile%
date /T >> %LogFile%
time /T >> %LogFile%
echo Current Working directory >> %LogFile%
cd >> %LogFile%

rem Extract Test Case Design
rem Set Java
call %CommonDir%\setvars.cmd
echo Extracting Test Case %qm_RQM_TESTCASE_WEBID% >> %LogFile%
java -jar RQMExtractor.jar -id=%qm_RQM_TESTCASE_WEBID% >> %LogFile%

rem Run the Cucumber engine
rem
echo Executing Start: Cucumber %FeatureFile% --format html --out %CucumberResult% >> %LogFile%
call cucumber %FeatureFile% --format html --out %CucumberResult% 2>> %LogFile%
set retvalue=%errorlevel%
echo Executing End: Cucumber >> %LogFile%

:end
rem Set Attachment Files and Exit
rem
rem For easy access in the browser we add a .txt extension to the feature file
ren %FeatureFile% %FeatureFile%.txt
echo %FeatureFile%=%WorkDir%\\%FeatureFile%.txt >> %qm_AttachmentsFile%
echo %LogFile%=%WorkDir%\\%LogFile% >> %qm_AttachmentsFile%
echo %CucumberResult%=%WorkDir%\\%CucumberResult% >> %qm_AttachmentsFile%
rem Do not remove files. These are processed after closure of script!

exit %retvalue%

Do not use the " in the %qm_AttachmentsFile% lines as stated in the documentation.

Make note that you can expand this script using --tags and --name arguments in the test-script!

setvars.cmd

Warning The Java definition must be added to the standard CMD Line Adapter starter script.

Setvars just defines the java location.

set JAVA_HOME=C:\Program Files (x86)\Java\jre7
set PATH=%PATH%;%JAVA_HOME%\bin;