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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -