Class: Vapir::Firefox::TextField

Inherits:
InputElement show all
Includes:
TextField
Defined in:
lib/vapir-firefox/elements/text_field.rb

Overview

Description: Class for Text Field element.

Direct Known Subclasses

Hidden

Instance Method Summary collapse

Instance Method Details

#verify_contains(containsThis) ⇒ Object

Description:

Checks if the provided text matches with the contents of text field. Text can be a string or regular expression.

Input:

- containsThis - Text to verify.

Output:

True if provided text matches with the contents of text field, false otherwise.


22
23
24
25
26
27
28
29
30
31
# File 'lib/vapir-firefox/elements/text_field.rb', line 22

def verify_contains( containsThis )
  assert_exists do
    if containsThis.kind_of? String
      return true if self.value == containsThis
    elsif containsThis.kind_of? Regexp
      return true if self.value.match(containsThis) != nil
    end
    return false
  end
end