Class: Rufus::Accessors::View

Inherits:
Object
  • Object
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

#classObject



34
35
36
# File 'lib/rufus/accessors/view.rb', line 34

def class
  selenium.class(what)
end

#clickObject



14
15
16
# File 'lib/rufus/accessors/view.rb', line 14

def click
  selenium.click(what)
end

#displayed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rufus/accessors/view.rb', line 18

def displayed?
  selenium.displayed?(what)
end

#enabled?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rufus/accessors/view.rb', line 22

def enabled?
  selenium.enabled?(what)
end

#exists?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rufus/accessors/view.rb', line 10

def exists?
    selenium.exists?(what)
end

#locatorObject



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

#textObject



26
27
28
# File 'lib/rufus/accessors/view.rb', line 26

def text
  selenium.text(what)
end

#whatObject



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