Converted all Behat WebAPIExtension step definitions to Node.js, packaged in Webship-JS

Published: (December 2, 2025 at 06:27 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Behat’s WebAPIExtension was a simple and effective way to test JSON‑based APIs using Gherkin steps. On July 14 2025 the repository was archived by its owner and became read‑only, meaning it’s no longer maintained, but not abandoned in purpose.

At Webship.co we saw great value in the extension’s structured API‑testing approach. Instead of letting it fade away, we rebuilt all of its step definitions in Node.js and integrated them directly into Webship‑JS.

Why WebAPIExtension was worth reviving

  • It made API testing readable and easy to understand.
  • It supported setting headers, sending JSON bodies, checking status codes, and validating responses.
  • It helped teams describe API behavior in a simple Given / When / Then format.

We kept all these strengths and enhanced them.

What’s new in Webship‑js

Our rebuilt API steps now support:

  • Setting headers and request bodies
  • Sending all HTTP methods (GET, POST, PUT, DELETE, …)
  • Validating status codes
  • Matching JSON responses, including nested fields
  • Checking response headers
  • Using matcher patterns (regex, array length, JWT, etc.)

Example

When I send a POST request to "/users" with values:
    | name  | John Doe         |
    | email | john@example.com |
    | age   | 30               |

Full documentation of the steps is available here:
https://webship.co/docs/webship-js/1.0.x/api-step-definitions

Conclusion

Although the original WebAPIExtension is now archived, its value continues.
With our Node.js rebuild, Webship‑JS brings it back — cleaner, faster, and actively maintained. The same familiar BDD API experience, but modern and ready for real projects today.

Back to Blog

Related posts

Read more »