Module: Pouch
- Includes:
- Elements
- Defined in:
- lib/pouch.rb,
lib/pouch/version.rb,
lib/pouch/elements.rb
Defined Under Namespace
Modules: Elements
Classes: ContextArgumentError, PresenceError, ReplacementError, VisibilityError
Constant Summary
collapse
- VERSION =
"0.3.2"
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Elements
#button, #checkbox, #div, #element, #file_field, #form, #h1, #h2, #h3, #h4, #h5, #h6, #image, #link, #list_item, #ordered_list, #paragraph, #radio_button, #select_list, #span, #table, #table_cell, #table_header, #table_row, #text_area, #text_field, #unordered_list
Class Method Details
.included(base) ⇒ Object
12
13
14
|
# File 'lib/pouch.rb', line 12
def self.included base
base.extend self
end
|
Instance Method Details
#browser ⇒ Object
32
33
34
|
# File 'lib/pouch.rb', line 32
def browser
@browser
end
|
#context ⇒ Object
36
37
38
|
# File 'lib/pouch.rb', line 36
def context
@context
end
|
#initialize(browser, start = false, opts = {}) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/pouch.rb', line 16
def initialize browser, start = false, opts = {}
if start.is_a?(Hash) && opts.empty?
opts = start
start = false
end
@browser = browser
@context = standardize opts[:context] if opts[:context]
@timeout = opts[:timeout] || 5
set_timer if self.respond_to? :set_timer
visit if self.respond_to?(:visit) && start
contextualize_methods
end
|
#page_url=(str) ⇒ Object
44
45
46
47
48
|
# File 'lib/pouch.rb', line 44
def page_url= str
define_method :visit do
self.browser.goto str
end
end
|
#timeout ⇒ Object
40
41
42
|
# File 'lib/pouch.rb', line 40
def timeout
@timeout
end
|