Last active
April 13, 2016 15:12
-
-
Save komiyake/ed51173a54f8227089e5 to your computer and use it in GitHub Desktop.
Webauthに接続するよ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara' | |
require 'capybara/dsl' | |
require 'selenium-webdriver' | |
require 'io/console' | |
Capybara.run_server = false | |
Capybara.current_driver = :selenium | |
Capybara.app_host = "https://webauth.ritsumei.ac.jp/fs/customwebauth/login.html?switch_url=https://webauth.ritsumei.ac.jp/login.html&wlan=WebAuth" | |
class Webauth | |
include Capybara::DSL | |
def login(id, pass) | |
visit ('/') | |
sleep 1 | |
fill_in "username", | |
:with => id | |
fill_in "password", | |
:with => pass | |
click_button "Submit" | |
end | |
end | |
print "username: " | |
id = STDIN.gets.chomp | |
print "pass: " | |
pass = STDIN.noecho(&:gets).chomp | |
webauth = Webauth.new | |
webauth.login(id, pass) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment