Karate - is there any way to fetch name of current feature file

Viewed 51

I want to make a simple adjustment to the feature file below:

@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"

to something like:

@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"

to avoid mistakes of duplicate input, is there any related usages?

1 Answers
Related