【问题标题】:Ruby - Capybara - ArgumentError: invalid keysRuby - Capybara - ArgumentError:无效键
【发布时间】:2019-08-17 00:02:38
【问题描述】:

我正在执行一个代码,我验证输入是否被禁用,但发生错误。

代码

before(:each) do
    visit 'https://training-wheels-protocol.herokuapp.com/dynamic_controls'
end

it 'quando habilita o campo' do
    res = page.has_field? 'movie', disable: true
    puts res
end 

错误

 ArgumentError:
   invalid keys :disable, should be one of :count, :minimum, :maximum, :between, :text, :id, :class, :style, :visible, :exact, :exact_text, :normalize_ws, :match, :wait, :filter_set, :checked, :unchecked, :disabled, :multiple, :readonly, :with, :type, :name, :placeholder
 # ./spec/dynamic_control_spec.rb:8:in `block (2 levels) in <top (required)>'

有人可以帮我吗?

【问题讨论】:

    标签: ruby rspec capybara


    【解决方案1】:

    错误消息告诉您哪些选项可以传递给has_field?。您应该传递 disabled: true 而不是 :disable。

    【讨论】:

      猜你喜欢
      • 2014-02-16
      • 2012-06-19
      • 2012-12-11
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-16
      相关资源
      最近更新 更多