【问题标题】:Dynamic parameter cannot be resolved in Gauge动态参数无法在 Gauge 中解析
【发布时间】:2018-02-01 17:17:21
【问题描述】:

我尝试在 Gauge 规范中使用 file 特殊参数。

Export a customer
----------------------------------------
* Find customer "Hans"
* Export customer to <file:/customer.xml>

这个的java实现看起来像这样

@Step("Export customer to <file>")
public void test(String file) {
   System.out.println("file " + file);
}

我假设参数 typ 是 String(也可以是 File 吗?)

但是,运行它,返回

[ParseError] C:\Users\user\IdeaProjects\qmsgauge\specs\tenantManagement.spec:40 
 Dynamic parameter <file:/customer.xml> could not be resolved => 'Export customer to <file:/customers.xml>'
Successfully generated html-report to => C:\Users\user\IdeaProjects\qmsgauge\reports\html-report\index.html

我如何在规范中定义文件参数以及需要如何为此编写java实现?

谢谢

【问题讨论】:

    标签: java testing automated-tests bdd getgauge


    【解决方案1】:

    以“/”开头的路径假定它是根。如果使用相对路径,请不要以“/”开头

    所以参数值可以是-file:specs/example.spec

    【讨论】:

    • 这是问题之一 - 另一个是我假设该文件不需要存在......它确实存在
    猜你喜欢
    • 2013-06-28
    • 2016-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多