2

我有这个步骤实现

给定 /^entity URI "([^"]*)"$/ do |arg1| @entityUri = arg1 end

我将此步骤从现有功能文件复制到新功能文件

   Given entity URI <Entity Resource URI>

Cucumber 状态 1 个场景(1 个未定义)8 个步骤(2 个跳过,4 个未定义,2 个通过)0m0.009s

您可以使用以下代码片段为未定义的步骤实现步骤定义:

给定 /^entity URI "(.*?)"$/ 做 |arg1| pending # 用你希望结束的代码表达上面的正则表达式

PS:我检查了我的新旧功能文件的目录结构,它们处于同一级别。即使这个解决方案对我也不起作用:Cucumber: undefined step, 尽管 step 应该被定义

4

2 回答 2

3

基于步骤匹配器正则表达式,我希望步骤与步骤周围的双引号匹配:

Given entity URI "<Entity Resource URI>"
于 2012-09-28T13:33:53.960 回答
0
Check with the folder structure it should be like below
Create project folder
 >Create features folder
  >Create step definitions folder
    >Save .rb files here
  >Save .feature files here.

Step definition folder and .feature files should be in the feature file.

Even i faced the same issue like you.The folder structure solved my problem.
于 2018-10-25T08:45:35.500 回答