簡體   English   中英

空手道 - 有沒有辦法獲取當前功能文件的名稱

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM