Note that there are some explanatory texts on larger screens.

plurals
  1. POCucumber `press button` failure (Capybara::ElementNotFound)
    primarykey
    data
    text
    <p>I'm a relative newbie starting up a new Ruby on Rails app. I started by following a combination of instructions at <a href="https://github.com/intridea/omniauth" rel="nofollow">https://github.com/intridea/omniauth</a>, <a href="http://www.communityguides.eu/articles/16" rel="nofollow">http://www.communityguides.eu/articles/16</a>, <a href="http://intridea.com/2011/1/31/easy-rails-admin-login-with-google-apps-and-omniauth?blog=company" rel="nofollow">http://intridea.com/2011/1/31/easy-rails-admin-login-with-google-apps-and-omniauth?blog=company</a> . At the point everything appeared to work correctly, I started to write my very first cucumber features and steps. I was able to get a couple of steps up and running, but I've been bogged down on a step that I thought was built in. I have a form with two <code>submit_tag</code>s but I can't get a scenario to successfully pass a basic <code>And I press "button"</code> step.</p> <p>possibly relevant gems:</p> <pre> rails (3.1.0.rc4) capybara (1.0.0) cucumber (1.0.1) cucumber-rails (1.0.2) nokogiri (1.4.7) gherkin (2.4.5) rack-test (0.6.0) selenium-webdriver (0.2.2) </pre> <p>section of the form in question:</p> <pre><code>&lt;%= form_tag :controller =&gt; "services", :action =&gt; "newaccount" do %&gt; &lt;%= submit_tag "confirm", :id =&gt; "confirm", :title =&gt; "confirm", :value =&gt; "confirm", :text =&gt; "confirm", :name =&gt; "confirm" %&gt; &lt;%= submit_tag "cancel", :id =&gt; "cancel", :title =&gt; "cancel", :value =&gt; "cancel", :text =&gt; "cancel", :name =&gt; "cancel" %&gt; &lt;% end %&gt; </code></pre> <p>scenario in question:</p> <pre><code>Scenario: I register with a valid and currently active google account Given I am not registered When I sign in with a valid and currently active google account And I press "confirm" # &lt;-- THE PROBLEMATIC STEP Then I should see "Your account has been created and you have been signed in!" </code></pre> <p>I think this is the relevant web_step (straight from the default web_steps.rb which I have not edited at all):</p> <pre><code>When /^(?:|I )press "([^"]*)"$/ do |button| click_button(button) end </code></pre> <p>relevant cucumber output:</p> <pre><code>Scenario: I register with a valid and currently active google account # features/auth_and_auth/initial_tests.feature:6 Given I am not registered # features/step_definitions/authentication_steps.rb:1 When I sign in with a valid and currently active google account # features/step_definitions/authentication_steps.rb:5 And I press "confirm" # features/step_definitions/web_steps.rb:52 no button with value or id or text 'confirm' found (Capybara::ElementNotFound) (eval):2:in `click_button' ./features/step_definitions/web_steps.rb:53:in `/^(?:|I )press "([^"]*)"$/' features/auth_and_auth/initial_tests.feature:9:in `And I press "confirm"' Then I should see "Your account has been created and you have been signed in!" # features/step_definitions/web_steps.rb:105 </code></pre> <p>relevant html output: </p> <pre><code>&lt;input id="confirm" name="confirm" text="confirm" title="confirm" type="submit" value="confirm"&gt; &lt;input id="cancel" name="cancel" text="cancel" title="cancel" type="submit" value="cancel"&gt; </code></pre> <p>As is obvious, I've accounted for <code>value</code>, <code>id</code>, <code>text</code>, as well as <code>name</code> and <code>title</code>. I also saw a post that said the input type had to be specified as <code>submit</code> which it appears to have been. And I've tried it with both the <code>confirm</code> button and the <code>cancel</code> button. </p> <p>After searching everywhere that I know about, and trying every suggestion that looked even remotely relevant, I'm at an impasse. What am I missing? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload