Cucumber::Undefined 错误有什么值得担心的吗?
我的黄瓜功能文件如下
Feature: Create and Manage Videos
In order to record a video
As a registered user
I want to create and manage videos
Scenario: sent videos list
Given I have sent video titled "Happy Birthday" to "My Friend X"
When I go to my outbox list of videos
Then I should see "Happy Birthday" video
And I should see "My Friend X"
我使用以下命令运行黄瓜
cucumber features
我得到以下输出
Using the default profile...
Feature: Create and Manage Videos
In order to record a video
As a registered user
I want to create and manage videos
Scenario: sent videos list # features/manage_video.feature:6
Given I have sent video titled "Happy Birthday" to "My Friend X" # features/manage_video.feature:7
Undefined step: "I have sent video titled "Happy Birthday" to "My Friend X"" (Cucumber::Undefined)
features/manage_video.feature:7:in `Given I have sent video titled "Happy Birthday" to "My Friend X"'
When I go to my outbox list of videos # features/manage_video.feature:8
Undefined step: "I go to my outbox list of videos" (Cucumber::Undefined)
features/manage_video.feature:8:in `When I go to my outbox list of videos'
Then I should see "Happy Birthday" video # features/manage_video.feature:9
Undefined step: "I should see "Happy Birthday" video" (Cucumber::Undefined)
features/manage_video.feature:9:in `Then I should see "Happy Birthday" video'
And I should see "My Friend X" # features/manage_video.feature:10
Undefined step: "I should see "My Friend X"" (Cucumber::Undefined)
features/manage_video.feature:10:in `And I should see "My Friend X"'
1 scenario (1 undefined)
4 steps (4 undefined)
0m1.877s
下面我得到了一堆片段,我将在steps_definition文件中使用它们。
我的问题是 :: 这些 Cucumber::Undefined 错误值得担心吗?
谢谢 保罗
My cucumber feature file is as follows
Feature: Create and Manage Videos
In order to record a video
As a registered user
I want to create and manage videos
Scenario: sent videos list
Given I have sent video titled "Happy Birthday" to "My Friend X"
When I go to my outbox list of videos
Then I should see "Happy Birthday" video
And I should see "My Friend X"
I run cucumber using the following command
cucumber features
I get the following output
Using the default profile...
Feature: Create and Manage Videos
In order to record a video
As a registered user
I want to create and manage videos
Scenario: sent videos list # features/manage_video.feature:6
Given I have sent video titled "Happy Birthday" to "My Friend X" # features/manage_video.feature:7
Undefined step: "I have sent video titled "Happy Birthday" to "My Friend X"" (Cucumber::Undefined)
features/manage_video.feature:7:in `Given I have sent video titled "Happy Birthday" to "My Friend X"'
When I go to my outbox list of videos # features/manage_video.feature:8
Undefined step: "I go to my outbox list of videos" (Cucumber::Undefined)
features/manage_video.feature:8:in `When I go to my outbox list of videos'
Then I should see "Happy Birthday" video # features/manage_video.feature:9
Undefined step: "I should see "Happy Birthday" video" (Cucumber::Undefined)
features/manage_video.feature:9:in `Then I should see "Happy Birthday" video'
And I should see "My Friend X" # features/manage_video.feature:10
Undefined step: "I should see "My Friend X"" (Cucumber::Undefined)
features/manage_video.feature:10:in `And I should see "My Friend X"'
1 scenario (1 undefined)
4 steps (4 undefined)
0m1.877s
Below this I get a bunch of snippets which I will use in the steps_definition file.
My question is :: Are these Cucumber::Undefined errors something to worry about?
Thanks
Paul
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,他们是!这表明您的测试实际上没有被执行。您没有说您是否真正编写了步骤定义。如果有,那么 Cucumber 找不到这些文件,如果您不使用传统的文件夹结构,那么您需要使用
包含您的步骤的文件夹替换
my_step_defs_location
来告诉 Cucumber 这些文件的位置定义。Yes they are! This indicates that none of your tests are actually being executed. You don't say if you've actually written step definitions or not. If you have, then Cucumber isn't finding these, if you aren't using the conventional folder structure then you'll need to tell Cucumber where these are located using
Replacing
my_step_defs_location
with the folder containing your step definitions.