rspec - Capybara have_selector is not working -


on view have checkbox

<input type="checkbox" id="modal-checkbox" class="painter-modal-checkbox" data-reactid=".1.1:1.0.0"> 

on capybara code trying use have_selector method

expect(page).to have_selector("#modal-checkbox") 

this fails, when tracing page

print page.html 

i can confirm html code there, why test fails.

this because field isn't visible because it's hidden via css. checkboxes because design calls label used show selected state of checkbox while actual checkbox hidden. check if visibility issue can pass visible: false have_selector, 99% of time shouldn't checking invisible items since user wouldn't able see them or interact them


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -