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

后端 未结 4 800
灰色年华
灰色年华 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:53

    Try to switch to an iframe that contains tinymce textarea input, and than send_keys:

    # +session+ is an instance of Capybara::Session class
    browser = session.driver.browser
    browser.switch_to.frame(iframe_id)
    editor.native.send_keys(text)
    browser.switch_to.default_content
    

提交回复
热议问题