Method: PageObject::Accessors#expected_title
- Defined in:
- lib/page-object/accessors.rb
#expected_title(expected_title) ⇒ boolean
Creates a method that compares the expected_title of a page against the actual.
92 93 94 95 96 97 98 99 |
# File 'lib/page-object/accessors.rb', line 92 def expected_title(expected_title) define_method("has_expected_title?") do page_title = title has_expected_title = (expected_title === page_title) raise "Expected title '#{expected_title}' instead of '#{page_title}'" unless has_expected_title has_expected_title end end |