Class: Applitools::AppOutput
- Inherits:
-
Object
- Object
- Applitools::AppOutput
- Defined in:
- lib/applitools/core/app_output.rb
Instance Attribute Summary collapse
-
#dom_url ⇒ Object
Returns the value of attribute dom_url.
-
#dom_url_getter ⇒ Object
readonly
Returns the value of attribute dom_url_getter.
-
#location ⇒ Object
Returns the value of attribute location.
-
#screenshot64 ⇒ Object
readonly
Returns the value of attribute screenshot64.
-
#screenshot_url ⇒ Object
Returns the value of attribute screenshot_url.
-
#screenshot_url_getter ⇒ Object
readonly
Returns the value of attribute screenshot_url_getter.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#visual_viewport ⇒ Object
Returns the value of attribute visual_viewport.
Instance Method Summary collapse
-
#initialize(title, screenshot64) ⇒ AppOutput
constructor
A new instance of AppOutput.
- #on_need_dom_url(&block) ⇒ Object
- #on_need_screenshot_url(&block) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(title, screenshot64) ⇒ AppOutput
Returns a new instance of AppOutput.
9 10 11 12 13 14 15 |
# File 'lib/applitools/core/app_output.rb', line 9 def initialize(title, screenshot64) @title = title @screenshot64 = screenshot64 @location = Applitools::Location::TOP_LEFT @screenshot_url_getter = nil @dom_url_getter = nil end |
Instance Attribute Details
#dom_url ⇒ Object
Returns the value of attribute dom_url.
7 8 9 |
# File 'lib/applitools/core/app_output.rb', line 7 def dom_url @dom_url end |
#dom_url_getter ⇒ Object (readonly)
Returns the value of attribute dom_url_getter.
5 6 7 |
# File 'lib/applitools/core/app_output.rb', line 5 def dom_url_getter @dom_url_getter end |
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'lib/applitools/core/app_output.rb', line 5 def location @location end |
#screenshot64 ⇒ Object (readonly)
Returns the value of attribute screenshot64.
5 6 7 |
# File 'lib/applitools/core/app_output.rb', line 5 def screenshot64 @screenshot64 end |
#screenshot_url ⇒ Object
Returns the value of attribute screenshot_url.
7 8 9 |
# File 'lib/applitools/core/app_output.rb', line 7 def screenshot_url @screenshot_url end |
#screenshot_url_getter ⇒ Object (readonly)
Returns the value of attribute screenshot_url_getter.
5 6 7 |
# File 'lib/applitools/core/app_output.rb', line 5 def screenshot_url_getter @screenshot_url_getter end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/applitools/core/app_output.rb', line 5 def title @title end |
#visual_viewport ⇒ Object
Returns the value of attribute visual_viewport.
7 8 9 |
# File 'lib/applitools/core/app_output.rb', line 7 def @visual_viewport end |
Instance Method Details
#on_need_dom_url(&block) ⇒ Object
26 27 28 |
# File 'lib/applitools/core/app_output.rb', line 26 def on_need_dom_url(&block) @dom_url_getter = block if block_given? end |
#on_need_screenshot_url(&block) ⇒ Object
22 23 24 |
# File 'lib/applitools/core/app_output.rb', line 22 def on_need_screenshot_url(&block) @screenshot_url_getter = block if block_given? end |
#to_hash ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/applitools/core/app_output.rb', line 34 def to_hash result = { Title: title, Screenshot64: nil, Location: location.to_hash, ScreenshotUrl: screenshot_url || (screenshot_url_getter && screenshot_url_getter.call) } result[:DomUrl] = dom_url if dom_url result[:visualViewport] = if result end |