如何用capybara和selenium填充tintomm-rails编辑器? [英] How to fill tinymce-rails editor with capybara and selenium?

查看:152
本文介绍了如何用capybara和selenium填充tintomm-rails编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用水ara测试tinymce形式时遇到问题。我使用 tinymce-rails 并在我的表单中有7个编辑器。

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.

一切正常,但我无法编写测试来填写tinymce编辑器。

Everything works fine, but I'm unable to write tests to fill in tinymce editor.

这里是我的步骤定义代码的样子,非常类似于此处

Here is how my step definition code looks like, very similar to what is described here:

within_frame("content_ifr") do
  editor = page.find_by_id('tinymce')
  editor.native.send_keys 'test'
end

问题是当我运行以下:

editor.native.clear            # works, clear the editor area, I'm testing this with pry
editor.native.send_keys :tab   # works, moves focus to next input
editor.native.send_keys 'test' # returns "", nothing happens, nothing in editor

因此清除 send_keys:tab 按预期工作。但我不能发送任何字符串。 send_keys 函数总是返回空字符串,当我使用pry测试时没有任何反应。

So clear and send_keys :tab work as expected. But I can't send any string. send_keys function is always returning empty string, and nothing happens when I do test using pry.

这里?如何调试/调查问题?

What is going wrong here? and how can I debug / investigate the problem?

谢谢。

推荐答案

p>切换到Chrome,如这里解决了我的问题。

Switching to chrome as described here solved my problem.

显然这个问题与firefox驱动程序中的错误有关。

Obviously the problem is related with a bug in firefox driver.

认为这是一个有效的问题为firefox。

Still i think it is a valid question for firefox.

这篇关于如何用capybara和selenium填充tintomm-rails编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆