Class: Applitools::Selenium::MatchWindowData

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/selenium/match_window_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_output, tag, ignore_mismatch, screenshot, user_inputs = []) ⇒ MatchWindowData

Returns a new instance of MatchWindowData.



5
6
7
8
9
10
11
# File 'lib/applitools/selenium/match_window_data.rb', line 5

def initialize(app_output, tag, ignore_mismatch, screenshot, user_inputs = [])
  @user_inputs = user_inputs
  @app_output = app_output
  @tag = tag
  @ignore_mismatch = ignore_mismatch
  @screenshot = screenshot
end

Instance Attribute Details

#app_outputObject (readonly)

Returns the value of attribute app_output.



3
4
5
# File 'lib/applitools/selenium/match_window_data.rb', line 3

def app_output
  @app_output
end

#ignore_mismatchObject (readonly)

Returns the value of attribute ignore_mismatch.



3
4
5
# File 'lib/applitools/selenium/match_window_data.rb', line 3

def ignore_mismatch
  @ignore_mismatch
end

#screenshotObject (readonly)

Returns the value of attribute screenshot.



3
4
5
# File 'lib/applitools/selenium/match_window_data.rb', line 3

def screenshot
  @screenshot
end

#tagObject (readonly)

Returns the value of attribute tag.



3
4
5
# File 'lib/applitools/selenium/match_window_data.rb', line 3

def tag
  @tag
end

#user_inputsObject (readonly)

Returns the value of attribute user_inputs.



3
4
5
# File 'lib/applitools/selenium/match_window_data.rb', line 3

def user_inputs
  @user_inputs
end

Instance Method Details

#to_hashObject

IMPORTANT This method returns a hash WITHOUT the screenshot property. This is on purpose! The screenshot should not be included as part of the json.



15
16
17
18
19
20
21
22
# File 'lib/applitools/selenium/match_window_data.rb', line 15

def to_hash
  {
    user_inputs: user_inputs.map(&:to_hash),
    app_output: Hash[app_output.each_pair.to_a],
    tag: @tag,
    ignore_mismatch: @ignore_mismatch
  }
end