Class: LdapConnectorPage

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL, NavigationBar
Defined in:
pages/LdapConnectorPage.rb

Instance Method Summary collapse

Methods included from NavigationBar

#go_to_home, select_from_menuName_menu, select_menu

Constructor Details

#initializeLdapConnectorPage

Returns a new instance of LdapConnectorPage.


5
6
7
# File 'pages/LdapConnectorPage.rb', line 5

def initialize

end

Instance Method Details

#enter_directory_name(ldap_directory) ⇒ Object


9
10
11
12
13
14
15
16
17
# File 'pages/LdapConnectorPage.rb', line 9

def enter_directory_name(ldap_directory)
  find(:xpath,'.//*[@class="input-medium"]').set ldap_directory.directory_name
  find(:xpath,'.//*[@class="btn btn-primary editable-submit"]').click
  find(:xpath, ".//*[@class='editable editable-click']").text.should == ldap_directory.directory_name

  fill_in('directory_name', :with => ldap_directory.onelogin_directory)
  
  click_on('Save')
end

#get_installation_tokenObject


19
20
21
22
23
24
25
26
27
28
# File 'pages/LdapConnectorPage.rb', line 19

def get_installation_token
  if page.has_selector?(:xpath, './/*[@class="grayfield tiny token-field"]')
    installation_token = find(:xpath, './/*[@class="grayfield tiny token-field"]').text
  else
    find(:xpath,'.//*[@class="directory_connector"]//*[@class="span4 name"]').click
    installation_token = find(:xpath, './/*[@class="grayfield tiny token-field"]').text
  end
  p installation_token 
  return installation_token
end