Class: UserAccount

Inherits:
BasePage show all
Defined in:
lib/sakai-cle-test-api/page_objects/account.rb

Overview

A Non-Admin User’s Account page Accessible via the “Account” link in “MY SETTINGS”

IMPORTANT: this class does not use PageObject or the ToolsMenu!! So, the only available method to navigate away from this page is Home. Otherwise, you’ll have to call the navigation link Explicitly in the test case itself.

Objects and methods used in this class must be explicitly defined using Watir and Ruby code.

Do NOT use the PageObject syntax in this class.

Instance Method Summary collapse

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageMaker

Instance Method Details

#createdObject

Gets the text of the Created field.



90
91
92
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 90

def created
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[1][1].text
end

#created_byObject

Gets the text of the Created By field.



85
86
87
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 85

def created_by
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[0][1].text
end

#emailObject

Gets the text of the Email field.



75
76
77
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 75

def email
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[3][1].text
end

#first_nameObject

Gets the text of the First Name field.



65
66
67
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 65

def first_name
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[1][1].text
end

#homeObject

Clicks the Home buton in the left menu. instantiates the Home Class.



106
107
108
109
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 106

def home
  @browser.link(:text, "Home").click
  Home.new(@browser)
end

#last_nameObject

Gets the text of the Last Name field.



70
71
72
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 70

def last_name
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[2][1].text
end

#modifiedObject

Gets the text of the Modified (date) field.



100
101
102
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 100

def modified
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[3][1].text
end

#modified_byObject

Gets the text of the Modified By field.



95
96
97
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 95

def modified_by
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>1)[2][1].text
end

#modify_detailsObject

Clicks the Modify Details button. Instantiates the EditAccount class.



54
55
56
57
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 54

def modify_details
  @browser.frame(:index=>0).button(:name=>"eventSubmit_doModify").click
  EditAccount.new(@browser)
end

#typeObject

Gets the text of the Type field.



80
81
82
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 80

def type
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[4][1].text
end

#user_idObject

Gets the text of the User ID field.



60
61
62
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 60

def user_id
  @browser.frame(:index=>0).table(:class=>"itemSummary", :index=>0)[0][1].text
end