Module: Impostor::Wwf80::Auth
- Defined in:
- lib/impostor/wwf80.rb
Overview
Additional configuration parameters for a Wwf80 compatible agent:
:new_reply_page :new_topic_page
Typical configuration parameters { :type => :wwf80,
:app_root => 'http://example.com/forum/',
:login_page => 'login_user.asp',
:new_reply_page => 'new_reply_form.asp',
:new_topic_page => 'new_topic_form.asp',
:user_agent => 'Windows IE 7',
:username => 'myuser',
:password => 'mypasswd' }
Instance Method Summary collapse
-
#get_login_form(page) ⇒ Object
returns the login form from the login page.
-
#logged_in?(page) ⇒ Boolean
given the state of the page, are we logged in to the forum?.
-
#login ⇒ Object
:nodoc:.
-
#set_username_and_password(form) ⇒ Object
Sets the user name and pass word on the loing form.
Instance Method Details
#get_login_form(page) ⇒ Object
returns the login form from the login page
35 36 37 38 39 |
# File 'lib/impostor/wwf80.rb', line 35 def get_login_form(page) form = page.form('frmLogin') raise Impostor::LoginError.new("unknown login page format") unless form form end |
#logged_in?(page) ⇒ Boolean
given the state of the page, are we logged in to the forum?
52 53 54 55 |
# File 'lib/impostor/wwf80.rb', line 52 def logged_in?(page) mm = page.search("//a[@class='nav']") !! mm.detect { |m| m.text =~ /Logout \[#{self.config.username}\]/ } end |
#login ⇒ Object
:nodoc:
27 28 29 30 |
# File 'lib/impostor/wwf80.rb', line 27 def login # :nodoc: Impostor.not_tested("Impostor::Wwf80::Auth", "login") super end |
#set_username_and_password(form) ⇒ Object
Sets the user name and pass word on the loing form.
43 44 45 46 47 |
# File 'lib/impostor/wwf80.rb', line 43 def set_username_and_password(form) form['name'] = self.config.username form['password'] = self.config.password form end |