Search code examples
cucumbercucumberjs

How do I set a boolean in parameter types for Cucumber?


Cucumber allows you to pass int, string, floats as parameter types, is there a way to do it with Booleans?

Given('the property {string} is set to {string}', function (path, value) {
    this.requestBody = this.requestBody || {};
    _.set(this.requestBody, path, value);
});

Solution

  • Short answer, no, but I believe you'll find what you need here.

    There are multiple way to achieve this and most of them require you to parse a value to boolean inside the Given step. I believe in your case is the value.

    Good luck!