Class: WebContentObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, StringFactory, Workflows
Defined in:
lib/sambal-cle/data_objects/web_content_tool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Workflows

menu_link, #open_my_site_by_name, #reset

Constructor Details

#initialize(browser, opts = {}) ⇒ WebContentObject

Returns a new instance of WebContentObject.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sambal-cle/data_objects/web_content_tool.rb', line 10

def initialize(browser, opts={})
  @browser = browser

  defaults = {
    :title=>random_alphanums,
    :source=>"www.rsmart.com"
  }
  options = defaults.merge(opts)

  set_options(options)
  requires @site
end

Instance Attribute Details

#siteObject

Returns the value of attribute site.



8
9
10
# File 'lib/sambal-cle/data_objects/web_content_tool.rb', line 8

def site
  @site
end

#sourceObject

Returns the value of attribute source.



8
9
10
# File 'lib/sambal-cle/data_objects/web_content_tool.rb', line 8

def source
  @source
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/sambal-cle/data_objects/web_content_tool.rb', line 8

def title
  @title
end

Instance Method Details

#createObject



23
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
# File 'lib/sambal-cle/data_objects/web_content_tool.rb', line 23

def create
  my_workspace
  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.return_button.wait_until_present
    page.return_to_sites_list
  end
end