Class: NewUserPage

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL, NavigationBar, UserMenu
Defined in:
pages/NewUserPage.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

#initializeNewUserPage

Returns a new instance of NewUserPage.


6
7
8
9
10
11
# File 'pages/NewUserPage.rb', line 6

def initialize
  @firstName = {"selector" => :id, "value" => "user_firstname"}
  @lastName = {"selector" => :id, "value" => "user_lastname"}
  @email = {"selector" => :id, "value" => "user_email"}

end

Instance Method Details

#click_cancelObject


35
36
37
# File 'pages/NewUserPage.rb', line 35

def click_cancel
  click_link("Cancel")
end

#click_saveObject


29
30
31
32
33
# File 'pages/NewUserPage.rb', line 29

def click_save
  find(:id, "save_user").click 
  find(:xpath, ".//*[@id='flashnotice']//*[@class='container']")
  find(:xpath, ".//*[@class='btn btn-primary disabled']")
end

#enter_basic_user(created_user) ⇒ Object


13
14
15
16
17
# File 'pages/NewUserPage.rb', line 13

def enter_basic_user (created_user)
  fill_in(@firstName['value'], :with => created_user.first_name)
  fill_in(@lastName['value'], :with => created_user.last_name)
  fill_in(@email['value'], :with => created_user.email)
end

#enter_user_with_apostrophe(created_user) ⇒ Object


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

def enter_user_with_apostrophe(created_user)

  new_last_name=created_user.last_name+"'"

  fill_in(@firstName['value'], :with => created_user.first_name)
  fill_in(@lastName['value'], :with => new_last_name)
  fill_in(@email['value'], :with => created_user.email)
 
end