Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is the <code>:visible =&gt; true</code> option which is documented in <code>Capybara::Node::Matchers#has_xpath?</code> so:</p> <pre><code>Then /^I should see a datepicker$/ do page.should have_xpath(".//div[@id='ui-datepicker-div']", :visible =&gt; true) end </code></pre> <p>However, this may be a different problem but for me the datepicker does not appear at all when the capybara driven browser does not have focus, and so my test fails <em>(sometimes)</em>!</p> <p><strong>EDIT:</strong></p> <p>First of all it seems that the datepicker does not actually want a click on the field to trigger but a focus which unfortunately is unsupported by capybara's selenium driver and it does not trigger when you trigger a click but the browser has no focus.</p> <p>The correct way to trigger the focus would be:</p> <pre><code>find(".//div[@id='ui-datepicker-div']").trigger('focus') </code></pre> <p>but that raises a <code>Capybara::NotSupportedByDriverError</code> :(</p> <p>To workaround you can use the <em>hackish</em>:</p> <pre><code>When /I focus the graph start date/ do page.execute_script("$('#graph_start_date').focus()") end </code></pre> <p><strong>(thanks to: <a href="http://groups.google.com/group/ruby-capybara/msg/af6caeef01d978b0" rel="nofollow">http://groups.google.com/group/ruby-capybara/msg/af6caeef01d978b0</a>)</strong></p> <p>There are various discussions and relevant issues on this in Google Groups:</p> <ul> <li><a href="http://groups.google.com/group/ruby-capybara/browse_thread/thread/64b96cb15cda3f36" rel="nofollow">http://groups.google.com/group/ruby-capybara/browse_thread/thread/64b96cb15cda3f36</a></li> <li><a href="http://groups.google.com/group/ruby-capybara/browse_thread/thread/e7e88b2d8ab3b61e" rel="nofollow">http://groups.google.com/group/ruby-capybara/browse_thread/thread/e7e88b2d8ab3b61e</a></li> <li><a href="http://groups.google.com/group/ruby-capybara/browse_thread/thread/ebcdad1a084f57a8" rel="nofollow">http://groups.google.com/group/ruby-capybara/browse_thread/thread/ebcdad1a084f57a8</a></li> <li><a href="http://code.google.com/p/selenium/issues/detail?id=543" rel="nofollow">http://code.google.com/p/selenium/issues/detail?id=543</a></li> <li><a href="http://code.google.com/p/selenium/issues/detail?id=157" rel="nofollow">http://code.google.com/p/selenium/issues/detail?id=157</a></li> </ul>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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