sakai-cle-test-api 0.0.75 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sakai-cle-test-api.rb +4 -5
- data/lib/sakai-cle-test-api/base_page.rb +20 -0
- data/lib/sakai-cle-test-api/core-ext.rb +90 -0
- data/lib/sakai-cle-test-api/data_objects/announcement.rb +81 -0
- data/lib/sakai-cle-test-api/data_objects/assessment.rb +32 -0
- data/lib/sakai-cle-test-api/data_objects/assignment.rb +90 -0
- data/lib/sakai-cle-test-api/data_objects/event.rb +89 -0
- data/lib/sakai-cle-test-api/data_objects/lesson.rb +185 -0
- data/lib/sakai-cle-test-api/data_objects/resource.rb +209 -0
- data/lib/sakai-cle-test-api/data_objects/site.rb +208 -0
- data/lib/sakai-cle-test-api/data_objects/syllabus.rb +39 -0
- data/lib/sakai-cle-test-api/data_objects/web_content_tool.rb +51 -0
- data/lib/sakai-cle-test-api/data_objects/wiki.rb +53 -0
- data/lib/sakai-cle-test-api/gem_ext.rb +23 -0
- data/lib/sakai-cle-test-api/page_helper.rb +22 -0
- data/lib/sakai-cle-test-api/page_maker.rb +48 -0
- data/lib/sakai-cle-test-api/page_objects/account.rb +111 -0
- data/lib/sakai-cle-test-api/page_objects/aliases.rb +43 -0
- data/lib/sakai-cle-test-api/page_objects/announcements.rb +190 -0
- data/lib/sakai-cle-test-api/page_objects/assessments.rb +874 -0
- data/lib/sakai-cle-test-api/page_objects/assignments.rb +771 -0
- data/lib/sakai-cle-test-api/page_objects/basic_lti.rb +6 -0
- data/lib/sakai-cle-test-api/page_objects/blogger.rb +205 -0
- data/lib/sakai-cle-test-api/page_objects/blogs.rb +60 -0
- data/lib/sakai-cle-test-api/page_objects/calendar.rb +431 -0
- data/lib/sakai-cle-test-api/page_objects/calendar_summary.rb +1 -0
- data/lib/sakai-cle-test-api/page_objects/chat_room.rb +12 -0
- data/lib/sakai-cle-test-api/page_objects/drop_box.rb +9 -0
- data/lib/sakai-cle-test-api/page_objects/email_archive.rb +22 -0
- data/lib/sakai-cle-test-api/page_objects/evaluations.rb +158 -0
- data/lib/sakai-cle-test-api/page_objects/feedback.rb +36 -0
- data/lib/sakai-cle-test-api/page_objects/forms.rb +120 -0
- data/lib/sakai-cle-test-api/page_objects/forums.rb +289 -0
- data/lib/sakai-cle-test-api/page_objects/glossary.rb +117 -0
- data/lib/sakai-cle-test-api/page_objects/gradebook.rb +29 -0
- data/lib/sakai-cle-test-api/page_objects/gradebook2.rb +17 -0
- data/lib/sakai-cle-test-api/page_objects/home.rb +36 -0
- data/lib/sakai-cle-test-api/page_objects/jforums.rb +444 -0
- data/lib/sakai-cle-test-api/page_objects/job_scheduler.rb +121 -0
- data/lib/sakai-cle-test-api/page_objects/lessons.rb +360 -0
- data/lib/sakai-cle-test-api/page_objects/login.rb +28 -0
- data/lib/sakai-cle-test-api/page_objects/matrix.rb +241 -0
- data/lib/sakai-cle-test-api/page_objects/media_gallery.rb +13 -0
- data/lib/sakai-cle-test-api/page_objects/messages.rb +622 -0
- data/lib/sakai-cle-test-api/page_objects/my_workspace.rb +44 -0
- data/lib/sakai-cle-test-api/page_objects/news.rb +8 -0
- data/lib/sakai-cle-test-api/page_objects/podcasts.rb +27 -0
- data/lib/sakai-cle-test-api/page_objects/polls.rb +69 -0
- data/lib/sakai-cle-test-api/page_objects/portfolio_templates.rb +161 -0
- data/lib/sakai-cle-test-api/page_objects/portfolios.rb +162 -0
- data/lib/sakai-cle-test-api/page_objects/post_em.rb +1 -0
- data/lib/sakai-cle-test-api/page_objects/profile.rb +51 -0
- data/lib/sakai-cle-test-api/page_objects/profile2.rb +344 -0
- data/lib/sakai-cle-test-api/page_objects/public_search.rb +61 -0
- data/lib/sakai-cle-test-api/page_objects/realms.rb +19 -0
- data/lib/sakai-cle-test-api/page_objects/resources.rb +326 -0
- data/lib/sakai-cle-test-api/{resources_roster.rb → page_objects/resources_roster.rb} +0 -0
- data/lib/sakai-cle-test-api/page_objects/rosters.rb +70 -0
- data/lib/sakai-cle-test-api/page_objects/rwiki.rb +34 -0
- data/lib/sakai-cle-test-api/page_objects/search.rb +34 -0
- data/lib/sakai-cle-test-api/page_objects/sections.rb +295 -0
- data/lib/sakai-cle-test-api/page_objects/single_user.rb +1 -0
- data/lib/sakai-cle-test-api/page_objects/site_setup.rb +686 -0
- data/lib/sakai-cle-test-api/page_objects/site_statistics.rb +1 -0
- data/lib/sakai-cle-test-api/page_objects/sites.rb +255 -0
- data/lib/sakai-cle-test-api/page_objects/styles.rb +74 -0
- data/lib/sakai-cle-test-api/page_objects/syllabus.rb +166 -0
- data/lib/sakai-cle-test-api/page_objects/user_membership.rb +57 -0
- data/lib/sakai-cle-test-api/page_objects/users.rb +88 -0
- data/lib/sakai-cle-test-api/rich_text.rb +27 -0
- data/lib/sakai-cle-test-api/utilities.rb +260 -0
- data/lib/sakai-cle-test-api/workflows.rb +224 -0
- data/sakai-cle-test-api.gemspec +3 -5
- metadata +74 -64
- data/lib/sakai-cle-test-api/admin_page_elements.rb +0 -1030
- data/lib/sakai-cle-test-api/announcements.rb +0 -59
- data/lib/sakai-cle-test-api/assessments.rb +0 -194
- data/lib/sakai-cle-test-api/assignments.rb +0 -113
- data/lib/sakai-cle-test-api/basic_lti.rb +0 -5
- data/lib/sakai-cle-test-api/blogs.rb +0 -5
- data/lib/sakai-cle-test-api/calendar.rb +0 -65
- data/lib/sakai-cle-test-api/calendar_summary.rb +0 -0
- data/lib/sakai-cle-test-api/common_page_elements.rb +0 -1228
- data/lib/sakai-cle-test-api/drop_box.rb +0 -0
- data/lib/sakai-cle-test-api/email_archive.rb +0 -10
- data/lib/sakai-cle-test-api/forums.rb +0 -39
- data/lib/sakai-cle-test-api/gradebook.rb +0 -10
- data/lib/sakai-cle-test-api/gradebook2.rb +0 -6
- data/lib/sakai-cle-test-api/messages.rb +0 -119
- data/lib/sakai-cle-test-api/news.rb +0 -9
- data/lib/sakai-cle-test-api/polls.rb +0 -24
- data/lib/sakai-cle-test-api/post_em.rb +0 -0
- data/lib/sakai-cle-test-api/profile.rb +0 -17
- data/lib/sakai-cle-test-api/profile2.rb +0 -43
- data/lib/sakai-cle-test-api/rwiki.rb +0 -0
- data/lib/sakai-cle-test-api/sections.rb +0 -47
- data/lib/sakai-cle-test-api/single_user.rb +0 -0
- data/lib/sakai-cle-test-api/site_page_elements.rb +0 -2350
- data/lib/sakai-cle-test-api/site_statistics.rb +0 -0
- data/lib/sakai-cle-test-api/syllabus.rb +0 -77
- data/lib/sakai-cle-test-api/tools_menu.rb +0 -415
@@ -0,0 +1,209 @@
|
|
1
|
+
class FileObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Workflows
|
6
|
+
|
7
|
+
attr_accessor :name, :site, :source_path, :target_folder, :href
|
8
|
+
|
9
|
+
def initialize(browser, opts={})
|
10
|
+
@browser = browser
|
11
|
+
|
12
|
+
defaults = {
|
13
|
+
}
|
14
|
+
options = defaults.merge(opts)
|
15
|
+
|
16
|
+
@name = options[:name]
|
17
|
+
@source_path = options[:source_path]
|
18
|
+
@site = options[:site]
|
19
|
+
options[:target_folder] == nil ? @target_folder=@site : @target_folder=options[:target_folder]
|
20
|
+
raise "You must specify a Site for your Folder" if @site==nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def create
|
24
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
25
|
+
resources unless @browser.title=~/Resources$/
|
26
|
+
on Resources do |file|
|
27
|
+
file.upload_file_to_folder @target_folder
|
28
|
+
end
|
29
|
+
on ResourcesUploadFiles do |upload|
|
30
|
+
upload.file_to_upload @name, @source_path
|
31
|
+
upload.upload_files_now
|
32
|
+
end
|
33
|
+
on Resources do |file|
|
34
|
+
@href = file.href @name
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
class FolderObject
|
41
|
+
include PageHelper
|
42
|
+
include Utilities
|
43
|
+
include Workflows
|
44
|
+
|
45
|
+
attr_accessor :name, :parent_folder, :site
|
46
|
+
|
47
|
+
def initialize(browser, opts={})
|
48
|
+
@browser = browser
|
49
|
+
|
50
|
+
defaults = {
|
51
|
+
:name=>random_alphanums
|
52
|
+
}
|
53
|
+
options = defaults.merge(opts)
|
54
|
+
|
55
|
+
@name = options[:name]
|
56
|
+
@parent_folder = options[:parent_folder]
|
57
|
+
@site = options[:site]
|
58
|
+
raise "You must specify a Site for your Folder" if @site==nil
|
59
|
+
end
|
60
|
+
|
61
|
+
def create
|
62
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
63
|
+
resources unless @browser.title=~/Resources$/
|
64
|
+
on_page Resources do |page|
|
65
|
+
page.create_subfolders_in @parent_folder
|
66
|
+
end
|
67
|
+
on_page CreateFolders do |page|
|
68
|
+
page.folder_name.set @name
|
69
|
+
page.create_folders_now
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
class WebLinkObject
|
76
|
+
include PageHelper
|
77
|
+
include Utilities
|
78
|
+
include Workflows
|
79
|
+
|
80
|
+
attr_accessor
|
81
|
+
|
82
|
+
def initialize(browser, opts={})
|
83
|
+
@browser = browser
|
84
|
+
|
85
|
+
defaults = {}
|
86
|
+
options = defaults.merge(opts)
|
87
|
+
@site = options[:site]
|
88
|
+
raise "You must specify a Site for your Web Link" if @site==nil
|
89
|
+
end
|
90
|
+
|
91
|
+
def create
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
class HTMLPageObject
|
98
|
+
|
99
|
+
include PageHelper
|
100
|
+
include Utilities
|
101
|
+
include Workflows
|
102
|
+
|
103
|
+
attr_accessor :name, :description, :site, :folder, :html, :url
|
104
|
+
|
105
|
+
def initialize(browser, opts={})
|
106
|
+
@browser = browser
|
107
|
+
|
108
|
+
defaults = {
|
109
|
+
:name=>random_alphanums,
|
110
|
+
:description=>random_multiline(100, 15, :alpha),
|
111
|
+
:html=>"<body>Body</body>"
|
112
|
+
}
|
113
|
+
options = defaults.merge(opts)
|
114
|
+
|
115
|
+
@name = options[:name]
|
116
|
+
@description = options[:description]
|
117
|
+
@site = options[:site]
|
118
|
+
@folder = options[:folder]
|
119
|
+
@html = options[:html]
|
120
|
+
@site = options[:site]
|
121
|
+
raise "You must specify a Site for your HTML Page" if @site==nil
|
122
|
+
end
|
123
|
+
|
124
|
+
alias :title :name
|
125
|
+
alias :href :url
|
126
|
+
alias :content :html
|
127
|
+
|
128
|
+
def create
|
129
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
130
|
+
resources unless @browser.title=~/Resources$/
|
131
|
+
on_page Resources do |page|
|
132
|
+
page.create_html_page_in @folder
|
133
|
+
end
|
134
|
+
on_page EditHTMLPageContent do |page|
|
135
|
+
page.enter_source_text page.editor, @html
|
136
|
+
page.continue
|
137
|
+
end
|
138
|
+
on_page EditHTMLPageProperties do |page|
|
139
|
+
page.name.set @name
|
140
|
+
page.description.set @description
|
141
|
+
# Put more here as needed later
|
142
|
+
page.finish
|
143
|
+
end
|
144
|
+
on_page Resources do |page|
|
145
|
+
@url = page.href(@name)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def edit_content(html_source)
|
150
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
151
|
+
resources unless @browser.title=~/Resources$/
|
152
|
+
on Resources do |fileslist|
|
153
|
+
fileslist.open_folder @folder unless fileslist.item(@name).present? || @folder==nil
|
154
|
+
fileslist.edit_content @name
|
155
|
+
end
|
156
|
+
on EditHTMLPageContent do |edit|
|
157
|
+
edit.enter_source_text edit.editor, html_source
|
158
|
+
edit.continue
|
159
|
+
end
|
160
|
+
@html=html_source
|
161
|
+
end
|
162
|
+
|
163
|
+
end
|
164
|
+
|
165
|
+
class TextDocumentObject
|
166
|
+
include PageHelper
|
167
|
+
include Utilities
|
168
|
+
include Workflows
|
169
|
+
|
170
|
+
attr_accessor
|
171
|
+
|
172
|
+
def initialize(browser, opts={})
|
173
|
+
@browser = browser
|
174
|
+
|
175
|
+
defaults = {}
|
176
|
+
options = defaults.merge(opts)
|
177
|
+
@site = options[:site]
|
178
|
+
raise "You must specify a Site for your Text Document" if @site==nil
|
179
|
+
end
|
180
|
+
|
181
|
+
def create
|
182
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
183
|
+
resources unless @browser.title=~/Resources$/
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
class CitationListObject
|
189
|
+
include PageHelper
|
190
|
+
include Utilities
|
191
|
+
include Workflows
|
192
|
+
|
193
|
+
attr_accessor
|
194
|
+
|
195
|
+
def initialize(browser, opts={})
|
196
|
+
@browser = browser
|
197
|
+
|
198
|
+
defaults = {}
|
199
|
+
options = defaults.merge(opts)
|
200
|
+
@site = options[:site]
|
201
|
+
raise "You must specify a Site for your Citations List" if @site==nil
|
202
|
+
end
|
203
|
+
|
204
|
+
def create
|
205
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
206
|
+
resources unless @browser.title=~/Resources$/
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
class SiteObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Workflows
|
6
|
+
|
7
|
+
attr_accessor :name, :id, :subject, :course, :section, :term, :authorizer,
|
8
|
+
:web_content_source, :email, :joiner_role, :creation_date, :web_content_title,
|
9
|
+
:description, :short_description, :site_contact_name, :site_contact_email
|
10
|
+
|
11
|
+
def initialize(browser, opts={})
|
12
|
+
@browser = browser
|
13
|
+
|
14
|
+
defaults = {
|
15
|
+
:subject => random_alphanums(8),
|
16
|
+
:course => random_alphanums(8),
|
17
|
+
:section => random_alphanums(8),
|
18
|
+
:authorizer => "admin",
|
19
|
+
:web_content_title => random_alphanums(15),
|
20
|
+
:web_content_source => "http://www.rsmart.com",
|
21
|
+
:email=>random_nicelink(32),
|
22
|
+
:joiner_role => "Student",
|
23
|
+
:description => random_alphanums(30),
|
24
|
+
:short_description => random_alphanums,
|
25
|
+
:site_contact_name => random_alphanums(5)+" "+random_alphanums(8)
|
26
|
+
}
|
27
|
+
options = defaults.merge(opts)
|
28
|
+
|
29
|
+
@subject=options[:subject]
|
30
|
+
@course=options[:course]
|
31
|
+
@section=options[:section]
|
32
|
+
@authorizer=options[:authorizer]
|
33
|
+
@web_content_source=options[:web_content_source]
|
34
|
+
@email=options[:email]
|
35
|
+
@joiner_role=options[:joiner_role]
|
36
|
+
@web_content_title=options[:web_content_title]
|
37
|
+
@description=options[:description]
|
38
|
+
@short_description=options[:short_description]
|
39
|
+
@site_contact_name=options[:site_contact_name]
|
40
|
+
@site_contact_email=options[:site_contact_email]
|
41
|
+
end
|
42
|
+
|
43
|
+
def create
|
44
|
+
my_workspace unless @browser.title=~/My Workspace/
|
45
|
+
site_setup unless @browser.title=~/Site Setup/
|
46
|
+
on_page SiteSetup do |page|
|
47
|
+
page.new
|
48
|
+
end
|
49
|
+
on SiteType do |page|
|
50
|
+
# Select the Course Site radio button
|
51
|
+
page.course_site.set
|
52
|
+
# Store the selected term value for use later
|
53
|
+
@term = page.academic_term.value
|
54
|
+
|
55
|
+
page.continue
|
56
|
+
end
|
57
|
+
on CourseSectionInfo do |page|
|
58
|
+
# Fill in those fields, storing the entered values for later verification steps
|
59
|
+
page.subject.set @subject
|
60
|
+
|
61
|
+
page.course.set @course
|
62
|
+
|
63
|
+
page.section.set @section
|
64
|
+
|
65
|
+
# Store site name for ease of coding and readability later
|
66
|
+
@name = "#{@subject} #{@course} #{@section} #{@term}"
|
67
|
+
# Add a valid instructor id
|
68
|
+
page.authorizers_username.set @authorizer
|
69
|
+
|
70
|
+
# Click continue button
|
71
|
+
page.continue
|
72
|
+
end
|
73
|
+
on CourseSiteInfo do |page|
|
74
|
+
page.short_description.set @short_description
|
75
|
+
page.site_contact_name.set @site_contact_name
|
76
|
+
page.site_contact_email.set @site_contact_email
|
77
|
+
page.enter_source_text page.editor, @description
|
78
|
+
|
79
|
+
# Click Continue
|
80
|
+
page.continue
|
81
|
+
end
|
82
|
+
on EditSiteTools do |page|
|
83
|
+
#Check All Tools
|
84
|
+
page.all_tools.set
|
85
|
+
page.continue
|
86
|
+
end
|
87
|
+
on AddMultipleTools do |add_tools|
|
88
|
+
add_tools.site_email_address.set @email
|
89
|
+
add_tools.web_content_title.set @web_content_title
|
90
|
+
add_tools.web_content_source.set @web_content_source
|
91
|
+
|
92
|
+
add_tools.continue
|
93
|
+
end
|
94
|
+
on SiteAccess do |access|
|
95
|
+
access.allow.set
|
96
|
+
access.joiner_role.select @joiner_role
|
97
|
+
access.continue
|
98
|
+
end
|
99
|
+
on ConfirmSiteSetup do |review|
|
100
|
+
review.request_site
|
101
|
+
end
|
102
|
+
|
103
|
+
# Create a string that will match the new Site's "creation date" string
|
104
|
+
@creation_date = make_date(Time.now)
|
105
|
+
|
106
|
+
on SiteSetup do |site_setup|
|
107
|
+
site_setup.search(Regexp.escape(@subject))
|
108
|
+
|
109
|
+
# Get the site id for storage
|
110
|
+
@browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/
|
111
|
+
@id = $~.to_s
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def create_and_reuse_site(site_name)
|
116
|
+
my_workspace unless @browser.title=~/My Workspace/
|
117
|
+
site_setup unless @browser.title=~/Site Setup/
|
118
|
+
on_page SiteSetup do |page|
|
119
|
+
page.new
|
120
|
+
end
|
121
|
+
on SiteType do |site_type|
|
122
|
+
|
123
|
+
# Select the Course Site radio button
|
124
|
+
|
125
|
+
site_type.course_site.set
|
126
|
+
|
127
|
+
# Store the selected term value for use later
|
128
|
+
@term = site_type.academic_term.value
|
129
|
+
|
130
|
+
# Click continue
|
131
|
+
site_type.continue
|
132
|
+
end
|
133
|
+
on CourseSectionInfo do |course_section|
|
134
|
+
# Fill in those fields, storing the entered values for later verification steps
|
135
|
+
course_section.subject.set @subject
|
136
|
+
|
137
|
+
course_section.course.set @course
|
138
|
+
|
139
|
+
course_section.section.set @section
|
140
|
+
|
141
|
+
# Store site name for ease of coding and readability later
|
142
|
+
@name = "#{@subject} #{@course} #{@section} #{@term}"
|
143
|
+
|
144
|
+
# Add a valid instructor id
|
145
|
+
course_section.authorizers_username.set @authorizer
|
146
|
+
|
147
|
+
# Click continue button
|
148
|
+
course_section.continue
|
149
|
+
end
|
150
|
+
on CourseSiteInfo do |course_site|
|
151
|
+
course_site.enter_source_text course_site.editor, @description
|
152
|
+
course_site.short_description.set @short_description
|
153
|
+
# Click Continue
|
154
|
+
course_site.continue
|
155
|
+
end
|
156
|
+
on EditSiteTools do |course_tools|
|
157
|
+
#Check All Tools
|
158
|
+
course_tools.all_tools.set
|
159
|
+
course_tools.yes.set
|
160
|
+
course_tools.import_sites.select site_name
|
161
|
+
course_tools.continue
|
162
|
+
end
|
163
|
+
on_page ReUseMaterial do |page|
|
164
|
+
page.announcements_checkbox.set
|
165
|
+
page.calendar_checkbox.set
|
166
|
+
page.discussion_forums_checkbox.set
|
167
|
+
page.forums_checkbox.set
|
168
|
+
page.chat_room_checkbox.set
|
169
|
+
page.polls_checkbox.set
|
170
|
+
page.syllabus_checkbox.set
|
171
|
+
page.lessons_checkbox.set
|
172
|
+
page.resources_checkbox.set
|
173
|
+
page.assignments_checkbox.set
|
174
|
+
page.tests_and_quizzes_checkbox.set
|
175
|
+
page.gradebook_checkbox.set
|
176
|
+
page.gradebook2_checkbox.set
|
177
|
+
page.wiki_checkbox.set
|
178
|
+
page.news_checkbox.set
|
179
|
+
page.web_content_checkbox.set
|
180
|
+
page.site_statistics_checkbox.set
|
181
|
+
page.continue
|
182
|
+
end
|
183
|
+
on_page AddMultipleTools do |page|
|
184
|
+
page.site_email_address.set @email
|
185
|
+
page.web_content_title.set @web_content_title
|
186
|
+
page.web_content_source.set @web_content_source
|
187
|
+
page.continue
|
188
|
+
end
|
189
|
+
on_page SiteAccess do |page|
|
190
|
+
page.allow.set
|
191
|
+
page.joiner_role.select @joiner_role
|
192
|
+
page.continue
|
193
|
+
end
|
194
|
+
on_page ConfirmSiteSetup do |page|
|
195
|
+
page.request_site
|
196
|
+
end
|
197
|
+
# Create a string that will match the new Site's "creation date" string
|
198
|
+
@creation_date = make_date(Time.now)
|
199
|
+
on_page SiteSetup do |page|
|
200
|
+
page.search(Regexp.escape(@subject))
|
201
|
+
end
|
202
|
+
# Get the site id for storage
|
203
|
+
@browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/
|
204
|
+
@id = $~.to_s
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class SyllabusObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Workflows
|
6
|
+
|
7
|
+
attr_accessor :title, :content, :site
|
8
|
+
|
9
|
+
def initialize(browser, opts={})
|
10
|
+
@browser = browser
|
11
|
+
|
12
|
+
defaults = {
|
13
|
+
:title=>random_alphanums,
|
14
|
+
:content=>random_multiline(50, 5, :alpha)
|
15
|
+
}
|
16
|
+
options = defaults.merge(opts)
|
17
|
+
@title=options[:title]
|
18
|
+
@content=options[:content]
|
19
|
+
@site=options[:site]
|
20
|
+
raise "You must specify a Site for the announcement" if @site==nil
|
21
|
+
end
|
22
|
+
|
23
|
+
alias :name :title
|
24
|
+
|
25
|
+
def create
|
26
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
27
|
+
syllabus unless @browser.title=~/Syllabus$/
|
28
|
+
on Syllabus do |add|
|
29
|
+
add.create_edit
|
30
|
+
add.add
|
31
|
+
end
|
32
|
+
on AddEditSyllabusItem do |create|
|
33
|
+
create.title.set @title
|
34
|
+
create.enter_source_text create.editor, @content
|
35
|
+
create.post
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|