Class: UserPage

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

Instance Method Summary collapse

Methods included from NavigationBar

#go_to_home, select_from_menuName_menu, select_menu

Methods included from UserMenu

#log_out, #select_revert_to_admin

Constructor Details

#initializeUserPage

Returns a new instance of UserPage.


6
7
8
# File 'pages/UserPage.rb', line 6

def initialize
  super
end

Instance Method Details

#add_privilege(privilege) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'pages/UserPage.rb', line 11

def add_privilege(privilege)
  find(:id, 'user-privileges').click
  $log.debug("Giving User '#{privilege}' privilege") 
  within(:id, 'popup_content'){
    find(:xpath, './/*[@class="select2-choice"]').click
  }
  text = find(:xpath, './/*[@id="s2id_operation_id"]//*[@class="select2-chosen"]').text
  if text == privilege
    find(:xpath, './/*[@value="Continue"]').click
  end
  sleep 1

end