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.

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?

Thanks,

Olga

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

  Background:
    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>

    Examples:
      | 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                       |