Class: Applitools::Selenium::Target
- Inherits:
-
Object
- Object
- Applitools::Selenium::Target
- Defined in:
- lib/applitools/selenium/target.rb
Instance Attribute Summary collapse
-
#coordinate_type ⇒ Object
Returns the value of attribute coordinate_type.
-
#element ⇒ Object
Returns the value of attribute element.
-
#frames ⇒ Object
Returns the value of attribute frames.
-
#ignored_regions ⇒ Object
Returns the value of attribute ignored_regions.
-
#options ⇒ Object
Returns the value of attribute options.
-
#region_to_check ⇒ Object
Returns the value of attribute region_to_check.
Class Method Summary collapse
Instance Method Summary collapse
- #float(*_) ⇒ Object
- #frame(element) ⇒ Object
- #fully ⇒ Object
-
#ignore(*args) ⇒ Object
Add the wanted ignored regions.
-
#initialize ⇒ Target
constructor
Initialize a Applitools::Selenium::Target instance.
-
#region(*args) ⇒ Applitools::Selenium::Target
Add the desired region.
- #timeout(value) ⇒ Object
- #trim ⇒ Object
Constructor Details
#initialize ⇒ Target
Initialize a Applitools::Selenium::Target instance.
17 18 19 20 21 |
# File 'lib/applitools/selenium/target.rb', line 17 def initialize self.frames = [] self. = {} reset_for_fullscreen end |
Instance Attribute Details
#coordinate_type ⇒ Object
Returns the value of attribute coordinate_type.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def coordinate_type @coordinate_type end |
#element ⇒ Object
Returns the value of attribute element.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def element @element end |
#frames ⇒ Object
Returns the value of attribute frames.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def frames @frames end |
#ignored_regions ⇒ Object
Returns the value of attribute ignored_regions.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def ignored_regions @ignored_regions end |
#options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def @options end |
#region_to_check ⇒ Object
Returns the value of attribute region_to_check.
14 15 16 |
# File 'lib/applitools/selenium/target.rb', line 14 def region_to_check @region_to_check end |
Class Method Details
.region(element) ⇒ Object
9 10 11 |
# File 'lib/applitools/selenium/target.rb', line 9 def region(element) new.region(element) end |
.window ⇒ Object
5 6 7 |
# File 'lib/applitools/selenium/target.rb', line 5 def window new end |
Instance Method Details
#float(*_) ⇒ Object
45 46 47 |
# File 'lib/applitools/selenium/target.rb', line 45 def float(*_) self end |
#frame(element) ⇒ Object
59 60 61 62 63 |
# File 'lib/applitools/selenium/target.rb', line 59 def frame(element) frames << element reset_for_fullscreen self end |
#fully ⇒ Object
49 50 51 52 |
# File 'lib/applitools/selenium/target.rb', line 49 def fully [:stitch_content] = true self end |
#ignore(*args) ⇒ Object
Add the wanted ignored regions.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/applitools/selenium/target.rb', line 28 def ignore(*args) if args.first ignored_regions << if args.first.is_a? Applitools::Selenium::Element proc do args.first end else proc do |driver| driver.find_element(*args) end end else reset_ignore end self end |
#region(*args) ⇒ Applitools::Selenium::Target
Add the desired region.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/applitools/selenium/target.rb', line 71 def region(*args) self.region_to_check = if args.first.is_a? Applitools::Selenium::Element proc do args.first end else proc do |driver| driver.find_element(*args) end end self.coordinate_type = Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative] [:timeout] = nil reset_ignore self end |
#timeout(value) ⇒ Object
54 55 56 57 |
# File 'lib/applitools/selenium/target.rb', line 54 def timeout(value) [:timeout] = value self end |
#trim ⇒ Object
87 88 89 90 |
# File 'lib/applitools/selenium/target.rb', line 87 def trim [:trim] = true self end |