Contents

This page comes from an earlier version of the Cucumber Js docs (commit dcdc32d7). See the latest Cucumber Js docs.

Asynchronous step definition callbacks

In order to test asynchronous code As a dev I want step definitions to call back asynchronously

Scenario: Execute feature with asynchronous step definition

  • Given a step definition matching /^an asynchronous step passes$/ calling back asynchronously after 50 milliseconds
  • And a step definition matching /^a step passes$/
  • When I run the following feature:
    Feature: Asynchronous step definition body
      Scenario: Waiting for an asynchronous step to call back
        When an asynchronous step passes
        Then a step passes
  • Then the feature should have run successfully

Source: features/legacy/asynchronous_step_definitions-issue_01.feature at commit dcdc32d7, Cucumber Js (MIT license).