Karate 如果示例的列太多 ,;每行都太长,无法读取!;

Karate 如果示例的列太多 ,;每行都太长,无法读取!;,karate,Karate,如果示例的列太多,则每一行都太长,无法读取 Feature: Background: Scenario Outline: * match '<msg>' == <prefix> + ',' + '<end>' Examples: | prefix | end | msg | | hello | mike | hello,mike | | hello | jerry |

如果示例的列太多,则每一行都太长,无法读取

Feature:

  Background:

  Scenario Outline:
    * match '<msg>' == <prefix> + ',' + '<end>'
    Examples:
      | prefix | end   | msg         |
      | hello  | mike  | hello,mike  |
      | hello  | jerry | hello,jerry |
功能:
背景:
情景大纲:
*匹配'==+','+''
示例:
|前缀| end | msg|
|你好|迈克|你好,迈克|
|你好|杰瑞|你好,杰瑞|
会不会是这样:

Feature:

  Background:
    Examples:
    | prefix |
    | hello  |

  Scenario Outline:
    * match '<msg>' == <prefix> + ',' + '<end>'
    Examples:
      | end   | msg         |
      | mike  | hello,mike  |
      | jerry | hello,jerry |
功能:
背景:
示例:
|前缀|
|你好|
情景大纲:
*匹配'==+','+''
示例:
|完| msg|
|迈克|你好,迈克|
|杰瑞|你好,杰瑞|

我想把这些例子分成几个部分,或者在提纲之前设定一个基本的例子。我应该怎么做?

空手道在其最新版本
0.9.X
中以许多不同的方式解决这个问题,让我们看看

  • 正如您所要求的,我们可以定义
    示例:
    场景大纲之前的表格:在空手道中使用
  • 因此,空手道允许您使用空手道的

    如果您觉得示例太大,无法容纳在功能文件中,请将其保存在
    csv
    文件中,并务必阅读
    示例

    Feature: my feature
      Background: BG
        * def myExample = read("myExample.csv")
    
      Scenario Outline: SOW
        * match '<msg>' == '<prefix>' + ',' + '<end>'
        Examples:
        | myExample |
    
    
    功能:我的功能
    背景:BG
    *def myExample=read(“myExample.csv”)
    情景概述:SOW
    *匹配“”=”+”,“+”
    示例:
    |myExample|
    
    JSON也是如此,它以JSON数组的形式提供数据

    [
      {
        "prefix": "hello",
        "end": "mike",
        "msg": "hello,mike"
      },
      {
        "prefix": "hello",
        "end": "jerry",
        "msg": "hello,jerry"
      }
    ]
    
    Feature: my feature
      Background: BG
        * def myExample = read("myExample.csv")
    
      Scenario Outline: SOW
        * match '<msg>' == '<prefix>' + ',' + '<end>'
        Examples:
        | myExample |