Module: Applitools::FluentInterface

Includes:
MatchLevelSetter
Included in:
Calabash::Target
Defined in:
lib/applitools/core/fluent_interface.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MatchLevelSetter

#match_level_with_exact

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
# File 'lib/applitools/core/fluent_interface.rb', line 5

def self.included(base)
  base.define_singleton_method(:===) do |other|
    return name == other if other.is_a? String
    super(other)
  end
end

Instance Method Details

#ignore_caret(value = false) ⇒ Object



12
13
14
15
# File 'lib/applitools/core/fluent_interface.rb', line 12

def ignore_caret(value = false)
  options[:ignore_caret] = value ? true : false
  self
end

#ignore_mismatch(value) ⇒ Object



27
28
29
30
# File 'lib/applitools/core/fluent_interface.rb', line 27

def ignore_mismatch(value)
  options[:ignore_mismatch] = value ? true : false
  self
end

#match_level(value, exact_options = {}) ⇒ Target

Sets match_level for current test

Parameters:

  • value (Symbol)

    Can be one of allowed match levels - :none, :layout, :layout2, :content, :strict or :exact

  • exact_options (Hash) (defaults to: {})

    exact options are used only for :exact match level

Options Hash (exact_options):

  • :min_diff_intensity (Integer)
  • :min_diff_width (Integer)
  • :min_diff_height (Integer)
  • :match_threshold (Integer)

Returns:

  • (Target)

    Applitools::Selenium::Target or Applitools::Images::target



41
42
43
44
# File 'lib/applitools/core/fluent_interface.rb', line 41

def match_level(value, exact_options = {})
  options[:match_level], options[:exact] = match_level_with_exact(value, exact_options)
  self
end

#timeout(value) ⇒ Object



17
18
19
20
# File 'lib/applitools/core/fluent_interface.rb', line 17

def timeout(value)
  options[:timeout] = value.to_i
  self
end

#trim(value = true) ⇒ Object



22
23
24
25
# File 'lib/applitools/core/fluent_interface.rb', line 22

def trim(value = true)
  options[:trim] = value ? true : false
  self
end