5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/google_hangout/runner.rb', line 5
def open(hangout_url, email, password)
Capybara.default_driver = :selenium
Capybara.app_host = hangout_url
visit '/'
begin
find_field('Email')
if email.nil? || email.empty? || password.nil? || password.empty?
puts "ERROR: You aren't logged in to Google, but you did not supply login credentials."
return
end
fill_in 'Email', with: email
fill_in 'Password', with: password
click_button 'Sign in'
rescue Capybara::ElementNotFound
end
find('div[role="button"]', :text => 'Join').click
`osascript -e 'tell application "System Events" to keystroke "f" using {command down, control down}'`
puts "Press Return to quit"
STDIN.gets
end
|