Module: Howitzer::Utils::StringExtensions
- Defined in:
- lib/howitzer/utils/string_extensions.rb
Overview
This module extends standard String class with useful methods for Cucumber step definitions
Instance Method Summary collapse
-
#as_email_class ⇒ Object
Returns an email class by name.
-
#as_page_class ⇒ Object
Returns a page class by name.
-
#displayed? ⇒ Boolean
Waits until a page is opened or raises error.
-
#given ⇒ Object
Returns an instantiated page by name.
-
#on(&block) ⇒ Object
Executes code in context of the page.
-
#open(*args, **options) ⇒ Object
Opens a page by name.
Instance Method Details
#as_email_class ⇒ Object
Returns an email class by name
50 51 52 |
# File 'lib/howitzer/utils/string_extensions.rb', line 50 def as_email_class as_class('Email') end |
#as_page_class ⇒ Object
Returns a page class by name
41 42 43 |
# File 'lib/howitzer/utils/string_extensions.rb', line 41 def as_page_class as_class('Page') end |
#displayed? ⇒ Boolean
Waits until a page is opened or raises error
32 33 34 |
# File 'lib/howitzer/utils/string_extensions.rb', line 32 def displayed? as_page_class.displayed? end |
#given ⇒ Object
Returns an instantiated page by name
23 24 25 |
# File 'lib/howitzer/utils/string_extensions.rb', line 23 def given as_page_class.given end |
#on(&block) ⇒ Object
Executes code in context of the page
59 60 61 |
# File 'lib/howitzer/utils/string_extensions.rb', line 59 def on(&block) as_page_class.on(&block) end |
#open(*args, **options) ⇒ Object
Opens a page by name
10 11 12 13 14 15 16 |
# File 'lib/howitzer/utils/string_extensions.rb', line 10 def open(*args, **) if .present? as_page_class.open(*args, **) else as_page_class.open(*args) end end |