Exception: Appom::ElementStateError

Inherits:
ElementError show all
Defined in:
lib/appom/exceptions.rb

Overview

Raised when an element is found but not in the expected state

Instance Attribute Summary

Attributes inherited from AppomError

#context

Instance Method Summary collapse

Methods inherited from AppomError

#detailed_message

Constructor Details

#initialize(element_name, expected_state, actual_state = nil) ⇒ ElementStateError

Returns a new instance of ElementStateError.



49
50
51
52
53
# File 'lib/appom/exceptions.rb', line 49

def initialize(element_name, expected_state, actual_state = nil)
  message = "Element '#{element_name}' expected to be #{expected_state}"
  message += " but was #{actual_state}" if actual_state
  super(message, { element: element_name, expected: expected_state, actual: actual_state })
end