我尝试在 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 实现?
谢谢
最佳答案
以“/”开头的路径假定它是根。如果使用相对路径,不要以“/”开头
所以参数值可以是-file:specs/example.spec
关于java - 无法在 Gauge 中解析动态参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48540846/