Class: Chrome
Instance Method Summary
collapse
Methods inherited from Browser
#escaped_name, #host, #linux?, #macos?, #path, #runnable?, #setup, #teardown, #to_s, #visit, #windows?
Constructor Details
#initialize(path = nil) ⇒ Chrome
Returns a new instance of Chrome.
2
3
4
5
6
7
8
9
10
11
12
|
# File 'lib/hanoi/browsers/chrome.rb', line 2
def initialize(path = nil)
@path = path || File.join(
ENV['UserPath'] || ENV['UserProfile'] || "C:/Documents and Settings/Administrator",
"AppData",
"Local",
"Google",
"Chrome",
"Application",
"chrome.exe"
)
end
|
Instance Method Details
#installed? ⇒ Boolean
18
19
20
21
22
23
24
|
# File 'lib/hanoi/browsers/chrome.rb', line 18
def installed?
if macos?
File.exist?("/Applications/#{name}.app")
else
super
end
end
|
#name ⇒ Object
26
27
28
|
# File 'lib/hanoi/browsers/chrome.rb', line 26
def name
"Google Chrome"
end
|
#supported? ⇒ Boolean
14
15
16
|
# File 'lib/hanoi/browsers/chrome.rb', line 14
def supported?
windows? || macos?
end
|