class RuboCop::Cop::RSpec::Capybara::VisibilityMatcher


expect(page).to have_link(‘my link’, visible: :hidden)
expect(page).to have_css(‘.foo’, visible: :all)
expect(page).to have_selector(‘.foo’, visible: :visible)
# good
expect(page).to have_link(‘my link’, visible: false)
expect(page).to have_css(‘.foo’, visible: true)
expect(page).to have_selector(‘.foo’, visible: false)
# bad
@example
(www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all)
symbol values, ‘:all`, `:hidden` or `:visible`.
invisible elements. For expressiveness and clarity, use one of the
false` does not find just invisible elements, but both visible and
values, however using booleans can have unwanted effects. `visible:
the `:visible` option. `:visible` accepts both boolean and symbols as
Capybara lets you find elements that match a certain visibility using
Checks for boolean visibility in capybara finders.

def capybara_matcher?(method_name)

def capybara_matcher?(method_name)
  CAPYBARA_MATCHER_METHODS.include? method_name
end

def on_send(node)

def on_send(node)
  visible_false?(node) { |arg| add_offense(arg, message: MSG_FALSE) }
  visible_true?(node) { |arg| add_offense(arg, message: MSG_TRUE) }
end