Class: SiteSetup

Inherits:
Object
  • Object
show all
Includes:
PageObject, ToolsMenu
Defined in:
lib/sakai-cle-test-api/common_page_elements.rb

Overview

The Site Setup page - a.k.a., link class=>“icon-sakai-sitesetup”

Instance Method Summary collapse

Methods included from ToolsMenu

#account, #administration_workspace, #aliases, #announcements, #assessments, #assignments, #basic_lti, #blogger, #blogs, #calendar, #chat_room, #discussion_forums, #drop_box, #email_archive, #evaluation_system, #feedback, #forms, #forums, #frm, #glossary, #gradebook, #gradebook2, #home, #job_scheduler, #lessons, #logout, #matrices, #media_gallery, #messages, #my_workspace, #news, #open_my_site_by_id, #open_my_site_by_name, #podcasts, #polls, #portfolio_templates, #portfolios, #profile, #profile2, #reset, #resources, #roster, #sections, #site_editor, #site_management_search, #site_setup, #sites, #styles, #syllabus, #tests_and_quizzes, #user_membership, #users, #web_content, #wiki

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.



1366
1367
1368
1369
1370
1371
1372
# File 'lib/sakai-cle-test-api/common_page_elements.rb', line 1366

def delete(site_name)
  frm.text_field(:id, "Search").value=site_name
  frm.button(: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.



1346
1347
1348
1349
1350
1351
1352
# File 'lib/sakai-cle-test-api/common_page_elements.rb', line 1346

def edit(site_name)
  frm.text_field(:id, "search").value=Regexp.escape(site_name)
  frm.button(:value=>"Search").click
  frm.div(:class=>"portletBody").checkbox(:name=>"selectedMembers").set
  frm.div(:class=>"portletBody").link(:text, "Edit").click
  SiteEditor.new(@browser)
end

#newObject

Clicks the “New” link on the Site Setup page. instantiates the SiteType class.



1337
1338
1339
1340
# File 'lib/sakai-cle-test-api/common_page_elements.rb', line 1337

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.



1357
1358
1359
1360
1361
# File 'lib/sakai-cle-test-api/common_page_elements.rb', line 1357

def search(site_name)
  frm.text_field(:id, "search").set site_name
  frm.button(:value, "Search").click
  SiteSetup.new(@browser)
end

#site_titlesObject

Returns an Array object containing strings of all Site titles displayed on the web page.



1376
1377
1378
1379
1380
1381
1382
1383
# File 'lib/sakai-cle-test-api/common_page_elements.rb', line 1376

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