Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Wire Protocol

dwhelan edited this page Aug 13, 2010 · 35 revisions

This page documents the details of the low-level \wire protocol that Cucumber uses to list and invoke steps in a remote process.

This protocol is in flux. Please see wire protocol for discussions around this emerging protocol.

List Step Definitions

Request

{ "request" : "LIST_STEP_DEFINITIONS" }

Response

{ "response" : "OK", "step_definitions":  [ { "id": "some id ", "regexp": "regex" } ] }

Invoke Step

Request

{ "request" : "INVOKE", "args" : { "id" : "some id", "args" : [ "foo", "bar" ] } }

Response

If the step is invoked successfully then an OK response is returned:

{ “response” : “OK” }

OR

If the step throws an exception then a STEP_FAILED response is returned:

{ “response” : “STEP_FAILED”, “details” : 
{ “exception” : “some exception type”, “message” : “foo”, “backtrace” : “bar” } }

General Failure Response

If the remote process cannot handle a request then it shall return the following response:

{ "response" : "FAILED", "details" :
    { "exception" : "some exception type", "message" : "foo", "backtrace" : "bar" } }

Clone this wiki locally