I have a tab-panes by Twitter-Bootstrap on my page. How can I test with Capybara that getting the page like "/pages/1#some_tab" the "some_tab" tab-pane is opening?
Asked
Active
Viewed 957 times
1

James Allardice
- 164,175
- 21
- 332
- 312

immaculate.pine
- 151
- 12
-
For a related issue with poltergeist, see http://stackoverflow.com/questions/11340038/phantomjs-not-waiting-for-full-page-load – Jared Beck Dec 24 '13 at 20:01
1 Answers
1
page.has_selector?('div', :text => 'something in my tab', :visible => true)
The key is adding the visible => true option.

Matt Van Horn
- 1,654
- 1
- 11
- 21
-
It seems that it doesn't work for me. My test passes both with "visible: true" and "visible: false" when there is required selector anywhere on page. I use this line to test: `page.should have_selector('a', text: "New task", visible: true)` – immaculate.pine Jun 23 '12 at 22:43