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) ⇒ Object
Opens a page by name.
Instance Method Details
#as_email_class ⇒ Object
Returns an email class by name
46 47 48 |
# File 'lib/howitzer/utils/string_extensions.rb', line 46 def as_email_class as_class('Email') end |
#as_page_class ⇒ Object
Returns a page class by name
37 38 39 |
# File 'lib/howitzer/utils/string_extensions.rb', line 37 def as_page_class as_class('Page') end |
#displayed? ⇒ Boolean
Waits until a page is opened or raises error
28 29 30 |
# File 'lib/howitzer/utils/string_extensions.rb', line 28 def displayed? as_page_class.displayed? end |
#given ⇒ Object
Returns an instantiated page by name
19 20 21 |
# File 'lib/howitzer/utils/string_extensions.rb', line 19 def given as_page_class.given end |
#on(&block) ⇒ Object
Executes code in context of the page
55 56 57 |
# File 'lib/howitzer/utils/string_extensions.rb', line 55 def on(&block) as_page_class.on(&block) end |
#open(*args) ⇒ Object
Opens a page by name
10 11 12 |
# File 'lib/howitzer/utils/string_extensions.rb', line 10 def open(*args) as_page_class.open(*args) end |