class AmsLayout::Pages::LoginPage
Public Instance Methods
allow_password_entry()
click to toggle source
# File lib/ams_layout/pages/login_page.rb, line 50 def allow_password_entry # We used to have to click on the password mask before the page would let us enter the password itself: # # # For some unknown reason, we must click on a password mask input before # # we can access the password field itself. # password_mask_element.click # # Now, we have to use javascript to hide the mask and display the password field. hide_mask_script = <<EOS pwdmasks = document.getElementsByClassName('passwordmask'); pwdmasks[0].style.display = 'none'; pwds = document.getElementsByClassName('password'); pwds[0].style.display = 'block'; EOS @browser.execute_script(hide_mask_script) end
logged_in?()
click to toggle source
# File lib/ams_layout/pages/login_page.rb, line 46 def logged_in? !self.username? end
login_as(username, password)
click to toggle source
# File lib/ams_layout/pages/login_page.rb, line 28 def login_as(username, password) self.username = username allow_password_entry self.password = password login trys = 0 # Make sure we wait until the (sometimes) slow login is finished. while trys < 10 && !self.text.include?('LOAN PIPELINE') trys += 1 sleep 1 end end
logout()
click to toggle source
# File lib/ams_layout/pages/login_page.rb, line 42 def logout navigate_to page_url_value + '/User/AppLogout.aspx' end