Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run tests with Cucumber #30

Closed
marinalimeira opened this issue Jan 29, 2016 · 7 comments
Closed

Can't run tests with Cucumber #30

marinalimeira opened this issue Jan 29, 2016 · 7 comments

Comments

@marinalimeira
Copy link

I tried to use with Cucumber but everytime I try, I get the following error:

undefined method `scenario_outline' for #<Cucumber::RunningTestCase::Scenario:0x0000000667af60> (NoMethodError)

I checked the Cucumber docs and scenario_outline doesn't exist on Cucumber::RunningTestCase::Scenario.
http://www.rubydoc.info/gems/cucumber/Cucumber/RunningTestCase/Scenario

And also, my report is being generated as

Knapsack report was generated. Preview:
{
}
@ArturT
Copy link
Member

ArturT commented Jan 29, 2016

@marinalimeira What version of cucumber & knapsack are you using? Could you provide the full backtrace of the error and how failing test code looks like? Maybe you found some edge case I didn't cover. Thanks.

@marinalimeira
Copy link
Author

@ArturT Part of my Gemfile.lock:

  cucumber (2.3.2)
      builder (>= 2.1.2)
      cucumber-core (~> 1.4.0)
      cucumber-wire (~> 0.0.1)
      diff-lcs (>= 1.1.3)
      gherkin (~> 3.2.0)
      multi_json (>= 1.7.5, < 2.0)
      multi_test (>= 0.1.2)
    cucumber-core (1.4.0)
      gherkin (~> 3.2.0)
    cucumber-rails (1.4.3)
      capybara (>= 1.1.2, < 3)
      cucumber (>= 1.3.8, < 3)
      mime-types (>= 1.16, < 4)
      nokogiri (~> 1.5)
      railties (>= 3, < 5)

That's my full backtrace:

➜ KNAPSACK_GENERATE_REPORT=true bundle exec cucumber features/[]/[].feature 
Knapsack report generator started!
Using the default profile...
Feature: [] Add new []

  Scenario: Create []                  # features/[]/[].feature:5
  undefined method `scenario_outline' for #<Cucumber::RunningTestCase::Scenario:0x00000006fb77e0> (NoMethodError)

Failing Scenarios:
cucumber features/[]/[].feature:5 # Scenario: Create a []

1 scenario (1 failed)
0 steps
0m0.001s
Knapsack report was generated. Preview:
{
}

Knapsack global time execution for tests: 0s

.: had to hide my code details :.

@ArturT
Copy link
Member

ArturT commented Jan 29, 2016

@marinalimeira Could you reproduce the test, please fork this repo https://github.com/KnapsackPro/rails-app-with-knapsack/tree/master/features and add test which is similar to yours features/[]/[].feature:5 so I will be able to prepare some fix.

Right now I don't know how your code looks like and it's hard for me to guess. Basically if you could prepare failing test (I mean the knapsack will fail to generate report as in your case) in cucumber then I will be able to investigate what's wrong with the gem. Thanks for help!

@marinalimeira
Copy link
Author

@ArturT I'm pretty sure that this is happening thanks to some cucumber update. I run bundle update inside rails-app-with-knapsack and cucumber was updated from 1.3.20 to 2.3.2.

That's the backtrace after run cucumber:

➜  rails-app-with-knapsack git:(master) ✗ cucumber
Running via Spring preloader in process 10126
Knapsack time offset warning enabled!
Using the default profile...
Feature: Tests for calculator

  Scenario: Adding                  # features/calculator.feature:3
  undefined method `scenario_outline' for #<Cucumber::Core::Test::Case: features/calculator.feature:3> (NoMethodError)

Feature: Scenario outline tests for calculator

  Scenario Outline: Adding scenario outline # features/calculator_scenario_outline.feature:3
    Given I visit calculator                # features/calculator_scenario_outline.feature:4
    When there are <x> cucumbers            # features/calculator_scenario_outline.feature:5
    And I add <y> cucumbers                 # features/calculator_scenario_outline.feature:6
    Then I should have <result> cucumbers   # features/calculator_scenario_outline.feature:7
      undefined method `file' for #<Cucumber::RunningTestCase::ScenarioOutlineExample:0x00000006736968> (NoMethodError)
undefined method `after_test_case' for nil:NilClass (NoMethodError)

@ArturT
Copy link
Member

ArturT commented Jan 31, 2016

@marinalimeira I did fix in knapsack 1.6.0. Could you try it and please let me know if it works for you.

@marinalimeira
Copy link
Author

It's working now, thank you!

@ArturT
Copy link
Member

ArturT commented Jan 31, 2016

@marinalimeira Cool, thanks for reporting issue. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants