Class: SiteSetup
- Inherits:
-
SiteSetupBase
- Object
- PageMaker
- BasePage
- SiteSetupBase
- SiteSetup
- Defined in:
- lib/sakai-cle-test-api/page_objects/site_setup.rb
Overview
The Site Setup page - a.k.a., link class=>“icon-sakai-sitesetup”
Instance Method Summary collapse
-
#delete(site_name) ⇒ Object
Searches for the specified site, then checks the site, clicks the delete button, and instantiates the DeleteSite class.
-
#edit(site_name) ⇒ Object
Searches for the specified site, then selects the specified Site’s checkbox.
-
#new ⇒ Object
Clicks the “New” link on the Site Setup page.
-
#search(site_name) ⇒ Object
Enters the specified site name string in the search field, clicks the Search button, then reinstantiates the Class due to the page refresh.
-
#site_titles ⇒ Object
Returns an Array object containing strings of all Site titles displayed on the web page.
Methods inherited from SiteSetupBase
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
#delete(site_name) ⇒ Object
Searches for the specified site, then checks the site, clicks the delete button, and instantiates the DeleteSite class.
72 73 74 75 76 77 78 |
# File 'lib/sakai-cle-test-api/page_objects/site_setup.rb', line 72 def delete(site_name) search_field.value=site_name frm.(:value=>"Search").click frm.checkbox(:name=>"selectedMembers").set frm.div(:class=>"portletBody").link(:text, "Delete").click DeleteSite.new(@browser) end |
#edit(site_name) ⇒ Object
Searches for the specified site, then selects the specified Site’s checkbox. Then clicks the Edit button and instantiates The SiteSetupEdit class.
52 53 54 55 56 57 58 |
# File 'lib/sakai-cle-test-api/page_objects/site_setup.rb', line 52 def edit(site_name) search_field.value=Regexp.escape(site_name) frm.(:value=>"Search").click frm.div(:class=>"portletBody").checkbox(:name=>"selectedMembers").set frm.div(:class=>"portletBody").link(:text, "Edit").click SiteEditor.new(@browser) end |
#new ⇒ Object
Clicks the “New” link on the Site Setup page. instantiates the SiteType class.
43 44 45 46 |
# File 'lib/sakai-cle-test-api/page_objects/site_setup.rb', line 43 def new frm.div(:class=>"portletBody").link(:text=>"New").click SiteType.new(@browser) end |
#search(site_name) ⇒ Object
Enters the specified site name string in the search field, clicks the Search button, then reinstantiates the Class due to the page refresh.
63 64 65 66 67 |
# File 'lib/sakai-cle-test-api/page_objects/site_setup.rb', line 63 def search(site_name) search_field.set site_name frm.(:value, "Search").click SiteSetup.new(@browser) end |
#site_titles ⇒ Object
Returns an Array object containing strings of all Site titles displayed on the web page.
82 83 84 85 86 87 88 89 |
# File 'lib/sakai-cle-test-api/page_objects/site_setup.rb', line 82 def site_titles titles = [] sites_table = frm.table(:id=>"siteList") 1.upto(sites_table.rows.size-1) do |x| titles << sites_table[x][1].text end return titles end |