Class: WebContentObject
- Inherits:
-
Object
- Object
- WebContentObject
- Includes:
- PageHelper, Utilities, Workflows
- Defined in:
- lib/sakai-cle-test-api/data_objects/web_content_tool.rb
Instance Attribute Summary collapse
-
#site ⇒ Object
Returns the value of attribute site.
-
#source ⇒ Object
Returns the value of attribute source.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ WebContentObject
constructor
A new instance of WebContentObject.
Methods included from Workflows
menu_link, #open_my_site_by_name
Methods included from Utilities
#current_hour, #current_month, #current_year, #get_filename, #in_15_minutes, #last_hour, #last_month, #last_year, #make, #make_date, #next_hour, #next_month, #next_year, #on_page, #random_alphanums, #random_alphanums_plus, #random_email, #random_high_ascii, #random_letters, #random_multiline, #random_nicelink, #random_string, #random_xss_string, #tomorrow, #yesterday
Methods included from PageHelper
#make, #on, #visit, #wait_until
Constructor Details
#initialize(browser, opts = {}) ⇒ WebContentObject
Returns a new instance of WebContentObject.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sakai-cle-test-api/data_objects/web_content_tool.rb', line 9 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :source=>"www.rsmart.com" } = defaults.merge(opts) @title=[:title] @source=[:source] @site=[:site] raise "You need to specify a site for your web content" if @site==nil end |
Instance Attribute Details
#site ⇒ Object
Returns the value of attribute site.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/web_content_tool.rb', line 7 def site @site end |
#source ⇒ Object
Returns the value of attribute source.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/web_content_tool.rb', line 7 def source @source end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/web_content_tool.rb', line 7 def title @title end |
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/sakai-cle-test-api/data_objects/web_content_tool.rb', line 24 def create my_workspace unless @browser.title=~/My Workspace/ site_setup unless @browser.title=~/Site Setup$/ on_page SiteSetup do |page| page.edit @site end on_page SiteEditor do |page| page.edit_tools end on_page EditSiteTools do |page| page.web_content.set page.continue end on_page AddMultipleTools do |page| page.web_content_title.set @title page.web_content_source.set @source page.continue end on_page ConfirmSiteToolsEdits do |page| page.finish end on_page SiteEditor do |page| page..wait_until_present page.return_to_sites_list end end |