Class: Applitools::MatchWindowData

Inherits:
Object
  • Object
show all
Defined in:
lib/eyes_selenium/eyes/match_window_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MatchWindowData.



4
5
6
7
8
9
10
# File 'lib/eyes_selenium/eyes/match_window_data.rb', line 4

def initialize(app_output,user_inputs=[], tag, ignore_mismatch, screenshot)
  @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/eyes_selenium/eyes/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/eyes_selenium/eyes/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/eyes_selenium/eyes/match_window_data.rb', line 3

def screenshot
  @screenshot
end

#tagObject (readonly)

Returns the value of attribute tag.



3
4
5
# File 'lib/eyes_selenium/eyes/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/eyes_selenium/eyes/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 purspose! The screenshot should not be included as part of the json.



14
15
16
17
# File 'lib/eyes_selenium/eyes/match_window_data.rb', line 14

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