Module: TE3270::ScreenFactory
- Includes:
- PageNavigation
- Defined in:
- lib/te3270/screen_factory.rb
Overview
Module to facilitate to creating of screen objects in step definitions. You can make the methods below available to all of your step definitions by adding this module to World.
If you plan to use the navigate_to
method you will need to ensure you setup the possible routes ahead of time. You must always have a default route in order for this to work. Here is an example of how you define routes:
Notice the first entry of :another_route is passing an argument to the method.
Instance Method Summary collapse
-
#on(screen_class, &block) ⇒ ScreenObject
Create a screen object.
Instance Method Details
#on(screen_class, &block) ⇒ ScreenObject
Create a screen object. Also sets an instance variable +@current_screen
41 42 43 44 45 46 47 |
# File 'lib/te3270/screen_factory.rb', line 41 def on(screen_class, &block) return super(screen_class, &block) unless screen_class.ancestors.include? TE3270 raise '@emulator instance variable must be available to use the ScreenFactory methods' unless @emulator @current_screen = screen_class.new @emulator block.call @current_screen if block @current_screen end |