【发布时间】:2018-11-07 23:27:40
【问题描述】:
所以我在 cucumberjs 中有这个功能
Scenario: Upload a valid pcf file into gpe
Given that the user uploads a valid pcf file
Then the user should see an upload success indicator
Scenario: Upload an invalid pcf file
Given that the user uploads an invalid pcf file
Then the user should see an upload error message
如您所见,除了上传后的字符串外,then 几乎相同。所以我写了一个 my then 这样的:
this.Then(/^that the user uploads [a-zA-Z]+/, ( option ) => {
console.log( option );
} );
但选项显示功能:完成。上传单词后的字符串如何获取?
【问题讨论】:
-
这些绝对应该是两个独立的步骤。至于正则表达式,只需添加一个空格: [\w ]+
标签: regex cucumberjs