Class: Applitools::Calabash::CalabashElement
- Inherits:
-
Object
- Object
- Applitools::Calabash::CalabashElement
- Extended by:
- Forwardable
- Defined in:
- lib/applitools/calabash/calabash_element.rb
Instance Attribute Summary collapse
-
#element_query ⇒ Object
readonly
Returns the value of attribute element_query.
-
#original_element ⇒ Object
readonly
Returns the value of attribute original_element.
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(element, element_query) ⇒ CalabashElement
constructor
A new instance of CalabashElement.
- #left ⇒ Object (also: #x)
- #location ⇒ Object
- #region ⇒ Object
- #size ⇒ Object
- #to_s ⇒ Object
- #top ⇒ Object (also: #y)
- #width ⇒ Object
Constructor Details
#initialize(element, element_query) ⇒ CalabashElement
Returns a new instance of CalabashElement.
10 11 12 13 14 |
# File 'lib/applitools/calabash/calabash_element.rb', line 10 def initialize(element, element_query) raise Applitools::EyesIllegalArgument, "Invalid element passed! (#{element})" unless valid_element?(element) @original_element = element @element_query = element_query end |
Instance Attribute Details
#element_query ⇒ Object (readonly)
Returns the value of attribute element_query.
7 8 9 |
# File 'lib/applitools/calabash/calabash_element.rb', line 7 def element_query @element_query end |
#original_element ⇒ Object (readonly)
Returns the value of attribute original_element.
7 8 9 |
# File 'lib/applitools/calabash/calabash_element.rb', line 7 def original_element @original_element end |
Instance Method Details
#height ⇒ Object
32 33 34 |
# File 'lib/applitools/calabash/calabash_element.rb', line 32 def height self['rect']['height'] end |
#left ⇒ Object Also known as: x
16 17 18 |
# File 'lib/applitools/calabash/calabash_element.rb', line 16 def left self['rect']['x'] end |
#location ⇒ Object
36 37 38 |
# File 'lib/applitools/calabash/calabash_element.rb', line 36 def location Applitools::Location.from_struct(self) end |
#region ⇒ Object
44 45 46 |
# File 'lib/applitools/calabash/calabash_element.rb', line 44 def region Applitools::Region.from_location_size(location, size) end |
#size ⇒ Object
40 41 42 |
# File 'lib/applitools/calabash/calabash_element.rb', line 40 def size Applitools::RectangleSize.from_struct(self) end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/applitools/calabash/calabash_element.rb', line 48 def to_s @original_element end |
#top ⇒ Object Also known as: y
22 23 24 |
# File 'lib/applitools/calabash/calabash_element.rb', line 22 def top self['rect']['y'] end |
#width ⇒ Object
28 29 30 |
# File 'lib/applitools/calabash/calabash_element.rb', line 28 def width self['rect']['width'] end |