2
votes
RAILS_ENV=test bundle exec cucumber features/bodybuilder/notworking.feature --backtrace

I have used the above command with different parameter but no success for me
1. --backtrace
2. --format (OptionParser::MissingArgument) <== it gives me this
3. --verbose --backtrace <== this does not show correct way of output
4. --trace (OptionParser::InvalidOption) <== it gives me this

It does not give me where Scenario fails exactly

o/p: for backtrace

fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
re-use db: dxbi_2f921362a97c1_725257_test
Using the default profile...
.........F

Failing Scenarios:
cucumber features/bodybuilder/notworking.feature:19 # Scenario: Create new bodybuilder

1 scenario (1 failed)
6 steps (6 passed)
0m11.148s

The Scenario using:

@javascript
Scenario: Create new bodybuilder
    When I click on Create New bodybuilder button
    Then I check the checkbox "MobileClick" from bodybuilder gym
    And I fill in "Name" with "bodybuilderTest"
    And I click on "Create bodybuilder" button
    Then I should see "Successfully created bodybuilder 'bodybuilderTest'"

The step gives us problem is this:

When(/^I check the checkbox "(.*?)" from bodybuilder gym$/) do |checkbox_select|
   within('div#first_party_bodybilder_table') do
     if find("span", :text => "#{checkbox_select}")
        find('td.selectable input').click
     end
   end
end

Here after clicking it gives that ...F over there else Scenario runs smooth but we need that to check.

1
With cucumber 1.3.15 a failure in a step definition shows me the line number, and -b shows the entire backtrace. So: what version of cucumber? Is this a Javascript scenario? Is there something non-default about env.rb (or any other support file) or cucumber.yml?Dave Schweisguth
cucumber version using: gem 'cucumber-rails','~>1.4.0'Gtr_py

1 Answers

2
votes

As I am running under the virtual machine and test environment need to use following command

RAILS_ENV=test bundle exec cucumber -b -f pretty features/bodybuilder/notworking.feature

It give full trackback of error occurring.