Class: Maze::Hooks::ErrorCodeHook

Inherits:
Object
  • Object
show all
Defined in:
lib/maze/hooks/error_code_hook.rb

Overview

Registers an exit hook that will process the reason for an early exit and provide a suitable error code. Error code sets and specific code meanings are as follows:

1*: An error has occurred within browser or device drivers:
  10: An unknown error has occurred
  11: An expected UI element was missing
  12: A UI element was missing at time of interaction
  13: A command sent to the remote server timed out
  14: An element was present but did not accept interaction
2*: Errors relating to potential network, test server, or payload issues
  21: Expected payload(s) was not received
  22: A command was not read by the test fixture

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.exit_codeObject

Returns the value of attribute exit_code.



19
20
21
# File 'lib/maze/hooks/error_code_hook.rb', line 19

def exit_code
  @exit_code
end

.last_test_error_classObject

Returns the value of attribute last_test_error_class.



20
21
22
# File 'lib/maze/hooks/error_code_hook.rb', line 20

def last_test_error_class
  @last_test_error_class
end

Class Method Details

.register_exit_code_hookObject



22
23
24
25
26
27
28
# File 'lib/maze/hooks/error_code_hook.rb', line 22

def register_exit_code_hook
  return if @registered
  at_exit do
    exit_hook
  end
  @registered = true
end