How to fill tinymce-rails editor with capybara and selenium?

后端 未结 4 798
灰色年华
灰色年华 2021-02-08 05:05

I have trouble with using capybara to test tinymce form. I\'m using tinymce-rails and have 7 editors in my form. Also I\'m using asciimath plugin with tinymce.

Everythin

4条回答
  •  终归单人心
    2021-02-08 05:42

    I had the same issue. After a day fighting, my tests finally passed.

    The code that I am using is:

    within_frame("producto_condiciones_ifr") do
      editor = page.find_by_id('tinymce')
      editor.native.send_keys 'filling text'
    end
    

    The first line is a method of capybara. The parameter passed is the ID of the iframe.

    Line #2 is a must.

    In line #3 goes the text that you wish to place inside TinyMCE

提交回复
热议问题