0

Here is my feature:

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  

Here are my steps:

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

And finally, the cucumber report tells me that the scenario is undefined. I think the problem is the pattern "([^\"]*)" but I don't know why? I think it is correct. Any recomendations? I only need that cucumber pass the first step.

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.
Fiddling Bits
  • 8,712
  • 3
  • 28
  • 46
Robert
  • 10,403
  • 14
  • 67
  • 117
  • 1
    Are you sure you saved your steps `rb`? I copied exactly what you have and mine is passing: `1 scenario (1 passed)`. – Fiddling Bits Sep 02 '14 at 20:01
  • I find the solution in the accepted answer of [Cucumber not finding step definitions][1] [1]: http://stackoverflow.com/questions/18772970/cucumber-not-finding-step-definitions/25627072?noredirect=1#answer18773285 – Robert Sep 03 '14 at 16:07

0 Answers0