Class: Cello::PageObjects::Hub
- Inherits:
-
Object
- Object
- Cello::PageObjects::Hub
show all
- Defined in:
- lib/cello/pageobjects/hub.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(hub_url, caps) ⇒ Hub
Returns a new instance of Hub.
10
11
12
13
14
15
16
17
|
# File 'lib/cello/pageobjects/hub.rb', line 10
def initialize hub_url, caps
@browser =
Watir::Browser.new(
:remote,
:url => hub_url,
:desired_capabilities => caps
)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments) ⇒ Object
47
48
49
|
# File 'lib/cello/pageobjects/hub.rb', line 47
def method_missing method_name, *arguments
@context.send method_name, *arguments
end
|
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
8
9
10
|
# File 'lib/cello/pageobjects/hub.rb', line 8
def browser
@browser
end
|
#context(page) ⇒ Object
Returns the value of attribute context.
7
8
9
|
# File 'lib/cello/pageobjects/hub.rb', line 7
def context
@context
end
|
Instance Method Details
#close ⇒ Object
31
32
33
|
# File 'lib/cello/pageobjects/hub.rb', line 31
def close
@browser.close
end
|
#get_screenshot ⇒ Object
35
36
37
|
# File 'lib/cello/pageobjects/hub.rb', line 35
def get_screenshot
@browser.driver.save_screenshot 'screenshot.png'
end
|
#response_time ⇒ Object
43
44
45
|
# File 'lib/cello/pageobjects/hub.rb', line 43
def response_time
end
|
#search(text) ⇒ Object
27
28
29
|
# File 'lib/cello/pageobjects/hub.rb', line 27
def search text
@browser.text.include? text
end
|
#title ⇒ Object
39
40
41
|
# File 'lib/cello/pageobjects/hub.rb', line 39
def title
@browser.title
end
|
#visit ⇒ Object
19
20
21
|
# File 'lib/cello/pageobjects/hub.rb', line 19
def visit
@context.visit
end
|