在黄瓜中使用Background部分时,获取“required(...)+ loop与输入'Scenario:'”时的任何内容都不匹配

时间:2017-10-18 17:50:42

标签: cucumber bdd karate

我正在编写一个空手道DSL测试来测试Web服务端点。我已经在karate-config.js文件中定义了我的url基础。但是,当我尝试在背景部分中使用它时,我收到以下错误。请帮忙。提供我的功能文件如下。

错误:“required(...)+ loop与输入'Scenario:'”

中的任何内容都不匹配
Feature: Test Data Management service endpoints that perform different operations with EPR

    Background:
     url dataManagementUrlBase

    Scenario: Validate that the contractor's facility requirements are returned from EPR
    Given path 'facilities'
    And def inputpayload = read('classpath:dataManagementPayLoad.json')
    And request inputpayload
    When method post
    Then status 200
    And match $ == read('classpath:dataManagementExpectedJson.json')

1 个答案:

答案 0 :(得分:2)

您在*

之前缺少url
Background:
* url dataManagementUrlBase