2012-06-23 55 views
1

我的頁面上有Twitter-Bootstrap的選項卡窗格。我如何測試水豚,得到像「/頁/ 1#some_tab」的頁面「some_tab」標籤頁正在打開?如何測試Twitter-Bootstrap選項卡與Capybara打開?

+0

對於與poltergeist相關的問題,請參閱http://stackoverflow.com/questions/11340038/phantomjs-not-waiting-for-full-page-load –

回答

1
page.has_selector?('div', :text => 'something in my tab', :visible => true) 

關鍵是添加visible => true選項。

+0

看來它不適合我。當需要選擇頁面上的任何位置時,我的測試會同時傳遞「visible:true」和「visible:false」。我使用這一行來測試:'page.should have_selector('a',text:「New task」,visible:true)' –

相關問題