空手道阅读(多部分字段)如果调用特征文件会出错

问题描述 投票:0回答:0

当我运行测试场景初始特征文件通过但调用初始场景的测试场景失败。

错误消息参考了初始场景。

16:37:47.713 [main] ERROR com.intuit.karate - feature call failed: classpath:features/Initial_Scenario.feature
arg: null
Initial_Scenario.feature:67 - could not find or read file: asd.png

com.intuit.karate.exception.KarateException: -unknown-:10 - 
Initial_Scenario.feature.feature:67 - could not find or read file: asd.png

    at ✽.* def result = call read('../Initial_Scenario.feature') (-unknown-:10)
  Initial_Scenario.feature
Feature: Initial feature file

    @wip
   Scenario: Sc-1
    Given url baseUrl
    When path '/api/Start'
    And header Content-Type = 'multipart/form-data'
    And multipart file files = { read: 'asd.png' , filename: 'asd.png'}
    And method post
    Then status 200

Test_Scenario.feature

Feature: Test Scenario

  Background:
    * def result = call read('../Initial_Scenario.feature')
    * def Partner_ID = result.Partner_ID
    * def Product_ID = result.Product_ID

    @wip
    Scenario: Test
        Given url baseUrl
        When path '/api/Qwe'
        And request expectedBody
        And header X-Partner-ID = Partner_ID
        And header Authorization = 'Bearer ' + internalWriterToken
        And method post
        Then status 200

当我使用呼叫阅读功能时,我注意不要使用三阶重复。我知道这种用法不正确,但我不得不这样做,因为项目中添加了多部分文件功能。

call karate readfile multipart
© www.soinside.com 2019 - 2024. All rights reserved.