Class: Spec::Watir::HaveTextField
- Inherits:
-
Object
- Object
- Spec::Watir::HaveTextField
- Defined in:
- lib/spec/ui/watir_helper.rb
Overview
:nodoc
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(how, what) ⇒ HaveTextField
constructor
A new instance of HaveTextField.
- #matches?(browser) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(how, what) ⇒ HaveTextField
Returns a new instance of HaveTextField.
143 144 145 |
# File 'lib/spec/ui/watir_helper.rb', line 143 def initialize(how, what) @how, @what = how, what end |
Instance Method Details
#failure_message ⇒ Object
158 159 160 |
# File 'lib/spec/ui/watir_helper.rb', line 158 def "Expected browser to have text_field(#{@how}, #{@what}), but it was not found" end |
#matches?(browser) ⇒ Boolean
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/spec/ui/watir_helper.rb', line 147 def matches?(browser) @browser = browser begin text_field = @browser.text_field(@how, @what) text_field.assert_exists true rescue ::Watir::Exception::UnknownObjectException => e false end end |
#negative_failure_message ⇒ Object
162 163 164 |
# File 'lib/spec/ui/watir_helper.rb', line 162 def "Expected browser not to have text_field(#{@how}, #{@what}), but it was found" end |