Class: TestCentricity::ScreenManager

Inherits:
Object
  • Object
show all
Defined in:
lib/testcentricity_apps.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#current_screenObject

Returns the value of attribute current_screen.



35
36
37
# File 'lib/testcentricity_apps.rb', line 35

def current_screen
  @current_screen
end

Class Method Details

.current_screenScreenObject

Get the currently active ScreenObject

Examples:

active_screen = TestCentricity::ScreenManager.current_screen

Returns:



66
67
68
# File 'lib/testcentricity_apps.rb', line 66

def self.current_screen
  @current_screen
end

.current_screen=(screen) ⇒ Object

Sets the currently active ScreenObject

Examples:

TestCentricity::ScreenManager.current_screen = product_search_screen

Parameters:

  • screen (ScreenObject)

    Reference to the active ScreenObject



76
77
78
# File 'lib/testcentricity_apps.rb', line 76

def self.current_screen=(screen)
  @current_screen = screen
end

.find_screen(screen_name) ⇒ Object



53
54
55
56
57
58
# File 'lib/testcentricity_apps.rb', line 53

def self.find_screen(screen_name)
  screen_id = (screen_name.is_a? String) ? screen_name.gsub(/\s+/, '').downcase.to_sym : screen_name
  screen = @screen_objects[screen_id]
  raise "No screen object defined for screen named '#{screen_name}'" unless screen
  screen
end

.loaded?Boolean

Have all ScreenObjects been registered?

Examples:

TestCentricity::ScreenManager.loaded?

Returns:

  • (Boolean)

    true if all ScreenObjects have been registered



49
50
51
# File 'lib/testcentricity_apps.rb', line 49

def self.loaded?
  !@screen_objects.empty?
end

.register_screen_objects(screens) ⇒ Object



39
40
41
# File 'lib/testcentricity_apps.rb', line 39

def self.register_screen_objects(screens)
  @screen_objects = screens
end