douye2036 2018-11-27 14:05
浏览 96
已采纳

Chatjure版的Behat?

In the past, for PHP project's, I have used Behat in conjunction with the api-extension to write component level tests. Behat shares a common philosophies with cucumber. I would therefore like to known if there is an equivalent api extension I could use for cucumber in a Clojure project?

This is the kind of test I would like to create:

Feature: MyFeature
Scenario: do somthing
      Given the request body is:
      """
      {
        "key": "val"
      }
      """
      And the "Content-Type" request header is "application/json"
      When I request "/route" using HTTP POST
      Then the response code is 200
      Then the response body contains JSON:
      """
      {
          "meta": {
              "status": "@variableType(string)"
          },
          "data": {
              "key": "@variableType(integer)"
          }
      }
      """
  • 写回答

1条回答 默认 最新

  • doushi5024 2018-11-27 20:08
    关注

    So I think what you are looking for is a BDD framework that implements Gherkin in some way (as Behat does). The Cucumber framework, which you mention, does just that, and there exists a Clojure implementation which you can see here: https://github.com/cucumber/cucumber-jvm-clojure

    I think this is basically what you are looking for.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度