Module: CapybaraErrorIntel::DSL

Defined in:
lib/capybara_error_intel/dsl.rb

Overview

Wraps Capybara::DSL

Instance Method Summary collapse

Instance Method Details

#has_button?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/capybara_error_intel/dsl.rb', line 13

def has_button?(locator, options = {})
  has_selector?(:button, locator, options)
end

#has_checked_field?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/capybara_error_intel/dsl.rb', line 25

def has_checked_field?(locator, options = {})
  has_selector?(:field, locator, options.merge(checked: true))
end

#has_css?(css, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/capybara_error_intel/dsl.rb', line 9

def has_css?(css, options = {})
  has_selector?(:css, css, options)
end

#has_field?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/capybara_error_intel/dsl.rb', line 17

def has_field?(locator, options = {})
  has_selector?(:field, locator, options)
end

#has_select?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/capybara_error_intel/dsl.rb', line 33

def has_select?(locator, options = {})
  has_selector?(:select, locator, options)
end

#has_selector?(*args) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/capybara_error_intel/dsl.rb', line 4

def has_selector?(*args)
  matcher = has_selector(*args)
  match_or_error(matcher)
end

#has_table?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/capybara_error_intel/dsl.rb', line 37

def has_table?(locator, options = {})
  has_selector?(:table, locator, options)
end

#has_text?(*args) ⇒ Boolean Also known as: has_content?

Returns:

  • (Boolean)


41
42
43
44
# File 'lib/capybara_error_intel/dsl.rb', line 41

def has_text?(*args)
  matcher = has_text(*args)
  match_or_error(matcher)
end

#has_title?(title, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
# File 'lib/capybara_error_intel/dsl.rb', line 47

def has_title?(title, options = {})
  matcher = has_title(title, options)
  match_or_error(matcher)
end

#has_unchecked_field?(locator, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/capybara_error_intel/dsl.rb', line 29

def has_unchecked_field?(locator, options = {})
  has_selector?(:field, locator, options.merge(unchecked: true))
end

#has_xpath?(_xpath, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/capybara_error_intel/dsl.rb', line 21

def has_xpath?(_xpath, options = {})
  has_selector?(:xpath, locator, options)
end