Class: Rufus::Accessors::View
- Inherits:
-
Object
- Object
- Rufus::Accessors::View
show all
- Includes:
- Rufus
- Defined in:
- lib/rufus/accessors/view.rb
Direct Known Subclasses
Table
Instance Method Summary
collapse
Methods included from Rufus
#displayed_after_wait?, #displayed_hash_after_wait?, #elements_of_type, #enabled_after_wait?, #enabled_hash_after_wait?, #exists_after_wait?, #exists_hash_after_wait?, #find, included, #page_source, #scroll_to
Constructor Details
#initialize(locator = {}) ⇒ View
Returns a new instance of View.
6
7
8
|
# File 'lib/rufus/accessors/view.rb', line 6
def initialize(locator={})
@locator = locator
end
|
Instance Method Details
#class ⇒ Object
34
35
36
|
# File 'lib/rufus/accessors/view.rb', line 34
def class
selenium.class(what)
end
|
#click ⇒ Object
14
15
16
|
# File 'lib/rufus/accessors/view.rb', line 14
def click
selenium.click(what)
end
|
#displayed? ⇒ Boolean
18
19
20
|
# File 'lib/rufus/accessors/view.rb', line 18
def displayed?
selenium.displayed?(what)
end
|
#enabled? ⇒ Boolean
22
23
24
|
# File 'lib/rufus/accessors/view.rb', line 22
def enabled?
selenium.enabled?(what)
end
|
#exists? ⇒ Boolean
10
11
12
|
# File 'lib/rufus/accessors/view.rb', line 10
def exists?
selenium.exists?(what)
end
|
#locator ⇒ Object
44
45
46
|
# File 'lib/rufus/accessors/view.rb', line 44
def locator
@locator
end
|
#send_keys(keys) ⇒ Object
30
31
32
|
# File 'lib/rufus/accessors/view.rb', line 30
def send_keys(keys)
selenium.type(keys, what[:name])
end
|
#text ⇒ Object
26
27
28
|
# File 'lib/rufus/accessors/view.rb', line 26
def text
selenium.text(what)
end
|
#what ⇒ Object
38
39
40
41
42
|
# File 'lib/rufus/accessors/view.rb', line 38
def what
key = @locator.keys[0].to_sym
value = @locator[key]
{key => value}
end
|