After installing capybara-webkit, I tried to try a test inside a spec, here is my test:
Capybara.default_driver = :webkit
page.execute_script("$('#submit_direction').attr('value', '1');$('#quizForm').submit()")
Then, I get this error:
/home/sam/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:136:
warning: Insecure world writable dir /home/sam/Documents/RoR in PATH,
mode 040777 undefined|0|ReferenceError: Can’t find variable: $Capybara::Driver::Webkit::WebkitInvalidResponseError: Javascript
failed to execute
Any idea please ?
I’m guessing the capybara-webkit JS driver is a bit dodgy.
From the capybara github page:
However, from the code you have there, it looks like you can do quite a few things with Capybara itself.
could be replaced with:
and
could be replaced with:
see the capybara docs on capybara actions