Class: Applitools::AppOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/core/app_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject

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_getterObject (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

#locationObject

Returns the value of attribute location.



5
6
7
# File 'lib/applitools/core/app_output.rb', line 5

def location
  @location
end

#screenshot64Object (readonly)

Returns the value of attribute screenshot64.



5
6
7
# File 'lib/applitools/core/app_output.rb', line 5

def screenshot64
  @screenshot64
end

#screenshot_urlObject

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_getterObject (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

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/applitools/core/app_output.rb', line 5

def title
  @title
end

#visual_viewportObject

Returns the value of attribute visual_viewport.



7
8
9
# File 'lib/applitools/core/app_output.rb', line 7

def visual_viewport
  @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_hashObject



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] = visual_viewport if visual_viewport
  result
end