这是我的功能:
Feature: Smoke tests Scenario: Check status code of all links Given I am logged in "https://myserver-product.domain.dom/" When I request every get route on the application Then I should see all the routes are reporting OK status code
以下是我的步骤:
Given(/^I am logged in "([^\"]*)"$/) do |base_url| # starting end When(/^I request every get route on the application$/) do # do something end Then(/^I should see all the routes are reporting OK status code$/) do # do something end
最后,黄瓜报告告诉我情景未定义。我认为问题是模式"([^\"]*)"
,但我不知道为什么?我认为这是正确的。任何推荐?我只需要那个黄瓜通过第一步。
Feature: Smoke tests Scenario: Check status code of all links Given I am logged in "https://myserver-product.domain.dom/" When I request every get route on the application Then I should see all the routes are reporting OK status code 1 scenario (1 undefined) 3 steps (3 undefined) 0m0.002s You can implement step definitions for undefined steps with these snippets: Given(/^I am logged in "(.*?)"$/) do |arg1| pending # express the regexp above with the code you wish you had end When(/^I request every get route on the application$/) do pending # express the regexp above with the code you wish you had end Then(/^I should see all the routes are reporting OK status code$/) do pending # express the regexp above with the code you wish you had end If you want snippets in a different programming language, just make sure a file with the appropriate file extension exists where cucumber looks for step definitions.