Class: Crabfarm::Dsl::Surfer::SurfContext
Constant Summary
Crabfarm::Dsl::Surfer::SearchContext::TIMEOUT
Instance Attribute Summary collapse
#parent
Instance Method Summary
collapse
#[], #classes, #each, #element!, #fill, #first, #last, #method_missing, #respond_to?, #search, #webdriver_elements
Constructor Details
#initialize(_driver) ⇒ SurfContext
Returns a new instance of SurfContext.
10
11
12
13
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 10
def initialize(_driver)
super nil, self
@driver = _driver
end
|
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
6
7
8
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 6
def driver
@driver
end
|
Instance Method Details
#cookies ⇒ Object
31
32
33
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 31
def cookies
driver.manage.all_cookies
end
|
#current_uri ⇒ Object
27
28
29
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 27
def current_uri
URI.parse driver.current_url
end
|
#elements ⇒ Object
19
20
21
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 19
def elements
[driver]
end
|
#goto(_url, _params = nil) ⇒ Object
35
36
37
38
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 35
def goto(_url, _params=nil)
_url += "?#{_params.to_query}" if _params
driver.get(_url)
end
|
#root ⇒ Object
15
16
17
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 15
def root
self
end
|
#to_html ⇒ Object
23
24
25
|
# File 'lib/crabfarm/dsl/surfer/surf_context.rb', line 23
def to_html
driver.page_source
end
|