使用TextAngular为AngularJS/ Rails
环境中的富文本输入框。水豚一体化测试'TextAngular'输入
运行集成测试Capybara/Selenium & Capybara-Webkit
。 试图创建一个集成测试,将文本输入文本区域进行测试。但是,我无法成功地做到这一点。
阻止我的事情是文本输入框ID在测试加载或页面加载时发生变化。所以我使用了下面的类,它在文本角度测试中使用。随着:
find('textarea.ta-html.ta-editor')
我用这个,因为我知道它的作品和JavaScript测试书面文字角使用此。 text angular github tests
然而,当我试着和文本值设置文本区域:
find('textarea.ta-html.ta-editor').set("Upgraded to SSD")
我得到:
Failure/Error: find('textarea.ta-html.ta-editor').set("Upgraded to SSD")
Selenium::WebDriver::Error::ElementNotVisibleError: Element is not currently visible and so may not be interacted with
如何设置使用Capybara
文本区域的值?
汤姆灿烂和干净的解决方案。可以使用Capybara/Selenium设置文本:find('div.ta-text.ta-editor div [contenteditable]')。set(“Upgraded to SSD”) – orion