如何评论空手道中的多行?

how to comment multiple lines in karate?

我需要在调试测试用例时注释多行。单行我可以使用 # 评论,但我正在寻找块评论。

示例:

使用文档输入创建集成

* def result = call read('classpath:ic/common/resources/integration/createIntegration.feature') { X-CSRF-TOKEN: csrfToken, JSESSIONID: jsessionid, integrationName: Add21NumDocInputs, id: tenantID, inputFile: 'ic/common/resources/integration/createIntegrationAdd2NumDocInputs.json'}

则匹配result.responseStatus包含201

则匹配result.response.integration.message.description包含'Success'

则匹配result.response.integration.serviceData.message包含'Add21NumDocInputs'+'创建成功'

Gherkin 语法不支持块注释,但这是大多数团队所做的。

使用 Cucumber IDE integration - 在 Eclipse、IntelliJ、Visual Studio 代码等中受支持

例如,如果您使用 Eclipse,CTRL + / 将注释所有选定的行。

在Gherkin中,""" """可以对代码块进行注释。 但是对于空手道来说,这只是一个街区。

我可以实现相同的效果,下面的行已被评论。

"""
    /*
     And match response.messageTraceId == (#number)
     And match response.messageTraceId != (null)
     And match response.currentBalance != (null)
     And match response.availBalance != (null)
    */
"""

我看到越来越多的人在使用下面的方式

How to do block comments in Gherkin?