sambal-cle 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -0
- data/lib/sambal-cle/base_page.rb +20 -0
- data/lib/sambal-cle/core-ext.rb +90 -0
- data/lib/sambal-cle/data_objects/announcement.rb +82 -0
- data/lib/sambal-cle/data_objects/assessment.rb +32 -0
- data/lib/sambal-cle/data_objects/assignment.rb +205 -0
- data/lib/sambal-cle/data_objects/blog.rb +46 -0
- data/lib/sambal-cle/data_objects/blogger.rb +49 -0
- data/lib/sambal-cle/data_objects/chat_room.rb +54 -0
- data/lib/sambal-cle/data_objects/event.rb +89 -0
- data/lib/sambal-cle/data_objects/forum.rb +212 -0
- data/lib/sambal-cle/data_objects/lesson.rb +185 -0
- data/lib/sambal-cle/data_objects/message.rb +57 -0
- data/lib/sambal-cle/data_objects/poll.rb +74 -0
- data/lib/sambal-cle/data_objects/resource.rb +209 -0
- data/lib/sambal-cle/data_objects/site.rb +295 -0
- data/lib/sambal-cle/data_objects/syllabus.rb +73 -0
- data/lib/sambal-cle/data_objects/web_content_tool.rb +51 -0
- data/lib/sambal-cle/data_objects/wiki.rb +63 -0
- data/lib/sambal-cle/date_makers.rb +118 -0
- data/lib/sambal-cle/gem_ext.rb +23 -0
- data/lib/sambal-cle/page_helper.rb +22 -0
- data/lib/sambal-cle/page_maker.rb +48 -0
- data/lib/sambal-cle/page_objects/account.rb +111 -0
- data/lib/sambal-cle/page_objects/aliases.rb +43 -0
- data/lib/sambal-cle/page_objects/announcements.rb +190 -0
- data/lib/sambal-cle/page_objects/assessments.rb +874 -0
- data/lib/sambal-cle/page_objects/assignments.rb +770 -0
- data/lib/sambal-cle/page_objects/basic_lti.rb +6 -0
- data/lib/sambal-cle/page_objects/blogger.rb +205 -0
- data/lib/sambal-cle/page_objects/blogs.rb +60 -0
- data/lib/sambal-cle/page_objects/calendar.rb +330 -0
- data/lib/sambal-cle/page_objects/calendar_summary.rb +1 -0
- data/lib/sambal-cle/page_objects/chat_room.rb +22 -0
- data/lib/sambal-cle/page_objects/drop_box.rb +9 -0
- data/lib/sambal-cle/page_objects/email_archive.rb +22 -0
- data/lib/sambal-cle/page_objects/entity_picker.rb +62 -0
- data/lib/sambal-cle/page_objects/evaluations.rb +158 -0
- data/lib/sambal-cle/page_objects/feedback.rb +36 -0
- data/lib/sambal-cle/page_objects/forms.rb +120 -0
- data/lib/sambal-cle/page_objects/forums.rb +254 -0
- data/lib/sambal-cle/page_objects/glossary.rb +117 -0
- data/lib/sambal-cle/page_objects/gradebook.rb +29 -0
- data/lib/sambal-cle/page_objects/gradebook2.rb +17 -0
- data/lib/sambal-cle/page_objects/home.rb +36 -0
- data/lib/sambal-cle/page_objects/jforums.rb +444 -0
- data/lib/sambal-cle/page_objects/job_scheduler.rb +121 -0
- data/lib/sambal-cle/page_objects/lessons.rb +361 -0
- data/lib/sambal-cle/page_objects/login.rb +28 -0
- data/lib/sambal-cle/page_objects/matrix.rb +241 -0
- data/lib/sambal-cle/page_objects/media_gallery.rb +13 -0
- data/lib/sambal-cle/page_objects/messages.rb +622 -0
- data/lib/sambal-cle/page_objects/my_workspace.rb +44 -0
- data/lib/sambal-cle/page_objects/news.rb +8 -0
- data/lib/sambal-cle/page_objects/podcasts.rb +27 -0
- data/lib/sambal-cle/page_objects/polls.rb +69 -0
- data/lib/sambal-cle/page_objects/portfolio_templates.rb +161 -0
- data/lib/sambal-cle/page_objects/portfolios.rb +162 -0
- data/lib/sambal-cle/page_objects/post_em.rb +1 -0
- data/lib/sambal-cle/page_objects/profile.rb +51 -0
- data/lib/sambal-cle/page_objects/profile2.rb +344 -0
- data/lib/sambal-cle/page_objects/public_search.rb +61 -0
- data/lib/sambal-cle/page_objects/realms.rb +19 -0
- data/lib/sambal-cle/page_objects/resources.rb +326 -0
- data/lib/sambal-cle/page_objects/resources_roster.rb +0 -0
- data/lib/sambal-cle/page_objects/rosters.rb +70 -0
- data/lib/sambal-cle/page_objects/rwiki.rb +34 -0
- data/lib/sambal-cle/page_objects/search.rb +34 -0
- data/lib/sambal-cle/page_objects/sections.rb +295 -0
- data/lib/sambal-cle/page_objects/single_user.rb +1 -0
- data/lib/sambal-cle/page_objects/site_setup.rb +621 -0
- data/lib/sambal-cle/page_objects/site_statistics.rb +1 -0
- data/lib/sambal-cle/page_objects/sites.rb +255 -0
- data/lib/sambal-cle/page_objects/styles.rb +74 -0
- data/lib/sambal-cle/page_objects/syllabus.rb +166 -0
- data/lib/sambal-cle/page_objects/user_membership.rb +57 -0
- data/lib/sambal-cle/page_objects/users.rb +88 -0
- data/lib/sambal-cle/randomizers.rb +117 -0
- data/lib/sambal-cle/rich_text.rb +38 -0
- data/lib/sambal-cle/utilities.rb +31 -0
- data/lib/sambal-cle/workflows.rb +223 -0
- data/lib/sambal-cle.rb +31 -0
- data/sambal-cle.gemspec +14 -0
- data/test/add_assignment_to_calendar_spec.rb +86 -0
- data/test/assignment_announcements_spec.rb +71 -0
- data/test/assignment_gradebook_spec.rb +98 -0
- data/test/config.yml.template +4 -0
- data/test/directory.yml.template +123 -0
- data/test/duplicate_site_spec.rb +244 -0
- metadata +167 -0
@@ -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,295 @@
|
|
1
|
+
class SiteObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Randomizers
|
6
|
+
include DateMakers
|
7
|
+
include Workflows
|
8
|
+
|
9
|
+
attr_accessor :name, :id, :subject, :course, :section, :term, :authorizer,
|
10
|
+
:web_content_source, :email, :joiner_role, :creation_date, :web_content_title,
|
11
|
+
:description, :short_description, :site_contact_name, :site_contact_email
|
12
|
+
|
13
|
+
def initialize(browser, opts={})
|
14
|
+
@browser = browser
|
15
|
+
|
16
|
+
defaults = {
|
17
|
+
:subject => random_alphanums(8),
|
18
|
+
:course => random_alphanums(8),
|
19
|
+
:section => random_alphanums(8),
|
20
|
+
:authorizer => "admin",
|
21
|
+
:web_content_title => random_alphanums(15),
|
22
|
+
:web_content_source => "http://www.rsmart.com",
|
23
|
+
:email=>random_nicelink(32),
|
24
|
+
:joiner_role => "Student",
|
25
|
+
:description => random_alphanums(30),
|
26
|
+
:short_description => random_alphanums,
|
27
|
+
:site_contact_name => random_alphanums(5)+" "+random_alphanums(8)
|
28
|
+
}
|
29
|
+
options = defaults.merge(opts)
|
30
|
+
|
31
|
+
@subject=options[:subject]
|
32
|
+
@course=options[:course]
|
33
|
+
@section=options[:section]
|
34
|
+
@authorizer=options[:authorizer]
|
35
|
+
@web_content_source=options[:web_content_source]
|
36
|
+
@email=options[:email]
|
37
|
+
@joiner_role=options[:joiner_role]
|
38
|
+
@web_content_title=options[:web_content_title]
|
39
|
+
@description=options[:description]
|
40
|
+
@short_description=options[:short_description]
|
41
|
+
@site_contact_name=options[:site_contact_name]
|
42
|
+
@site_contact_email=options[:site_contact_email]
|
43
|
+
end
|
44
|
+
|
45
|
+
def create
|
46
|
+
my_workspace unless @browser.title=~/My Workspace/
|
47
|
+
site_setup unless @browser.title=~/Site Setup/
|
48
|
+
on_page SiteSetup do |page|
|
49
|
+
page.new
|
50
|
+
end
|
51
|
+
on SiteType do |page|
|
52
|
+
# Select the Course Site radio button
|
53
|
+
page.course_site.set
|
54
|
+
# Store the selected term value for use later
|
55
|
+
# TODO: Add logic here in case we want to actually SET the term value instead.
|
56
|
+
@term = page.academic_term.value
|
57
|
+
|
58
|
+
page.continue
|
59
|
+
end
|
60
|
+
on CourseSectionInfo do |page|
|
61
|
+
# Fill in those fields, storing the entered values for later verification steps
|
62
|
+
page.subject.set @subject
|
63
|
+
|
64
|
+
page.course.set @course
|
65
|
+
|
66
|
+
page.section.set @section
|
67
|
+
|
68
|
+
# Store site name for ease of coding and readability later
|
69
|
+
@name = "#{@subject} #{@course} #{@section} #{@term}"
|
70
|
+
# Add a valid instructor id
|
71
|
+
page.authorizers_username.set @authorizer
|
72
|
+
|
73
|
+
# Click continue button
|
74
|
+
page.continue
|
75
|
+
end
|
76
|
+
on CourseSiteInfo do |page|
|
77
|
+
page.short_description.set @short_description
|
78
|
+
page.site_contact_name.set @site_contact_name
|
79
|
+
page.site_contact_email.set @site_contact_email
|
80
|
+
page.enter_source_text page.editor, @description
|
81
|
+
|
82
|
+
# Click Continue
|
83
|
+
page.continue
|
84
|
+
end
|
85
|
+
on EditSiteTools do |page|
|
86
|
+
#Check All Tools
|
87
|
+
page.all_tools.set
|
88
|
+
page.continue
|
89
|
+
end
|
90
|
+
on AddMultipleTools do |add_tools|
|
91
|
+
add_tools.site_email_address.set @email
|
92
|
+
add_tools.web_content_title.set @web_content_title
|
93
|
+
add_tools.web_content_source.set @web_content_source
|
94
|
+
|
95
|
+
add_tools.continue
|
96
|
+
end
|
97
|
+
on SiteAccess do |access|
|
98
|
+
access.allow.set
|
99
|
+
access.joiner_role.select @joiner_role
|
100
|
+
access.continue
|
101
|
+
end
|
102
|
+
on ConfirmSiteSetup do |review|
|
103
|
+
review.request_site
|
104
|
+
end
|
105
|
+
|
106
|
+
# Create a string that will match the new Site's "creation date" string
|
107
|
+
@creation_date = make_date(Time.now)
|
108
|
+
|
109
|
+
on SiteSetup do |site_setup|
|
110
|
+
site_setup.search(Regexp.escape(@subject))
|
111
|
+
|
112
|
+
# Get the site id for storage
|
113
|
+
@browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/
|
114
|
+
@id = $~.to_s
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def create_and_reuse_site(site_name)
|
119
|
+
my_workspace unless @browser.title=~/My Workspace/
|
120
|
+
site_setup unless @browser.title=~/Site Setup/
|
121
|
+
on_page SiteSetup do |page|
|
122
|
+
page.new
|
123
|
+
end
|
124
|
+
on SiteType do |site_type|
|
125
|
+
|
126
|
+
# Select the Course Site radio button
|
127
|
+
|
128
|
+
site_type.course_site.set
|
129
|
+
|
130
|
+
# Store the selected term value for use later
|
131
|
+
@term = site_type.academic_term.value
|
132
|
+
|
133
|
+
# Click continue
|
134
|
+
site_type.continue
|
135
|
+
end
|
136
|
+
on CourseSectionInfo do |course_section|
|
137
|
+
# Fill in those fields, storing the entered values for later verification steps
|
138
|
+
course_section.subject.set @subject
|
139
|
+
|
140
|
+
course_section.course.set @course
|
141
|
+
|
142
|
+
course_section.section.set @section
|
143
|
+
|
144
|
+
# Store site name for ease of coding and readability later
|
145
|
+
@name = "#{@subject} #{@course} #{@section} #{@term}"
|
146
|
+
|
147
|
+
# Add a valid instructor id
|
148
|
+
course_section.authorizers_username.set @authorizer
|
149
|
+
|
150
|
+
# Click continue button
|
151
|
+
course_section.continue
|
152
|
+
end
|
153
|
+
on CourseSiteInfo do |course_site|
|
154
|
+
course_site.enter_source_text course_site.editor, @description
|
155
|
+
course_site.short_description.set @short_description
|
156
|
+
# Click Continue
|
157
|
+
course_site.continue
|
158
|
+
end
|
159
|
+
on EditSiteTools do |course_tools|
|
160
|
+
#Check All Tools
|
161
|
+
course_tools.all_tools.set
|
162
|
+
course_tools.yes.set
|
163
|
+
course_tools.import_sites.select site_name
|
164
|
+
course_tools.continue
|
165
|
+
end
|
166
|
+
on_page ReUseMaterial do |page|
|
167
|
+
page.announcements_checkbox.set
|
168
|
+
page.calendar_checkbox.set
|
169
|
+
page.discussion_forums_checkbox.set
|
170
|
+
page.forums_checkbox.set
|
171
|
+
page.chat_room_checkbox.set
|
172
|
+
page.polls_checkbox.set
|
173
|
+
page.syllabus_checkbox.set
|
174
|
+
page.lessons_checkbox.set
|
175
|
+
page.resources_checkbox.set
|
176
|
+
page.assignments_checkbox.set
|
177
|
+
page.tests_and_quizzes_checkbox.set
|
178
|
+
page.gradebook_checkbox.set
|
179
|
+
page.gradebook2_checkbox.set
|
180
|
+
page.wiki_checkbox.set
|
181
|
+
page.news_checkbox.set
|
182
|
+
page.web_content_checkbox.set
|
183
|
+
page.site_statistics_checkbox.set
|
184
|
+
page.continue
|
185
|
+
end
|
186
|
+
on_page AddMultipleTools do |page|
|
187
|
+
page.site_email_address.set @email
|
188
|
+
page.web_content_title.set @web_content_title
|
189
|
+
page.web_content_source.set @web_content_source
|
190
|
+
page.continue
|
191
|
+
end
|
192
|
+
on_page SiteAccess do |page|
|
193
|
+
page.allow.set
|
194
|
+
page.joiner_role.select @joiner_role
|
195
|
+
page.continue
|
196
|
+
end
|
197
|
+
on_page ConfirmSiteSetup do |page|
|
198
|
+
page.request_site
|
199
|
+
end
|
200
|
+
# Create a string that will match the new Site's "creation date" string
|
201
|
+
@creation_date = make_date(Time.now)
|
202
|
+
on_page SiteSetup do |page|
|
203
|
+
page.search(Regexp.escape(@subject))
|
204
|
+
end
|
205
|
+
# Get the site id for storage
|
206
|
+
@browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/
|
207
|
+
@id = $~.to_s
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
def duplicate opts={}
|
212
|
+
|
213
|
+
defaults = {
|
214
|
+
:name => random_alphanums,
|
215
|
+
:term => @term,
|
216
|
+
:subject => @subject,
|
217
|
+
:course => @course,
|
218
|
+
:section => @section,
|
219
|
+
:authorizer => @authorizer,
|
220
|
+
:web_content_title => @web_content_title,
|
221
|
+
:web_content_source => @web_content_source,
|
222
|
+
:email=>@email,
|
223
|
+
:joiner_role => @joiner_role,
|
224
|
+
:description => @description,
|
225
|
+
:short_description => @short_description,
|
226
|
+
:site_contact_name => @site_contact_name,
|
227
|
+
:site_contact_email => @site_contact_email
|
228
|
+
}
|
229
|
+
options = defaults.merge(opts)
|
230
|
+
|
231
|
+
new_site = make SiteObject, options
|
232
|
+
|
233
|
+
new_site.name=options[:name]
|
234
|
+
new_site.subject=options[:subject]
|
235
|
+
new_site.course=options[:course]
|
236
|
+
new_site.section=options[:section]
|
237
|
+
new_site.authorizer=options[:authorizer]
|
238
|
+
new_site.web_content_source=options[:web_content_source]
|
239
|
+
new_site.email=options[:email]
|
240
|
+
new_site.joiner_role=options[:joiner_role]
|
241
|
+
new_site.web_content_title=options[:web_content_title]
|
242
|
+
new_site.description=options[:description]
|
243
|
+
new_site.short_description=options[:short_description]
|
244
|
+
new_site.site_contact_name=options[:site_contact_name]
|
245
|
+
new_site.site_contact_email=options[:site_contact_email]
|
246
|
+
new_site.term=options[:term]
|
247
|
+
|
248
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
249
|
+
site_editor unless @browser.title=~/Site Editor$/
|
250
|
+
on SiteEditor do |edit|
|
251
|
+
edit.duplicate_site
|
252
|
+
end
|
253
|
+
on DuplicateSite do |dupe|
|
254
|
+
dupe.site_title.set new_site.name
|
255
|
+
dupe.academic_term.select new_site.term
|
256
|
+
dupe.duplicate
|
257
|
+
end
|
258
|
+
my_workspace
|
259
|
+
site_setup unless @browser.title=~/Site Setup/
|
260
|
+
on SiteSetup do |sites|
|
261
|
+
sites.search(Regexp.escape(new_site.name))
|
262
|
+
end
|
263
|
+
# Get the site id for storage
|
264
|
+
@browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/
|
265
|
+
new_site.id = $~.to_s
|
266
|
+
|
267
|
+
new_site
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
def add_official_participants opts={}
|
272
|
+
participants = opts[:participants].join("\n")
|
273
|
+
open_my_site_by_name @name unless @browser.title=~/#{@name}/
|
274
|
+
site_editor unless @browser.title=~/Site Editor$/
|
275
|
+
on SiteEditor do |site|
|
276
|
+
site.add_participants
|
277
|
+
end
|
278
|
+
on SiteSetupAddParticipants do |add|
|
279
|
+
add.official_participants.set participants
|
280
|
+
add.continue
|
281
|
+
end
|
282
|
+
on SiteSetupChooseRole do |choose|
|
283
|
+
choose.radio_button(opts[:role]).set
|
284
|
+
choose.continue
|
285
|
+
end
|
286
|
+
on SiteSetupParticipantEmail do |send|
|
287
|
+
send.continue
|
288
|
+
end
|
289
|
+
on SiteSetupParticipantConfirm do |confirm|
|
290
|
+
confirm.finish
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
|
295
|
+
end
|
@@ -0,0 +1,73 @@
|
|
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
|
+
def edit opts={}
|
40
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
41
|
+
syllabus unless @browser.title=~/Syllabus$/
|
42
|
+
on Syllabus do |syllabus|
|
43
|
+
reset
|
44
|
+
syllabus.create_edit
|
45
|
+
end
|
46
|
+
on SyllabusEdit do |edit|
|
47
|
+
edit.open_item @title
|
48
|
+
end
|
49
|
+
on AddEditSyllabusItem do |item|
|
50
|
+
item.title.set opts[:title] unless opts[:title]==nil
|
51
|
+
item.enter_source_text(item.editor, opts[:content]) unless opts[:content]==nil
|
52
|
+
end
|
53
|
+
@title = opts[:title] unless opts[:title]==nil
|
54
|
+
@content = opts[:content] unless opts[:content]==nil
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_properties
|
58
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
59
|
+
syllabus unless @browser.title=~/Syllabus$/
|
60
|
+
on Syllabus do |syllabus|
|
61
|
+
reset
|
62
|
+
syllabus.create_edit
|
63
|
+
end
|
64
|
+
on SyllabusEdit do |edit|
|
65
|
+
edit.open_item @title
|
66
|
+
end
|
67
|
+
on AddEditSyllabusItem do |item|
|
68
|
+
@content = item.get_source_text(item.editor)
|
69
|
+
# Add more here as necessary...
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class WebContentObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Workflows
|
6
|
+
|
7
|
+
attr_accessor :title, :source, :site
|
8
|
+
|
9
|
+
def initialize(browser, opts={})
|
10
|
+
@browser = browser
|
11
|
+
|
12
|
+
defaults = {
|
13
|
+
:title=>random_alphanums,
|
14
|
+
:source=>"www.rsmart.com"
|
15
|
+
}
|
16
|
+
options = defaults.merge(opts)
|
17
|
+
|
18
|
+
@title=options[:title]
|
19
|
+
@source=options[:source]
|
20
|
+
@site=options[:site]
|
21
|
+
raise "You need to specify a site for your web content" if @site==nil
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
my_workspace unless @browser.title=~/My Workspace/
|
26
|
+
site_setup unless @browser.title=~/Site Setup$/
|
27
|
+
on_page SiteSetup do |page|
|
28
|
+
page.edit @site
|
29
|
+
end
|
30
|
+
on_page SiteEditor do |page|
|
31
|
+
page.edit_tools
|
32
|
+
end
|
33
|
+
on_page EditSiteTools do |page|
|
34
|
+
page.web_content.set
|
35
|
+
page.continue
|
36
|
+
end
|
37
|
+
on_page AddMultipleTools do |page|
|
38
|
+
page.web_content_title.set @title
|
39
|
+
page.web_content_source.set @source
|
40
|
+
page.continue
|
41
|
+
end
|
42
|
+
on_page ConfirmSiteToolsEdits do |page|
|
43
|
+
page.finish
|
44
|
+
end
|
45
|
+
on_page SiteEditor do |page|
|
46
|
+
page.return_button.wait_until_present
|
47
|
+
page.return_to_sites_list
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
class WikiObject
|
2
|
+
|
3
|
+
include PageHelper
|
4
|
+
include Utilities
|
5
|
+
include Workflows
|
6
|
+
|
7
|
+
attr_accessor :title, :content, :site, :href
|
8
|
+
|
9
|
+
def initialize(browser, opts={})
|
10
|
+
@browser = browser
|
11
|
+
|
12
|
+
defaults = {
|
13
|
+
:title=>random_alphanums,
|
14
|
+
:content=>"{worksiteinfo}\n{sakai-sections}"
|
15
|
+
}
|
16
|
+
options = defaults.merge(opts)
|
17
|
+
|
18
|
+
@title=options[:title]
|
19
|
+
@content=options[:content]
|
20
|
+
@site=options[:site]
|
21
|
+
raise "You need to specify a site for your wiki" if @site==nil
|
22
|
+
end
|
23
|
+
|
24
|
+
alias :name :title
|
25
|
+
|
26
|
+
def create
|
27
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
28
|
+
wiki unless @browser.title=~/Wiki$/
|
29
|
+
on Rwiki do |home|
|
30
|
+
home.edit
|
31
|
+
@current_content = home.content.value
|
32
|
+
@updated_content = "[#{@title}]\n\n"+@current_content
|
33
|
+
home.content.set @updated_content
|
34
|
+
home.save
|
35
|
+
@href = home.wiki_href "#{@title}?"
|
36
|
+
home.open_wiki "#{@title}?"
|
37
|
+
home.edit
|
38
|
+
home.content.set @content
|
39
|
+
home.save
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def edit opts={}
|
44
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
45
|
+
wiki unless @browser.title=~/Wiki$/
|
46
|
+
on Rwiki do |edit|
|
47
|
+
edit.open_wiki @title
|
48
|
+
edit.edit
|
49
|
+
# TODO more here
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def get_content
|
54
|
+
open_my_site_by_name @site unless @browser.title=~/#{@site}/
|
55
|
+
wiki unless @browser.title=~/Wiki$/
|
56
|
+
on Rwiki do |edit|
|
57
|
+
edit.open_wiki @title
|
58
|
+
edit.edit
|
59
|
+
@content = edit.content.value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|