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,121 @@
|
|
1
|
+
#================
|
2
|
+
# Job Scheduler pages in Admin Workspace
|
3
|
+
#================
|
4
|
+
|
5
|
+
# The topmost page in the Job Scheduler in Admin Workspace
|
6
|
+
class JobScheduler < BasePage
|
7
|
+
|
8
|
+
frame_element
|
9
|
+
|
10
|
+
# Clicks the Jobs link, then instantiates
|
11
|
+
# the JobList Class.
|
12
|
+
def jobs
|
13
|
+
frm.link(:text=>"Jobs").click
|
14
|
+
JobList.new(@browser)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
# The list of Jobs (click the Jobs button on Job Scheduler)
|
20
|
+
class JobList < BasePage
|
21
|
+
|
22
|
+
frame_element
|
23
|
+
|
24
|
+
# Clicks the New Job link, then
|
25
|
+
# instantiates the CreateNewJob Class.
|
26
|
+
def new_job
|
27
|
+
frm.link(:text=>"New Job").click
|
28
|
+
CreateNewJob.new(@browser)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Clicks the link with the text "Triggers" associated with the
|
32
|
+
# specified job name,
|
33
|
+
# then instantiates the EditTriggers Class.
|
34
|
+
def triggers(job_name)
|
35
|
+
frm.div(:class=>"portletBody").table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(job_name)}/).link(:text=>/Triggers/).click
|
36
|
+
sleep 1
|
37
|
+
EditTriggers.new(@browser)
|
38
|
+
end
|
39
|
+
|
40
|
+
def event_log
|
41
|
+
frm.link(:text=>"Event Log").click
|
42
|
+
EventLog.new(@browser)
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
# The Create New Job page
|
48
|
+
class CreateNewJob < BasePage
|
49
|
+
|
50
|
+
frame_element
|
51
|
+
|
52
|
+
# Clicks the Post button, then
|
53
|
+
# instantiates the JobList Class.
|
54
|
+
def post
|
55
|
+
frm.button(:value=>"Post").click
|
56
|
+
JobList.new(@browser)
|
57
|
+
end
|
58
|
+
|
59
|
+
element(:job_name) { |b| b.frm.text_field(:id=>"_id2:job_name") }
|
60
|
+
element(:type) { |b| b.frm.select_list(:name=>"_id2:_id10") }
|
61
|
+
end
|
62
|
+
|
63
|
+
# The page for Editing Triggers
|
64
|
+
class EditTriggers < BasePage
|
65
|
+
|
66
|
+
frame_element
|
67
|
+
|
68
|
+
# Clicks the "Run Job Now" link, then
|
69
|
+
# instantiates the RunJobConfirmation Class.
|
70
|
+
def run_job_now
|
71
|
+
frm.div(:class=>"portletBody").link(:text=>"Run Job Now").click
|
72
|
+
RunJobConfirmation.new(@browser)
|
73
|
+
end
|
74
|
+
|
75
|
+
def return_to_jobs
|
76
|
+
frm.link(:text=>"Return_to_Jobs").click
|
77
|
+
JobList.new(@browser)
|
78
|
+
end
|
79
|
+
|
80
|
+
def new_trigger
|
81
|
+
frm.link(:text=>"New Trigger").click
|
82
|
+
CreateTrigger.new(@browser)
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
# The Create Trigger page
|
88
|
+
class CreateTrigger < BasePage
|
89
|
+
|
90
|
+
frame_element
|
91
|
+
|
92
|
+
def post
|
93
|
+
frm.button(:value=>"Post").click
|
94
|
+
EditTriggers.new(@browser)
|
95
|
+
end
|
96
|
+
|
97
|
+
element(:name) { |b| b.frm.text_field(:id=>"_id2:trigger_name") }
|
98
|
+
element(:cron_expression) { |b| b.frm.text_field(:id=>"_id2:trigger_expression") }
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
# The page for confirming you want to run a job
|
103
|
+
class RunJobConfirmation < BasePage
|
104
|
+
|
105
|
+
frame_element
|
106
|
+
|
107
|
+
# Clicks the "Run Now" button, then
|
108
|
+
# instantiates the JobList Class.
|
109
|
+
def run_now
|
110
|
+
frm.button(:value=>"Run Now").click
|
111
|
+
JobList.new(@browser)
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
# The page containing the Event Log
|
117
|
+
class EventLog < BasePage
|
118
|
+
|
119
|
+
frame_element
|
120
|
+
|
121
|
+
end
|
@@ -0,0 +1,360 @@
|
|
1
|
+
|
2
|
+
#================
|
3
|
+
# Lesson Pages
|
4
|
+
#================
|
5
|
+
|
6
|
+
# Contains items common to most Lessons pages.
|
7
|
+
class LessonsBase < BasePage
|
8
|
+
|
9
|
+
frame_element
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def menu_elements
|
13
|
+
# Clicks on the Preferences link on the Lessons page,
|
14
|
+
# next is the LessonPreferences class.
|
15
|
+
action(:preferences) { |b| b.frm.link(:text=>"Preferences").click }
|
16
|
+
|
17
|
+
action(:view) { |b| b.frm.link(:text=>"View").click }
|
18
|
+
|
19
|
+
action(:manage) { |b| b.frm.link(:text=>"Manage").click }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# The Lessons page in a site ("icon-sakai-melete")
|
25
|
+
#
|
26
|
+
# Note that this class is inclusive of both the
|
27
|
+
# Instructor/Admin and the Student views of this page
|
28
|
+
# many methods will error out if used when in the
|
29
|
+
# Student view.
|
30
|
+
class Lessons < LessonsBase
|
31
|
+
|
32
|
+
menu_elements
|
33
|
+
|
34
|
+
expected_element :lessons_table
|
35
|
+
|
36
|
+
element(:lessons_table) { |b| b.frm.table(:id=>/lis.+module.+form:table/) }
|
37
|
+
|
38
|
+
# Clicks the Add Module link, then
|
39
|
+
# next is the AddModule class.
|
40
|
+
action(:add_module) { |b| b.frm.link(:text=>"Add Module").click }
|
41
|
+
action(:add_content) { |b| b.frm.link(text: "Add Content").click }
|
42
|
+
action(:edit) { |b| b.frm.link(text: "Edit").click }
|
43
|
+
action(:left) { |b| b.frm.link(text: "Left").click }
|
44
|
+
action(:right) { |b| b.frm.link(text: "Right").click }
|
45
|
+
action(:delete) { |b| b.frm.link(text: "Delete").click }
|
46
|
+
action(:archive) { |b| b.frm.link(text: "Archive").click }
|
47
|
+
action(:move_sections) { |b| b.frm.link(text: "Move Section(s)").click }
|
48
|
+
|
49
|
+
# Clicks on the link that matches the supplied
|
50
|
+
# name value, next is the
|
51
|
+
# AddEditLesson, or ViewLesson class, depending
|
52
|
+
# on which page loads.
|
53
|
+
#
|
54
|
+
# Will error out if there is no
|
55
|
+
# matching link in the list.
|
56
|
+
def open_lesson(name)
|
57
|
+
frm.link(:text=>name).click
|
58
|
+
end
|
59
|
+
|
60
|
+
def href(name)
|
61
|
+
frm.link(:text=>name).href
|
62
|
+
end
|
63
|
+
|
64
|
+
def check_lesson(name)
|
65
|
+
frm.tr(text: /#{Regexp.escape(name)}/).td(class: "ModCheckClass").checkbox.set
|
66
|
+
end
|
67
|
+
|
68
|
+
def check_section(name)
|
69
|
+
frm.td(class: "SectionClass", text: /#{Regexp.escape(name)}/).checkbox.set
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns an array of the Module titles displayed on the page.
|
73
|
+
def lessons_list
|
74
|
+
list = []
|
75
|
+
lessons_table.links.each do |link|
|
76
|
+
if link.id=~/lis.+module.+form:table:.+:(edit|view)Mod/
|
77
|
+
list << link.text
|
78
|
+
end
|
79
|
+
end
|
80
|
+
return list
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns and array containing the list of section titles for the
|
84
|
+
# specified module.
|
85
|
+
def sections_list(module_name)
|
86
|
+
list = []
|
87
|
+
if lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).exist?
|
88
|
+
lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).links.each do |link|
|
89
|
+
if link.id=~/Sec/
|
90
|
+
list << link.text
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
return list
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
# The student user's view of a Lesson Module or Section.
|
100
|
+
class ViewModule < LessonsBase
|
101
|
+
|
102
|
+
menu_elements
|
103
|
+
|
104
|
+
def sections_list
|
105
|
+
list = []
|
106
|
+
frm.table(:id=>"viewmoduleStudentform:tablesec").links.each { |link| list << link.text }
|
107
|
+
return list
|
108
|
+
end
|
109
|
+
|
110
|
+
action(:next) { |b| b.frm.link(:text=>"Next").click }
|
111
|
+
|
112
|
+
# Returns the text of the Module title row
|
113
|
+
value(:module_title) { |b| b.frm.span(:id=>/modtitle/).text }
|
114
|
+
|
115
|
+
# Returns the text of the Section title row
|
116
|
+
value(:section_title) { |b| b.frm.span(:id=>/form:title/).text }
|
117
|
+
|
118
|
+
def content_include?(content)
|
119
|
+
frm.form(:id=>"viewsectionStudentform").text.include?(content)
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
# This is the Instructor's preview of the Student's view
|
125
|
+
# of the list of Lesson Modules.
|
126
|
+
class ViewModuleList < LessonsBase
|
127
|
+
|
128
|
+
menu_elements
|
129
|
+
|
130
|
+
# LessonStudentSide
|
131
|
+
def open_lesson(name)
|
132
|
+
frm.link(:text=>name).click
|
133
|
+
end
|
134
|
+
|
135
|
+
# SectionStudentSide
|
136
|
+
def open_section(name)
|
137
|
+
frm.link(:text=>name).click
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
# The instructor's preview of the student view of the lesson.
|
143
|
+
class LessonStudentSide < LessonsBase
|
144
|
+
|
145
|
+
menu_elements
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
# The instructor's preview of the student's view of the section.
|
150
|
+
class SectionStudentSide < LessonsBase
|
151
|
+
|
152
|
+
menu_elements
|
153
|
+
|
154
|
+
end
|
155
|
+
|
156
|
+
# The Managing Options page for Lessons
|
157
|
+
class LessonManage < LessonsBase
|
158
|
+
|
159
|
+
menu_elements
|
160
|
+
|
161
|
+
action(:manage_content) {|b| b.frm.link(:text=>"Manage Content").click }
|
162
|
+
|
163
|
+
action(:sort) {|b| b.frm.link(:text=>"Sort").click }
|
164
|
+
|
165
|
+
# Clicks the Import/Export button and
|
166
|
+
# next is the LessonImportExport class.
|
167
|
+
action(:import_export) {|b| b.frm.link(:text=>"Import/Export").click }
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
class LessonManageContent < LessonsBase
|
172
|
+
|
173
|
+
menu_elements
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
|
178
|
+
# The Sorting Modules and Sections page in Lessons
|
179
|
+
class LessonManageSort < LessonsBase
|
180
|
+
|
181
|
+
menu_elements
|
182
|
+
|
183
|
+
action(:sort_modules) { |b| b.frm.link(:id=>"SortSectionForm:sortmod").click }
|
184
|
+
action(:sort_sections) { |b| b.frm.link(:id=>"SortModuleForm:sortsec").click }
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
# The Import/Export page in Manage Lessons for a Site
|
189
|
+
class LessonImportExport < LessonsBase
|
190
|
+
|
191
|
+
menu_elements
|
192
|
+
|
193
|
+
# Uploads the file specified - meaning that it enters
|
194
|
+
# the target file information, then clicks the import
|
195
|
+
# button.
|
196
|
+
#
|
197
|
+
# The file path is an optional parameter.
|
198
|
+
def upload_IMS(file_name, file_path="")
|
199
|
+
frm.file_field(:name, "impfile").set(file_path + file_name)
|
200
|
+
frm.link(:id=>"importexportform:importModule").click
|
201
|
+
frm.table(:id=>"AutoNumber1").div(:text=>"Processing...").wait_while_present
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the text of the alert box.
|
205
|
+
value(:alert_text) { |b| b.frm.span(:class=>"BlueClass").text }
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
# The User preference options page for Lessons.
|
210
|
+
#
|
211
|
+
# Note that this class is inclusive of Student
|
212
|
+
# and Instructor views of the page. Thus,
|
213
|
+
# not all methods in the class will work
|
214
|
+
# at all times.
|
215
|
+
class LessonPreferences < LessonsBase
|
216
|
+
|
217
|
+
menu_elements
|
218
|
+
|
219
|
+
element(:expanded) { |b| b.frm.radio(:name=>"UserPreferenceForm:_id5", :index=>0) }
|
220
|
+
element(:collapsed) { |b| b.frm.radio(:name=>"UserPreferenceForm:_id5", :index=>1) }
|
221
|
+
action(:set) { |b| b.frm.link(:id=>"UserPreferenceForm:SetButton").click }
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
# This Class encompasses methods for both the Add and the Edit pages for Lesson Modules.
|
226
|
+
class AddEditModule < LessonsBase
|
227
|
+
|
228
|
+
menu_elements
|
229
|
+
|
230
|
+
expected_element :title
|
231
|
+
|
232
|
+
# Clicks the Add button for the Lesson Module
|
233
|
+
# next is the ConfirmModule class.
|
234
|
+
action(:add) { |b| b.frm.link(:id=>/ModuleForm:submitsave/).click }
|
235
|
+
|
236
|
+
# AddEditContentSection
|
237
|
+
action(:add_content_sections) { |b| b.frm.link(:id=>/ModuleForm:sectionButton/).click }
|
238
|
+
|
239
|
+
element(:title) { |b| b.frm.text_field(:name=>/ModuleForm:title/) }
|
240
|
+
element(:description) { |b| b.frm.text_field(:id=>/ModuleForm:description/) }
|
241
|
+
element(:keywords) { |b| b.frm.text_field(:id=>/ModuleForm:keywords/) }
|
242
|
+
element(:start_date) { |b| b.frm.text_field(:id=>/ModuleForm:startDate/) }
|
243
|
+
element(:end_date) { |b| b.frm.text_field( :id=>/ModuleForm:endDate/) }
|
244
|
+
|
245
|
+
end
|
246
|
+
|
247
|
+
# The confirmation page when you are saving a Lesson Module.
|
248
|
+
class ConfirmModule < LessonsBase
|
249
|
+
|
250
|
+
menu_elements
|
251
|
+
|
252
|
+
# Clicks the Add Content Sections button and
|
253
|
+
# next is the AddEditSection class.
|
254
|
+
action(:add_content_sections) { |b| b.frm.link(:id=>/ModuleConfirmForm:sectionButton/).click }
|
255
|
+
|
256
|
+
# Clicks the Return to Modules button, then
|
257
|
+
# instantiates the AddEditModule class.
|
258
|
+
action(:return_to_modules) { |b| b.frm.link(:id=>/ModuleConfirmForm:returnButton/).click }
|
259
|
+
|
260
|
+
end
|
261
|
+
|
262
|
+
# Page for adding a section to a Lesson.
|
263
|
+
class AddEditContentSection < LessonsBase
|
264
|
+
|
265
|
+
menu_elements
|
266
|
+
include FCKEditor
|
267
|
+
|
268
|
+
#expected_element :instructions
|
269
|
+
|
270
|
+
# Clicks the Add button on the page
|
271
|
+
# next is the ConfirmSectionAdd class.
|
272
|
+
action(:add) { |b| b.frm.link(:id=>/SectionForm:submitsave/).click }
|
273
|
+
|
274
|
+
# Pointer to the frame of the FCKEditor
|
275
|
+
# on the page.
|
276
|
+
element(:content_editor) { |b| b.frm.frame(:id, /SectionForm:fckEditorView:otherMeletecontentEditor_inputRichText___Frame/) }
|
277
|
+
|
278
|
+
def add_content=(text)
|
279
|
+
content_editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
|
280
|
+
end
|
281
|
+
|
282
|
+
def clear_content # FIXME - This is an extra method now that we have the FCKEditor module
|
283
|
+
content_editor.div(:title=>"Select All").fire_event("onclick")
|
284
|
+
content_editor.send_keys :backspace
|
285
|
+
end
|
286
|
+
|
287
|
+
# SelectingContent
|
288
|
+
action(:select_url) { |b| b.frm.link(:id=>"AddSectionForm:ContentLinkView:serverViewButton").click }
|
289
|
+
|
290
|
+
# This method clicks the Select button that appears on the page
|
291
|
+
# then call the LessonAddAttachment class.
|
292
|
+
action(:select_or_upload_file) { |b| b.frm.link(:id=>"AddSectionForm:ResourceHelperLinkView:serverViewButton").click }
|
293
|
+
|
294
|
+
# Clicks the select button for "Upload or link to a file"
|
295
|
+
# NOT for "Upload or link to a file in Resources"!
|
296
|
+
action(:select_a_file) { |b| b.frm.link(:id=>"AddSectionForm:ContentUploadView:serverViewButton").click }
|
297
|
+
|
298
|
+
element(:title) { |b| b.frm.text_field(:id=>/SectionForm:title/) }
|
299
|
+
element(:instructions) { |b| b.frm.text_field(:id=>/SectionForm:instr/) }
|
300
|
+
element(:content_type) { |b| b.frm.select(:id=>/SectionForm:contentType/) }
|
301
|
+
element(:copyright_status) { |b| b.frm.select(:id=>/SectionForm:ResourcePropertiesPanel:licenseCodes/) }
|
302
|
+
|
303
|
+
action(:check_auditory) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).set }
|
304
|
+
action(:check_textual) { |b| b.frm.checkbox(:id=>/SectionForm:contentext/).set }
|
305
|
+
action(:check_visual) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).set }
|
306
|
+
action(:uncheck_auditory) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).clear }
|
307
|
+
action(:uncheck_textual) { |b| b.frm.checkbox(:id=>/SectionForm:contentext/).clear }
|
308
|
+
action(:uncheck_visual) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).clear }
|
309
|
+
|
310
|
+
element(:url_title) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_name/) }
|
311
|
+
element(:url_description) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_desc/) }
|
312
|
+
element(:file_description) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_desc/) }
|
313
|
+
|
314
|
+
action(:add_another_section) { |b| frm.link(:id=>/:saveAddAnotherButton/).click }
|
315
|
+
action(:finish) { |b| b.frm.link(id: /FinishButton/).click }
|
316
|
+
action(:save) { |b| b.frm.link(id: /saveButton/).click }
|
317
|
+
|
318
|
+
end
|
319
|
+
|
320
|
+
# Confirmation page for Adding (or Editing)
|
321
|
+
# a Section to a Module in Lessons.
|
322
|
+
class ConfirmSectionAdd < LessonsBase
|
323
|
+
|
324
|
+
menu_elements
|
325
|
+
|
326
|
+
# Clicks the Add Another Section button
|
327
|
+
# next is the AddEditContentSection class.
|
328
|
+
action(:add_another_section) { |b| b.frm.link(:id=>/SectionConfirmForm:saveAddAnotherbutton/).click }
|
329
|
+
|
330
|
+
# Clicks the Finish button
|
331
|
+
# next is the Lessons class.
|
332
|
+
action(:finish) { |b| b.frm.link(:id=>/Form:FinishButton/).click }
|
333
|
+
|
334
|
+
end
|
335
|
+
|
336
|
+
#
|
337
|
+
class SelectingContent < LessonsBase
|
338
|
+
|
339
|
+
menu_elements
|
340
|
+
|
341
|
+
# AddEditContentSection
|
342
|
+
action(:continue) { |b| b.frm.link(:id=>"ServerViewForm:addButton").click }
|
343
|
+
|
344
|
+
element(:new_url) { |b| b.frm.text_field(:id=>"ServerViewForm:link") }
|
345
|
+
element(:url_title) { |b| b.frm.text_field(:id=>"ServerViewForm:link_title") }
|
346
|
+
|
347
|
+
end
|
348
|
+
|
349
|
+
#
|
350
|
+
class LessonAddAttachment < LessonsBase # TODO: DRY up this class
|
351
|
+
|
352
|
+
menu_elements
|
353
|
+
|
354
|
+
action(:continue) { |b| b.frm.link(:id=>"UploadServerViewForm:addButton").click }
|
355
|
+
|
356
|
+
def upload_local_file(filename, filepath="")
|
357
|
+
frm.file_field(:id=>"file1").set(filepath + filename)
|
358
|
+
end
|
359
|
+
|
360
|
+
end
|