我得到以下警告使用此代码然后弃用:鉴于/时/黄瓜
WARNING: Using 'Given/When/Then' in step definitions is deprecated, use 'step' to call other steps instead
我如何纠正呢?
代码:
Feature: Viewing tickets
In order to view the tickets for a project
As a user
I want to see them on that project's page
Background:
Given there is a project called "TextMate 2"
And that project has a ticket:
| title | description |
| Make it shiny! | Gradients! Starbursts! Oh my! |
And there is a project called "Internet Explorer"
And that project has a ticket:
| title | description |
| Standards compliance | Isn't a joke. |
And I am on the homepage
Scenario: Viewing tickets for a given project
When I follow "TextMate 2"
Then I should see "Make it shiny!"
And I should not see "Standards compliance"
When I follow "Make it shiny!"
Then I should see "Make it shiny" within "#ticket h2"
And I should see "Gradients! Starbursts! Oh my!"
When I am on the homepage
And I follow "Internet Explorer"
Then I should see "Standards compliance"
And I should not see "Make it shiny!"
When I follow "Standards compliance"
Then I should see "Standards compliance" within "#ticket h2"
And I should see "Isn't a joke.
非常感谢!
这将是由于步骤的定义,而不是功能文件代码 - 你可以发布你的步骤定义代码? – 2012-03-16 00:38:23
您可以将步骤方法用于单个步骤或多个步骤。看到我的答案在这里http://stackoverflow.com/questions/918066/reuse-cucumber-steps/8395715#8395715 – michaeltwofish 2012-03-17 02:22:50