Class: Avmtrf1::CheckPoint::Session
- Inherits:
-
Object
- Object
- Avmtrf1::CheckPoint::Session
- Defined in:
- lib/avmtrf1/check_point/session.rb,
lib/avmtrf1/check_point/session/login.rb
Defined Under Namespace
Classes: Login
Constant Summary collapse
- ROOT_URL =
'https://cp.trf1.jus.br'
- LOGIN_URL =
"#{ROOT_URL}/"
- LOGGED_TITLE_TEXT =
'Re-Authenticate'
Class Method Summary collapse
- .by_ad_user(ad_user, driver_options = {}) ⇒ Object
- .by_default_ad_user(driver_options = {}) ⇒ Object
Instance Method Summary collapse
Class Method Details
.by_ad_user(ad_user, driver_options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/avmtrf1/check_point/session.rb', line 17 def by_ad_user(ad_user, = {}) new( ad_user.username, ad_user.password, ) end |
Instance Method Details
#logged? ⇒ Boolean
32 33 34 35 |
# File 'lib/avmtrf1/check_point/session.rb', line 32 def logged? session.navigate.to LOGIN_URL title_text == LOGGED_TITLE_TEXT end |
#login ⇒ Object
37 38 39 |
# File 'lib/avmtrf1/check_point/session.rb', line 37 def login ::Avmtrf1::CheckPoint::Session::Login.new(self) end |
#title_text ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/avmtrf1/check_point/session.rb', line 41 def title_text result_text = nil session.wait.until do element = session.find_element(id: 'sg_login_button') return false unless element result_text = element.text.strip result_text.present? end result_text end |