I'd like to ask your opinion about using jQuery in Capybara specs. Is it really simulating the real user interaction, or is it faking it?
- Is using
find("#my_checkbox[value='1']").set(true)
the same aspage.execute_script("$('#my_checkbox').prop('checked', true);")?
- Or
find("#my_button").click
the same aspage.execute_script("$('#my_button').click();")?
I know that the spec result will be the same, but I'm really wondering:
- the real user won't use the JS browser's console to click on a button, so should we just replicate that without using
jQueryin the specs? - what about the spec's performance and speed? Is there any advantage on using
jQuery?
Aucun commentaire:
Enregistrer un commentaire