Class: EditAccount

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

Overview

The Page for editing User Account details

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

#update_detailsObject

Clicks the update details button then makes sure there isn’t any error message present. If there is, it reinstantiates the Edit Account Class, otherwise it instantiates the UserAccount Class.



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sakai-cle-test-api/page_objects/account.rb', line 14

def update_details
  frm.button(:value=>"Update Details").click
  # Need to check if the update took...
  if frm.div(:class=>"portletBody").h3.text=="My Account Details"
    # Apparently it did...
    UserAccount.new(@browser)
  elsif frm.div(:class=>"portletBody").h3.text=="Account Details"
    # We are on the edit page (or we're using the Admin account)...
    EditAccount.new(@browser)
  elsif frm.div(:class=>"portletBody").h3.text=="Users"
    Users.new(@browser)
  end
end