5

I'm trying to fill a wysihmlt5 textarea with Capybara-webkit (not sure if there is another way):

Capybara.default_driver = :webkit
page.execute_script %Q{ $('#wysihtml5-textarea').data("wysihtml5").editor.setValue('Lorem ipsum') }

But I get thsi error:

undefined|0|ReferenceError: Can't find variable: $
FQFont::setPixelSize: Pixel size <= 0 (0)

Failure/Error: page.execute_script %Q{ $('#wysihtml5-textarea').data("wysihtml5").editor.setValue('Lorem ipsum') }
     Capybara::Driver::Webkit::WebkitInvalidResponseError:
       Javascript failed to execute

What could be the problem?

alexchenco
  • 53,565
  • 76
  • 241
  • 413

1 Answers1

0

If this is the only thing you're using jQuery for, you could try

document.getElementById('wysihtml5-textarea');
MattyB
  • 909
  • 2
  • 9
  • 15