Module: SessionTab

Included in:
EditPoliciesPage
Defined in:
common/policies/SessionTab.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject


3
4
5
6
# File 'common/policies/SessionTab.rb', line 3

def initialize
  @inactivity = {"selector" => :xpath, "value" => ".//*[@id='policy_session_timeout_minutes_control_group']/div/span/div/a"}

end

#is_session_timeout_set_to(time) ⇒ Object


8
9
10
11
12
13
14
15
16
# File 'common/policies/SessionTab.rb', line 8

def is_session_timeout_set_to(time)
  session_value = find(:xpath, @inactivity['value']+"//*[@class='select2-chosen']")
  p session_value.text    
  if session_value.text == time
    return true
  else
    return false
  end 
end

#set_session_timeout(timeout) ⇒ Object


18
19
20
21
# File 'common/policies/SessionTab.rb', line 18

def set_session_timeout(timeout)
  find(@inactivity['selector'], @inactivity['value']).click
  find(:xpath, ".//*[@id='select2-drop']/ul/li/div[text()='#{timeout}']").click
end