teamcapybara / capybara

Acceptance test framework for web applications

Home Page:http://teamcapybara.github.io/capybara/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: click_on should expand details/summary

jcoyne opened this issue · comments

Given HTML like this:

<details>
  <summary>Details</summary>
  Something small enough to escape casual notice.
</details>

Then I should be able to write capybara like this:

click_on 'Details'
assert page.has_content?('Something small')

But currently this will give the error:

     Failure/Error: click_on "Details"

     Capybara::ElementNotFound:
       Unable to find link or button "Details"

Currently I have to work around by doing:

find('details:first-of-type > summary').click

This does seem possible in the rack-test driver(0783f95) but I would like to do the same in selenium.

Pretty sure this is tested for in the node tests. What's the difference between your use case and what's tested there

@twalpole I'm not sure what tests you are referring to. Can you point me there?

it 'works when details is toggled open and closed' do

Rereading the initial submission, I realize I completely misread this. You're asking for 'summary' elements to be treated the same as links/buttons by click_on (which is what the documentation specifically identifies it to act on). I'm not sure changing the current behavior of click_on makes sense, and would be a potentially breaking change