Class: Applitools::Appium::RegionProvider
- Inherits:
-
Object
- Object
- Applitools::Appium::RegionProvider
- Defined in:
- lib/applitools/appium/region_provider.rb
Instance Attribute Summary collapse
-
#coordinate_type ⇒ Object
Returns the value of attribute coordinate_type.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#eye_region ⇒ Object
Returns the value of attribute eye_region.
Instance Method Summary collapse
-
#initialize(driver, eye_region) ⇒ RegionProvider
constructor
A new instance of RegionProvider.
- #region ⇒ Object
Constructor Details
#initialize(driver, eye_region) ⇒ RegionProvider
Returns a new instance of RegionProvider.
8 9 10 11 |
# File 'lib/applitools/appium/region_provider.rb', line 8 def initialize(driver, eye_region) self.driver = driver self.eye_region = eye_region end |
Instance Attribute Details
#coordinate_type ⇒ Object
Returns the value of attribute coordinate_type.
6 7 8 |
# File 'lib/applitools/appium/region_provider.rb', line 6 def coordinate_type @coordinate_type end |
#driver ⇒ Object
Returns the value of attribute driver.
6 7 8 |
# File 'lib/applitools/appium/region_provider.rb', line 6 def driver @driver end |
#eye_region ⇒ Object
Returns the value of attribute eye_region.
6 7 8 |
# File 'lib/applitools/appium/region_provider.rb', line 6 def eye_region @eye_region end |
Instance Method Details
#region ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/applitools/appium/region_provider.rb', line 13 def region return Applitools::Region::EMPTY if [::Selenium::WebDriver::Element, Applitools::Selenium::Element].include? eye_region.class region = driver.session_capabilities['viewportRect'] Applitools::Region.new( region['left'], region['top'], region['width'], region['height'] ) end |