vapir-firefox 1.7.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,64 @@
1
+ require 'vapir-firefox/elements/input_element'
2
+ require 'vapir-common/elements/elements'
3
+
4
+ module Vapir
5
+ #
6
+ # Description:
7
+ # Class for Text Field element.
8
+ #
9
+ class Firefox::TextField < Firefox::InputElement
10
+ include Vapir::TextField
11
+
12
+ #
13
+ # Description:
14
+ # Checks if the provided text matches with the contents of text field. Text can be a string or regular expression.
15
+ #
16
+ # Input:
17
+ # - containsThis - Text to verify.
18
+ #
19
+ # Output:
20
+ # True if provided text matches with the contents of text field, false otherwise.
21
+ #
22
+ def verify_contains( containsThis )
23
+ assert_exists do
24
+ if containsThis.kind_of? String
25
+ return true if self.value == containsThis
26
+ elsif containsThis.kind_of? Regexp
27
+ return true if self.value.match(containsThis) != nil
28
+ end
29
+ return false
30
+ end
31
+ end
32
+
33
+ # this method is used to drag the entire contents of the text field to another text field
34
+ # 19 Jan 2005 - It is added as prototype functionality, and may change
35
+ # * destination_how - symbol, :id, :name how we identify the drop target
36
+ # * destination_what - string or regular expression, the name, id, etc of the text field that will be the drop target
37
+ # TODO: Can we have support for this in Firefox.
38
+ #def drag_contents_to( destination_how , destination_what)
39
+ # assert_exists
40
+ # destination = element.text_field(destination_how, destination_what)
41
+ # raise UnknownObjectException , "Unable to locate destination using #{destination_how } and #{destination_what } " if destination.exists? == false
42
+
43
+ # focus
44
+ # select()
45
+ # value = self.value
46
+
47
+ # fireEvent("onSelect")
48
+ # fireEvent("ondragstart")
49
+ # fireEvent("ondrag")
50
+ # destination.fireEvent("onDragEnter")
51
+ # destination.fireEvent("onDragOver")
52
+ # destination.fireEvent("ondrop")
53
+
54
+ # fireEvent("ondragend")
55
+ # destination.value= ( destination.value + value.to_s )
56
+ # self.value = ""
57
+ #end
58
+ # alias dragContentsTo drag_contents_to
59
+
60
+
61
+
62
+ end # TextField
63
+ end # Vapir
64
+
@@ -0,0 +1,17 @@
1
+ require 'vapir-firefox/element'
2
+ require "vapir-firefox/elements/button"
3
+ require "vapir-firefox/elements/file_field"
4
+ require "vapir-firefox/elements/form"
5
+ require "vapir-firefox/elements/frame"
6
+ require "vapir-firefox/elements/hidden"
7
+ require "vapir-firefox/elements/image"
8
+ require "vapir-firefox/elements/input_element"
9
+ require "vapir-firefox/elements/link"
10
+ require "vapir-firefox/elements/non_control_elements"
11
+ require "vapir-firefox/elements/option"
12
+ require "vapir-firefox/elements/radio_check_common"
13
+ require "vapir-firefox/elements/select_list"
14
+ require "vapir-firefox/elements/table"
15
+ require "vapir-firefox/elements/table_row"
16
+ require "vapir-firefox/elements/table_cell"
17
+ require "vapir-firefox/elements/text_field"