Module: ScreenObject::ScreenFactory
- Includes:
- PageNavigation
- Defined in:
- lib/screen-object/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
Instance Method Details
#on(screen_class, &blk) ⇒ Object
36 37 38 39 40 |
# File 'lib/screen-object/screen_factory.rb', line 36 def on(screen_class, &blk) @current_screen = screen_class.new blk.call @current_screen if blk @current_screen end |