Exception: Appom::InvalidElementError

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

Overview

Raised when an element was defined without proper arguments

Instance Attribute Summary

Attributes inherited from AppomError

#context

Instance Method Summary collapse

Methods inherited from AppomError

#detailed_message

Constructor Details

#initialize(element_name = nil) ⇒ InvalidElementError

Returns a new instance of InvalidElementError.



25
26
27
28
29
30
31
32
33
34
# File 'lib/appom/exceptions.rb', line 25

def initialize(element_name = nil)
  if element_name.nil?
    message = 'You should provide search arguments in element creation'
  else
    message = 'Element'
    message += " '#{element_name}'" if element_name
    message += ' was defined without proper selector arguments'
  end
  super(message)
end