Cucumber.js v2.0.0-rc.0 Release Notes

Release Date: 2016-11-25 // over 7 years ago
  • ๐Ÿ’ฅ Breaking Changes
    • โฌ‡๏ธ Dropped support for Node 0.10
    • CLI
      • --colors / --no-colors has moved to --format-options '{"colorsEnabled": <BOOLEAN>}'
      • --require <DIR|FILE>: the required files are no longer reordered to require anything in a support directory first
      • --snippet-interface <INTERFACE> has moved to --format-options '{"snippetInterface": "<INTERFACE>"}'
      • --snippet-syntax <SYNTAX> has moved to --format-options '{"snippetSyntax": "<SYNTAX>"}'
      • --tags <EXPRESSION> now uses cucumber-tag-expressions. It is no longer repeatable and new values will override previous
      • --tags @dev stays the same
      • --tags ~@dev becomes --tags 'not @dev'
      • --tags @foo,@bar becomes --tags '@foo or @bar'
      • --tags @foo --tags @bar becomes --tags '@foo and @bar'
    • Internals
      • complete rewrite using ES2015 and promises
    • JSON Formatter
      • String attachments are no longer base64 encoded. Buffer and Stream attachments are still base64 encoded.
    • ๐Ÿ‘Œ Support Files

      • Attachments
      • The attach function used for adding attachments moved from the API scenario object to world. It is thus now available in step definitions without saving a reference to the scenario.

        // 1.3.0
        this.After(function(scenario, callback) {
          scenario.attach(new Buffer([137, 80, 78, 71]), 'image/png')
        });
        
        // 2.0.0
        this.After(function() {
          this.attach(new Buffer([137, 80, 78, 71]), 'image/png');
        });
        
      • When attaching buffers or strings, the callback argument is ignored.

      • Hooks

      • Hooks now receive a ScenarioResult instead of the Scenario

        // 1.3.0
        this.After(function(scenario) {});
        
        // 2.0.0
        this.After(function(scenarioResult) {});
        
      • The tags option for hook should now be a string instead of an array and uses cucumber-tag-expressions

        // 1.3.0
        this.Before({tags: ["@foo"]}, function (scenario) {})
        this.Before({tags: ["@foo,@bar"]}, function (scenario) {})
        this.Before({tags: ["@foo", "@bar"]}, function (scenario) {})
        
        // 2.0.0
        this.Before({tags: "@foo"}, function (scenario) {})
        this.Before({tags: "@foo and @bar"}, function (scenario) {})
        this.Before({tags: "@foo or @bar"}, function (scenario) {})
        
      • Step Definitions

      • String patterns were removed in favor cucumber-expressions

      • Regular Expressions

        • capture groups matching (-?\d+) will be automatically converted to an integer using parseInt
        • capture groups matching (-?\d*\.?\d+) will be automatically converted to a float using parseFloat
      • Generator functions are no longer automatically run with co. To retain the previous functionality, use this.setDefinitionFunctionWrapper

      • Event Handlers

      • Objects no longer have get* methods and instead have exposed properties

        • For example: scenario.getName() is now just scenario.name
      • StepResult duration is now in milliseconds instead of nanoseconds

    ๐Ÿ› Bug Fixes
    • โœ‚ remove empty lines from @rerun files (#660, Cody Ray Hoeft)
    • ๐Ÿ’ป catch uncaught errors in the browser (Charlie Rudolph)
    ๐Ÿ†• New Features
    • ๐Ÿ‘Œ Support Files
      • Attachments:
      • When attaching a stream, the interface can either accept a callback as a third argument or will return a promise if not passed a callback
      • Step Definitions
      • Ability to add custom argument transformations
    • Fail fast / rerun formatter
      • When used together rerun formatter will output all skipped scenarios that didn't run due to a failure
    ๐Ÿ“š Documentation
    • ๐Ÿ›  fix typo (#659, gforceg)
    • โšก๏ธ update support files api reference (#661, Zearin)