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
-
#initialize ⇒ Target
constructor
A new instance of Target.
- #region(*args) ⇒ Object
- #timeout(value) ⇒ Object
- #trim ⇒ Object
Constructor Details
#initialize ⇒ Target
Returns a new instance of Target.
16 17 18 19 20 |
# File 'lib/applitools/selenium/target.rb', line 16 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 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
39 40 41 |
# File 'lib/applitools/selenium/target.rb', line 39 def float(*_) self end |
#frame(element) ⇒ Object
53 54 55 56 57 |
# File 'lib/applitools/selenium/target.rb', line 53 def frame(element) frames << element reset_for_fullscreen self end |
#fully ⇒ Object
43 44 45 46 |
# File 'lib/applitools/selenium/target.rb', line 43 def fully [:stitch_content] = true self end |
#ignore(*args) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/applitools/selenium/target.rb', line 22 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) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/applitools/selenium/target.rb', line 59 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
48 49 50 51 |
# File 'lib/applitools/selenium/target.rb', line 48 def timeout(value) [:timeout] = value self end |
#trim ⇒ Object
75 76 77 78 |
# File 'lib/applitools/selenium/target.rb', line 75 def trim [:trim] = true self end |