· Mar 1, 2018

Cucumber / Gherkin integration

Are there any BDD testing automation implementations within Mumps/Cache Objects already in existence?

We are looking at using Cucumber for our Java regression test automation and would like to use similar feature file testing with the Cache code.

Looking to use something existing before building it.


Discussion (5)1
Log in or sign up to continue

Thanks Dmitry, We use and enhanced version of %UnitTest already on our unit tests and behind the scenes functional tests.

We are looking for a way to run feature files directly in Cache.  Ultimately these files will get broken down into test cases and tests, but that breakdown, running and reporting is what needs to be built if there isn't already something out there.

Ex feature file:

Feature: Login Action

Scenario: Successful Login with Valid Credentials
    Given User is on Home Page
    When User Navigate to LogIn Page
    And User enters UserName and Password
    Then Message displayed Login Successfully

Scenario: Successful LogOut
    When User LogOut from the Application
    Then Message displayed LogOut Successfully


Hi Karl,

By 'application' in the example above, do you mean a web application hosted on a Cache server/written in COS?

Yes, it is very possible to do (and in fact we are working on transitioning our internal UI testing for IRIS and Healthshare to use a Cucumber BDD framework with Selenium Webdriver and Allure reporting - with scenarios as in the example below).

Would you like more details about the setup?



Feature: License Key
  As a system administrator
  In order to test the Activate License Key functionality
  I want to import valid and invalid license key files and confirm response messaging

    Given  I set up context options

  Scenario: Activate valid license key
    Given I log in to the application and navigate to the License Key page
    When I import and activate the license key /tmp/ISC.cache.key
    Then The file contents should be displayed in the Activate Key modal right hand panel
    And  The confirmation dialog should contain the expected text
    And  No error should appear in the response note area

  Scenario Outline: Test invalid license key files <filepath>
    When I import and try to activate the license key <filepath>
    And the response note area should contain <errorText>

      | filepath               | errorText                                 |
      | /tmp/expired_cache.key | ERROR #8604:License key has expired.      |
      | /tmp/invalid_cache.key | ERROR #8605:License key is invalid.       |
      | /tmp/empty_cache.key   | ERROR #8603:Not a valid license key file. |
      | /tmp/cache1.key        | File does not exist                       |

Hi Talita and Karl,

Sorry about the late response. Reading your question again, the answer should be that there are currently no native Cucumber bindings for Object script.

The above example is using Cucumber's javascript bindings to work with WebdriverIO, a node.js implementation of Selenium WebDriver, to test the Management Portal UI, so it not quite what you're looking for.

However it is possible, to some extent, to test Object script code using Cucumber's javascript bindings to invoke object script commands within step definitions using the ISCNodeAPI.

For example, using its invoke_command method as follows:

let irisnode = require("../../common/utilities/iris1200.node");

When(/^I execute the following SQL statement (.*)$/, function (sql) {
    let myData = new irisnode.IRIS(); 
    sql = 'SELECT name, number FROM "SQLUser"."customer"'; 
    var stmt = myData.create_instance({class: "%SQL.Statement" }); 
    var r = myData.invoke_method( stmt, { method: "%Prepare", arguments: [ sql ] } );
    var result = myData.invoke_method( stmt, { method: "%Execute" } );

This is certainly not ideal, so it would be great if SmartBear or someone else were to work on actual cucumber bindings for COS.