【问题标题】:capybara & rspec fill_in does not fill all characterscapybara & rspec fill_in 不填充所有字符
【发布时间】:2018-04-22 10:11:19
【问题描述】:

简单的 rspec 测试:

it "should login" do
   fill_in 'email', with: 'tom@domain.com'
   fill_in 'password', with: '123456'
   click_on I18n.t('ui.pages.login')

   expect(current_path).to eq('/projects')
end

问题是:Chrome 只输入“12456”并跳过“3”——不管我做什么。

我尝试了以下方法:

  1. 在电子邮件填写后设置睡眠时间
  2. 使用 ID (id="password") 显式命名电子邮件字段

对两者都没有影响,仍然没有输入所有字符。

我的设置:

  • 使用水豚2.15.4
  • 使用 rspec-core 3.7.0 使用
  • chromedriver-helper 1.1.0
  • 使用 selenium-webdriver 3.7.0

【问题讨论】:

    标签: rspec capybara


    【解决方案1】:

    您可能正在经历https://bugs.chromium.org/p/chromedriver/issues/detail?id=1771&q=sendKeys&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary - 如果您可以生成一个简单的示例来复制该问题,我相信 chromedriver 作者会很感激。

    除此之外,请确保您已更新到最新版本的 chromedriver。由于您使用的是chromedriver-helper,这意味着遵循这些说明 - https://github.com/flavorjones/chromedriver-helper#updating-to-latest-chromedriver

    【讨论】:

      猜你喜欢
      • 2014-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多