Class: Sites

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

Overview

Sites page - arrived at via the link with class=“icon-sakai-sites”

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

#click_top_itemObject

Clicks the first site Id link listed. Useful when you’ve run a search and you’re certain you’ve got the result you want. It then instantiates the EditSiteInfo page class.



14
15
16
17
# File 'lib/sakai-cle-test-api/page_objects/sites.rb', line 14

def click_top_item
  frm.link(:href, /#{Regexp.escape("&panel=Main&sakai_action=doEdit")}/).click
  EditSiteInfo.new(@browser)
end

#edit_site_id(id) ⇒ Object

Clicks the specified Site in the list, using the specified id value to determine which item to click. It then instantiates the EditSiteInfo page class. Use this method when you know the target site ID.



23
24
25
26
27
28
# File 'lib/sakai-cle-test-api/page_objects/sites.rb', line 23

def edit_site_id(id)
  frm.text_field(:id=>"search_site").value=id
  frm.link(:text=>"Site ID").click
  frm.link(:text, id).click
  EditSiteInfo.new(@browser)
end

#new_siteObject

Clicks the New Site button, then instantiates the EditSiteInfo page class.



32
33
34
35
# File 'lib/sakai-cle-test-api/page_objects/sites.rb', line 32

def new_site
  frm.link(:text, "New Site").click
  EditSiteInfo.new(@browser)
end