Class: Applitools::Appium::Target

Inherits:
Object
  • Object
show all
Includes:
FluentInterface
Defined in:
lib/applitools/appium/target.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FluentInterface

#enable_patterns, #ignore_caret, #ignore_displacements, #ignore_mismatch, included, #match_level, #timeout, #trim

Methods included from MatchLevelSetter

#match_level_with_exact

Constructor Details

#initializeTarget

Returns a new instance of Target.



20
21
22
23
# File 'lib/applitools/appium/target.rb', line 20

def initialize
  self.region_to_check = proc { Applitools::Region::EMPTY }
  self.options = {}
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/applitools/appium/target.rb', line 8

def options
  @options
end

#region_to_checkObject

Returns the value of attribute region_to_check.



8
9
10
# File 'lib/applitools/appium/target.rb', line 8

def region_to_check
  @region_to_check
end

Class Method Details

.region(*args) ⇒ Object



15
16
17
# File 'lib/applitools/appium/target.rb', line 15

def region(*args)
  new.region(*args)
end

.windowObject



11
12
13
# File 'lib/applitools/appium/target.rb', line 11

def window
  new
end

Instance Method Details

#finalizeObject



37
38
39
# File 'lib/applitools/appium/target.rb', line 37

def finalize
  self
end

#region(*args) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/applitools/appium/target.rb', line 25

def region(*args)
  self.region_to_check = case args.first
                         when ::Selenium::WebDriver::Element
                           proc { args.first }
                         else
                           proc do |driver|
                             driver.find_element(*args)
                           end
                         end
  self
end