2012-01-14 3 views
0

私はレールアプリのためにいくつかのキュウリのシナリオをデバッグしています。私は失敗したステップの1つの上にデバッガの文を持っています。そして、結果のデバッガのプロンプトでいくつかのルーチンのデバッグ作業を行うと、レイクは異常終了し、ターミナルプロンプトに戻ります。ruby​​-debugは、レールアプリのキュウリのシナリオをデバッグする際に散発的に異常終了します(例外を発生させるかもしれません)

/Users/mylogin/app/app/features/step_definitions/merchant_payment_steps.rb:103 
Then "I should see \"form#payment-form\"" 
(rdb:1) p "HI" 
"HI" 
(rdb:1) p page.class 
Capybara::Session 
(rdb:1) p page.notamethod 
NoMethodError Exception: undefined method `notamethod' for #<Capybara::Document> 
(rdb:1) p page.has_content 
NoMethodError Exception: undefined method `has_content' for #<Capybara::Document> 
(rdb:1) p page.has_content? 
ArgumentError Exception: wrong number of arguments (0 for 1) 
(rdb:1) p page.has_content?("HI") 
rake aborted! 
Command failed with status(): [bundle exec /Users/mylogin/.rvm/rubies...] 

(See full trace by running task with --trace) 
mycomputer:app mylogin$ 

私はルビー・デバッグとスーパー慣れていないよ、そう、これはいくつかの基本的なものであれば、先に行くとRTFMように私に教えてください。私はruby-debugからirbを起動しようとしました。(irbは何か私はです。によく慣れています)、同じコードで同じように動作します。私はGoogleに何をしようとするのかと苦労しているので、どんな助けも高く評価されるだろう。ありがとう。ここで

EDIT: 

は(それは醜いです)スタックトレースを持つコマンドです:

MICHAELs-MacBook-Air:app michaelmaag$ bundle exec rake cucumber:wip FEATURE=features/manage_messages.feature --trace 
(in /Users/michaelmaag/app/app) 
** Invoke cucumber:wip (first_time) 
** Invoke db:test:prepare (first_time) 
** Invoke db:abort_if_pending_migrations (first_time) 
** Invoke environment (first_time) 
** Execute environment 
** Execute db:abort_if_pending_migrations 
** Execute db:test:prepare 
** Invoke db:test:load (first_time) 
** Invoke db:test:purge (first_time) 
** Invoke environment 
** Execute db:test:purge 
** Execute db:test:load 
** Invoke db:schema:load (first_time) 
** Invoke environment 
** Execute db:schema:load 
** Execute cucumber:wip 
bundle exec /Users/michaelmaag/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -I "/Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib:lib" "/Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/bin/cucumber" --profile wip features/manage_messages.feature 
Using the wip profile... 
Feature: In order to save users and merchants time 
    Users and merchants 
    Need to be able to text back and forth within Waiter d' 

    @javascript @wip 
    Scenario: Send user a message          # features/manage_messages.feature:8 
    Given I press the "Bob" encounter         # features/step_definitions/message_steps.rb:10 
/Users/michaelmaag/app/app/features/step_definitions/message_steps.rb:29 
if encounter.find("div.encounter_name").text.strip == user_name 
(rdb:1) p page.has_content?("HI") 
INTERNAL ERROR!!! deadlock detected 
    /Users/michaelmaag/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/thread.rb:185:in `sleep' 
    /Users/michaelmaag/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/thread.rb:185:in `block in pop' 
    <internal:prelude>:10:in `synchronize' 
    /Users/michaelmaag/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/thread.rb:180:in `pop' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/command_executor.rb:33:in `execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/bridge.rb:101:in `raw_execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/bridge.rb:85:in `execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/remote/bridge.rb:442:in `find_elements_by' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/remote/bridge.rb:298:in `findElementsByXpath' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/common/find.rb:67:in `find_elements' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/driver/selenium_driver.rb:126:in `find' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:156:in `find_in_base' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:121:in `block in all' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:120:in `map' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:120:in `all' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/matchers.rb:38:in `block in has_selector?' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:164:in `block in wait_conditionally_until' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/session.rb:222:in `block in wait_until' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/util/timeout.rb:13:in `timeout' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/session.rb:222:in `wait_until' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/finders.rb:164:in `wait_conditionally_until' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/matchers.rb:37:in `has_selector?' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/matchers.rb:121:in `has_xpath?' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/node/matchers.rb:184:in `has_content?' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/session.rb:264:in `method_missing' 
    /Users/michaelmaag/app/app/features/step_definitions/message_steps.rb:29:in `block (2 levels) in <top (required)>' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:174:in `eval' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/command.rb:174:in `debug_eval' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:47:in `block in execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:19:in `run_with_binding' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/commands/eval.rb:46:in `execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:275:in `one_cmd' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:261:in `block (2 levels) in process_commands' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:260:in `each' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:260:in `block in process_commands' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:253:in `catch' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:253:in `process_commands' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:173:in `at_line' 
    (eval):5:in `block in at_line' 
    <internal:prelude>:10:in `synchronize' 
    (eval):3:in `at_line' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:55:in `at_line' 
    /Users/michaelmaag/app/app/features/step_definitions/message_steps.rb:29:in `block (2 levels) in <top (required)>' 
    /Users/michaelmaag/app/app/features/step_definitions/message_steps.rb:27:in `each' 
    /Users/michaelmaag/app/app/features/step_definitions/message_steps.rb:27:in `block in <top (required)>' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/step_match.rb:26:in `invoke' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/step_invocation.rb:63:in `invoke' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/step_invocation.rb:42:in `accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:98:in `visit_step' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:15:in `block in accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:14:in `each' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:14:in `accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:53:in `block (2 levels) in accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:79:in `block (2 levels) in with_hooks' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:95:in `before_and_after' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:78:in `block in with_hooks' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:115:in `call' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:13:in `block in around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:95:in `call' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:95:in `execute_around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:12:in `around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:112:in `call' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:112:in `around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:90:in `around' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:77:in `with_hooks' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:51:in `block in accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:106:in `with_visitor' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:45:in `accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:40:in `block in accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `each' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:29:in `block in accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:28:in `accept' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:13:in `visit_features' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:45:in `run!' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:in `execute!' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in `execute' 
    /Users/michaelmaag/.rvm/gems/[email protected]/gems/cucumber-0.10.2/bin/cucumber:14:in `<main>' And I press the message button for the "Bob" encounter   # features/step_definitions/message_steps.rb:25 
     closed stream (IOError) 
     ./features/step_definitions/message_steps.rb:29:in `block (2 levels) in <top (required)>' 
     ./features/step_definitions/message_steps.rb:27:in `each' 
     ./features/step_definitions/message_steps.rb:27:in `/^I press the message button for the "([^"]*)" encounter$/' 
     features/manage_messages.feature:13:in `And I press the message button for the "Bob" encounter' 
    When I press the view conversation button for the "Bob" encounter # features/step_definitions/message_steps.rb:39 
    Then I should see a conversation between "Burst" and "Bob"  # features/step_definitions/message_steps.rb:52 
     closed stream (IOError) 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/command_executor.rb:30:in `write' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/command_executor.rb:30:in `execute' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/bridge.rb:101:in `raw_execute' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/chrome/bridge.rb:85:in `execute' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/remote/bridge.rb:232:in `deleteAllCookies' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/selenium-webdriver-0.1.3/lib/selenium/webdriver/common/options.rb:67:in `delete_all_cookies' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/driver/selenium_driver.rb:141:in `reset!' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/session.rb:60:in `reset!' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/dsl.rb:69:in `block in reset_sessions!' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/dsl.rb:69:in `each' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/dsl.rb:69:in `reset_sessions!' 
     /Users/michaelmaag/.rvm/gems/[email protected]/gems/capybara-0.4.1.2/lib/capybara/cucumber.rb:7:in `After' 

Failing Scenarios: 
cucumber -p wip features/manage_messages.feature:8 # Scenario: Send user a message 

1 scenario (1 failed) 
7 steps (1 failed, 2 skipped, 4 passed) 
0m19.743s 

The --wip switch was used, so the failures were expected. All is good. 
+0

この問題をどのように解決しましたか? –

+0

私はしていません。私はちょうどそれを回避することに終わった。 –

答えて

0

あなたのページをテストするためにカピバラを使用していて、カピバラはのHTMLマークアップを解析するためにhpricotや鋸山などのHTMLパーサーを使用しています呼び出されたページ。この問題は、htmlパーサーによって引き起こされるセグメンテーション違反の可能性があります。私はこの問題を数回経験しました。 --traceを使用してテストタスクを実行して、完全なスタックトレースを確認してください。

関連する問題