[英]Is there any straightforward way to fetch and send `current method name` as argument in java?
[英]Karate - is there any way to fetch name of current feature file
我想對下面的功能文件做一個簡單的調整:
@Read @healthCheck
Feature: healthCheck
Background:
* def service = "healthCheck"
* def req = call read("classpath:SoapRequest.feature")
Scenario: toggle healthcheck
Given match each /Envelope/Body/pingResponse/healthChecks/healthCheck/status == "SUCCESS"
類似於:
@Read @healthCheck
Feature: healthCheck
Background:
* def service = //name of this feature
* def req = call read("classpath:SoapRequest.feature")
Scenario: toggle healthcheck
Given match each /Envelope/Body/pingResponse/healthChecks/healthCheck/status == "SUCCESS"
為了避免重復輸入的錯誤,有沒有相關的用法?
看看這是否有效:
* def service = karate.feature.fileName
參考: https ://github.com/karatelabs/karate/wiki/1.0-upgrade-guide#karateinfo-deprecated
如果它不起作用,您可能需要貢獻代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.