首页 > 解决方案 > Cucumber 版本 - 6.9.1 - 无法在场景大纲“示例”中传递空白字符串

问题描述

cucumber 版本升级到 6.9.1 后,Examples 中不能传入空白(空字符串)。以前可以传递空字符串

  Scenario Outline : Testing datatable with empty string
    When passing "<first>" and "second>" as String parameter
    Then exception should be thrown
     Examples:
      | first  | second |
      | simple |        |

标签: cucumber-jvmcucumber-java

解决方案


我可以在cucumber-java版本中使用它6.9.1。刚刚测试过了

Scenario Outline: example
    Given I log <TestString>
     
      Examples:
        |TestString|
        |"                   " |


 @Given("I log {string}")
        public void logSomething(String teststr )   {
            System.out.println("sample text:"+ teststr+"somethingtoIdentifySpace");
       }

打印这个

sample text:                   somethingtoIdentifySpace

推荐阅读