sambal-cle 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -0
- data/Gemfile.lock +44 -0
- data/lib/sambal-cle/data_objects/announcement.rb +7 -7
- data/lib/sambal-cle/data_objects/assessment.rb +26 -77
- data/lib/sambal-cle/data_objects/assessment_submission.rb +26 -0
- data/lib/sambal-cle/data_objects/assignment.rb +40 -40
- data/lib/sambal-cle/data_objects/assignment_permissions.rb +4 -4
- data/lib/sambal-cle/data_objects/assignment_submission.rb +4 -4
- data/lib/sambal-cle/data_objects/blog.rb +2 -2
- data/lib/sambal-cle/data_objects/blogger.rb +3 -3
- data/lib/sambal-cle/data_objects/chat_room.rb +2 -2
- data/lib/sambal-cle/data_objects/{site.rb → course.rb} +24 -20
- data/lib/sambal-cle/data_objects/event.rb +4 -4
- data/lib/sambal-cle/data_objects/forum.rb +21 -22
- data/lib/sambal-cle/data_objects/glossary_term.rb +71 -0
- data/lib/sambal-cle/data_objects/lesson.rb +10 -9
- data/lib/sambal-cle/data_objects/matrix.rb +142 -0
- data/lib/sambal-cle/data_objects/message.rb +2 -2
- data/lib/sambal-cle/data_objects/poll.rb +2 -2
- data/lib/sambal-cle/data_objects/portfolio.rb +120 -0
- data/lib/sambal-cle/data_objects/questions.rb +690 -0
- data/lib/sambal-cle/data_objects/resource.rb +12 -12
- data/lib/sambal-cle/data_objects/syllabus.rb +7 -7
- data/lib/sambal-cle/data_objects/web_content_tool.rb +2 -2
- data/lib/sambal-cle/data_objects/wiki.rb +6 -6
- data/lib/sambal-cle/page_objects/assessments.rb +165 -157
- data/lib/sambal-cle/page_objects/assignments.rb +17 -17
- data/lib/sambal-cle/page_objects/glossary.rb +14 -64
- data/lib/sambal-cle/page_objects/matrix.rb +77 -113
- data/lib/sambal-cle/page_objects/portfolios.rb +0 -2
- data/lib/sambal-cle/page_objects/resources.rb +4 -4
- data/lib/sambal-cle/page_objects/site_setup.rb +31 -23
- data/lib/sambal-cle/page_objects/sites.rb +2 -12
- data/lib/sambal-cle/utilities.rb +0 -6
- data/lib/sambal-cle/workflows.rb +77 -76
- data/lib/sambal-cle.rb +2 -2
- data/sambal-cle.gemspec +2 -2
- data/test/add_assignment_to_calendar_spec.rb +4 -4
- data/test/assessment_create_spec.rb +1 -1
- data/test/assessment_feedback_spec.rb +78 -0
- data/test/assessment_publish_spec.rb +102 -0
- data/test/assignment_announcements_spec.rb +4 -4
- data/test/assignment_duplicate_spec.rb +4 -4
- data/test/assignment_gradebook_spec.rb +4 -4
- data/test/assignment_permissions_spec.rb +5 -5
- data/test/assignments_grading_spec.rb +4 -4
- data/test/assignments_submission_spec.rb +4 -4
- data/test/duplicate_site_spec.rb +2 -2
- data/test/glossary_term_create_spec.rb +71 -0
- data/test/import_site_content_spec.rb +3 -3
- data/test/test_spec.rb +51 -0
- metadata +16 -5
@@ -192,18 +192,18 @@ class AssignmentsList < AssignmentsBase
|
|
192
192
|
|
193
193
|
# Clicks the Edit link for the assignment with the specified
|
194
194
|
# id, then instantiates the AssignmentAdd page class.
|
195
|
-
|
195
|
+
action(:edit_assignment_id) { |id, b| b.frm.link(:href=>/#{Regexp.escape(id)}/).click }
|
196
196
|
|
197
197
|
# Clicks the Edit link for the Assignment specified.
|
198
198
|
# next is the AssignmentAdd page class.
|
199
|
-
|
199
|
+
action(:edit_assignment) { |assignment_name, b|
|
200
200
|
index = b.assignments_titles.index(assignment_name)
|
201
201
|
b.frm.link(:text=>"Edit", :index=>index).click
|
202
202
|
}
|
203
203
|
|
204
204
|
# Checks the appropriate checkbox, based on the specified assignment_name
|
205
205
|
# Then clicks the Update button and confirms the deletion request.
|
206
|
-
|
206
|
+
action(:delete) { |assignment_name, b|
|
207
207
|
b.assignments_table.row(:text=>/#{Regexp.escape(assignment_name)}/).checkbox(:name=>"selectedAssignments").set
|
208
208
|
b.frm.button(:value=>"Update").click
|
209
209
|
b.frm.button(:value=>"Delete").click
|
@@ -211,33 +211,33 @@ class AssignmentsList < AssignmentsBase
|
|
211
211
|
|
212
212
|
# Clicks on the Duplicate link for the Assignment specified.
|
213
213
|
# Then instantiates the AssignmentsList page class.
|
214
|
-
|
214
|
+
action(:duplicate) { |assignment_name, b|
|
215
215
|
index = b.assignments_titles.index(assignment_name)
|
216
216
|
b.frm.link(:text=>"Duplicate", :index=>index).click
|
217
217
|
}
|
218
218
|
|
219
219
|
# Gets the assignment id from the href of the specified
|
220
220
|
# Assignment link.
|
221
|
-
|
222
|
-
|
221
|
+
action(:get_assignment_id) { |assignment_name, b| b.assignment_href(assignment_name) =~ /(?<=\/a\/\S{36}\/).+(?=&pan)/; $~.to_s }
|
222
|
+
action(:assignment_href) { |name, b| b.frm.link(:text=>/#{Regexp.escape(name)}/).href }
|
223
223
|
|
224
224
|
# Checks the checkbox for the specified Assignment,
|
225
225
|
# using the assignment id as the identifier.
|
226
|
-
|
227
|
-
|
226
|
+
action(:check_assignment) { |id,b| b.frm.checkbox(:value, /#{id}/).set } #FIXME to use name instead of id.
|
227
|
+
action(:open_assignment) { |assignment_name, b| b.frm.link(:text=>assignment_name).click }
|
228
228
|
|
229
229
|
# Gets the contents of the status column
|
230
230
|
# for the specified assignment
|
231
|
-
|
231
|
+
action(:status_of) { |assignment_name, b| b.assignments_table.row(:text=>/#{Regexp.escape(assignment_name)}/).td(:headers=>"status").text }
|
232
232
|
|
233
233
|
# Clicks the View Submissions link for the specified
|
234
234
|
# Assignment, then instantiates the AssignmentSubmissionList
|
235
235
|
# page class.
|
236
|
-
|
236
|
+
action(:view_submissions_for) { |assignment_name, b| b.assignments_table.row(:text=>/#{Regexp.escape(assignment_name)}/).link(:text=>"View Submissions").click }
|
237
237
|
|
238
238
|
# Clicks the Grade link for the specified Assignment,
|
239
239
|
# then instantiates the AssignmentSubmissionList page class.
|
240
|
-
|
240
|
+
action(:grade) { |assignment_name, b| b.assignments_table.row(:text=>/#{Regexp.escape(assignment_name)}/).link(:text=>"Grade").click }
|
241
241
|
|
242
242
|
action(:sort_assignment_title) { |b| b.frm.link(:text=>"Assignment title").click }
|
243
243
|
action(:sort_status) { |b| b.frm.link(:text=>"Status").click }
|
@@ -312,7 +312,7 @@ class AssignmentsPreview < AssignmentsBase
|
|
312
312
|
end
|
313
313
|
|
314
314
|
# Grabs the Assignment Instructions text.
|
315
|
-
value(:instructions) { |b| b.frm.div(:
|
315
|
+
value(:instructions) { |b| b.frm.div(:id=>"instructions").text }
|
316
316
|
|
317
317
|
# Grabs the instructor comments text.
|
318
318
|
value(:instructor_comments) { |b| b.frm.div(:class=>"portletBody").div(:class=>"textPanel", :index=>2).text }
|
@@ -396,10 +396,10 @@ class AssignmentStudentView < BasePage
|
|
396
396
|
action(:back_to_list) { |b| b.frm.button(:value=>"Back to list").click }
|
397
397
|
action(:preview) { |p| p.preview_button.click }
|
398
398
|
|
399
|
-
element(:instructor_comment_field) { |b| b.frm.
|
399
|
+
element(:instructor_comment_field) { |b| b.frm.div(:id=>"instructor_comment") }
|
400
400
|
|
401
|
-
value(:instructions) { |b| b.frm.div(:
|
402
|
-
value(:submission_text) { |b| b.frm.
|
401
|
+
value(:instructions) { |b| b.frm.div(:id=>"instructions").text }
|
402
|
+
value(:submission_text) { |b| b.frm.div(:id=>"submission").text }
|
403
403
|
value(:instructor_comments) { |p| p.instructor_comment_field.text }
|
404
404
|
|
405
405
|
# Returns an array of strings. Each element in the
|
@@ -458,7 +458,7 @@ class AssignmentSubmissionList < AssignmentsBase
|
|
458
458
|
|
459
459
|
# Clicks the Grade link for the specified student, then
|
460
460
|
# instantiates the AssignmentSubmission page class.
|
461
|
-
|
461
|
+
action(:grade) { |student_name, b| b.frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(student_name)}/).link(:text=>"Grade").click }
|
462
462
|
|
463
463
|
# Gets the value of the status field for the specified
|
464
464
|
# Student. Note that the student's name needs to be entered
|
@@ -467,7 +467,7 @@ class AssignmentSubmissionList < AssignmentsBase
|
|
467
467
|
# students with the same name.
|
468
468
|
#
|
469
469
|
# Useful for verification purposes.
|
470
|
-
|
470
|
+
action(:submission_status_of) { |student_name, b| b.frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(student_name)}/)[4].text }
|
471
471
|
|
472
472
|
element(:search_input) { |b| b.frm.text_field(:id=>"search") }
|
473
473
|
action(:find) { |b| b.frm.button(:value=>"Find").click }
|
@@ -6,31 +6,15 @@ class Glossary < BasePage
|
|
6
6
|
|
7
7
|
frame_element
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
frm.frame(:id, "longDescription___Frame").td(:id, "xEditingArea").wait_until_present
|
12
|
-
AddEditTerm.new(@browser)
|
13
|
-
end
|
14
|
-
|
15
|
-
def import
|
16
|
-
frm.link(:text=>"Import").click
|
17
|
-
GlossaryImport.new(@browser)
|
18
|
-
end
|
9
|
+
action(:add) { |b| b.frm.link(:text=>"Add").click }
|
10
|
+
action(:import) { |b| b.frm.link(:text=>"Import").click }
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
AddEditTerm.new(@browser)
|
23
|
-
end
|
24
|
-
|
25
|
-
def delete(term)
|
26
|
-
frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(term)}/).link(:text=>"Delete").click
|
27
|
-
AddEditTerm.new(@browser)
|
28
|
-
end
|
12
|
+
action(:edit) { |term, b| b.frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(term)}/).link(:text=>"Edit").click }
|
13
|
+
action(:delete) { |term, b| b.frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(term)}/).link(:text=>"Delete").click }
|
29
14
|
|
30
|
-
|
31
|
-
frm.link(:text=>term).click
|
32
|
-
|
33
|
-
# Need to do special handling here because of the new window.
|
15
|
+
action(:open) do |term, b|
|
16
|
+
b.frm.link(:text=>term).click
|
17
|
+
b.window(:title=>term).use
|
34
18
|
end
|
35
19
|
|
36
20
|
# Returns an array containing the string values of the terms
|
@@ -48,23 +32,24 @@ end
|
|
48
32
|
|
49
33
|
class AddEditTerm < BasePage
|
50
34
|
|
35
|
+
include FCKEditor
|
51
36
|
frame_element
|
52
37
|
|
38
|
+
expected_element :editor
|
39
|
+
|
53
40
|
def add_term
|
54
41
|
frm.button(:value=>"Add Term").click
|
55
|
-
Glossary.new(@browser)
|
56
42
|
end
|
57
43
|
|
58
44
|
def save_changes
|
59
45
|
frm.button(:value=>"Save Changes").click
|
60
|
-
Glossary.new(@browser)
|
61
46
|
end
|
62
47
|
|
63
48
|
def long_description=(text)
|
64
|
-
|
49
|
+
editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
|
65
50
|
end
|
66
51
|
|
67
|
-
|
52
|
+
element(:editor) { |b| b.frm.frame(:id, "longDescription___Frame") }
|
68
53
|
element(:term) { |b| b.frm.text_field(:id=>"term-id") }
|
69
54
|
element(:short_description) { |b| b.frm.text_field(:id=>"description-id") }
|
70
55
|
|
@@ -75,43 +60,8 @@ class GlossaryImport < BasePage
|
|
75
60
|
|
76
61
|
frame_element
|
77
62
|
|
78
|
-
|
79
|
-
frm.link(:text=>"Select file...").click
|
80
|
-
GlossaryAttach.new(@browser)
|
81
|
-
end
|
82
|
-
|
83
|
-
def import
|
84
|
-
frm.button(:value=>"Import").click
|
85
|
-
Glossary.new(@browser)
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
# The file upload page for Glossary importing
|
91
|
-
class GlossaryFileUpload < BasePage
|
92
|
-
|
93
|
-
frame_element
|
94
|
-
|
95
|
-
@@filex=0
|
63
|
+
action(:select_file) { |b| b.frm.link(:text=>"Select file...").click }
|
96
64
|
|
97
|
-
|
98
|
-
# multiple times, but it assumes
|
99
|
-
# that the add_another_file method is used
|
100
|
-
# before it, every time except before the first time.
|
101
|
-
def file_to_upload(file_name, file_path="")
|
102
|
-
frm.file_field(:id, "content_#{@@filex}").set(file_path + file_name)
|
103
|
-
@@filex+=1
|
104
|
-
end
|
105
|
-
|
106
|
-
def upload_files_now
|
107
|
-
frm.button(:value=>"Upload Files Now").click
|
108
|
-
sleep 0.5
|
109
|
-
@@filex=0
|
110
|
-
GlossaryAttach.new(@browser)
|
111
|
-
end
|
112
|
-
|
113
|
-
def add_another_file
|
114
|
-
frm.link(:text=>"Add Another File").click
|
115
|
-
end
|
65
|
+
action(:import) { |b| b.frm.button(:value=>"Import").click }
|
116
66
|
|
117
67
|
end
|
@@ -9,74 +9,68 @@ class Matrices < BasePage
|
|
9
9
|
|
10
10
|
# Clicks the Add link and instantiates
|
11
11
|
# the AddEditMatrix Class.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
action(:add) { |b| b.frm.link(:text=>"Add").click }
|
13
|
+
action(:import) { |b| b.frm.link(:text=>"Import").click }
|
14
|
+
action(:manage_site_associations) { |b| b.frm.link(:text=>"Manage Site Associations").click }
|
15
|
+
action(:permissions) { |b| b.frm.link(:text=>"Permissions").click }
|
16
|
+
action(:my_preferences) { |b| b.frm.link(:text=>"My Preferences").click }
|
16
17
|
|
17
18
|
# Clicks the "Edit" link for the specified
|
18
19
|
# Matrix item, then instantiates the EditMatrixCells.
|
19
|
-
|
20
|
-
frm.table(:class=>"listHier lines nolines").tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Edit").click
|
21
|
-
EditMatrixCells.new(@browser)
|
22
|
-
end
|
20
|
+
action(:edit) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Edit").click }
|
23
21
|
|
24
22
|
# Clicks the "Preview" link for the specified
|
25
23
|
# Matrix item.
|
26
|
-
|
27
|
-
frm.table(:class=>"listHier lines nolines").tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Preview").click
|
28
|
-
end
|
24
|
+
action(:preview) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Preview").click }
|
29
25
|
|
30
26
|
# Clicks the "Publish" link for the specified
|
31
27
|
# Matrix item, then instantiates the ConfirmPublishMatrix Class.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
action(:publish) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Publish").click }
|
29
|
+
|
30
|
+
action(:delete) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Delete").click }
|
31
|
+
|
32
|
+
action(:export) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Export").click }
|
36
33
|
|
34
|
+
action(:permissions) { |matrixname, b| b.matrix_table.tr(:text=>/#{Regexp.escape(matrixname)}/).link(:text=>"Permissions").click }
|
35
|
+
|
36
|
+
element(:matrix_table) { |b| b.frm.table(:class=>"listHier lines nolines") }
|
37
|
+
|
38
|
+
def matrices_list
|
39
|
+
text_array = matrix_table.to_a
|
40
|
+
text_array.delete_at(0) # deletes the header row which is useless
|
41
|
+
list=[]
|
42
|
+
text_array.each do |line|
|
43
|
+
list << line[0]
|
44
|
+
end
|
45
|
+
list
|
46
|
+
end
|
37
47
|
|
38
48
|
end
|
39
49
|
|
40
50
|
#
|
41
51
|
class AddEditMatrix < BasePage
|
42
52
|
|
53
|
+
include FCKEditor
|
43
54
|
frame_element
|
44
55
|
|
45
|
-
|
46
|
-
# instantiates the Matrices Class.
|
47
|
-
def create_matrix
|
48
|
-
frm.button(:value=>"Create Matrix").click
|
49
|
-
Matrices.new(@browser)
|
50
|
-
end
|
56
|
+
expected_element :editor
|
51
57
|
|
52
|
-
|
53
|
-
# instantiates the EditMatrixCells Class.
|
54
|
-
def save_changes
|
55
|
-
frm.button(:value=>"Save Changes").click
|
56
|
-
EditMatrixCells.new(@browser)
|
57
|
-
end
|
58
|
+
element(:editor) { |b| b.frm.frame(:id=>"descriptionTextArea___Frame") }
|
58
59
|
|
59
|
-
# Clicks the "
|
60
|
-
|
61
|
-
def select_style
|
62
|
-
frm.link(:text=>"Select Style").click
|
63
|
-
SelectMatrixStyle.new(@browser)
|
64
|
-
end
|
60
|
+
# Clicks the "Create Matrix" button
|
61
|
+
action(:create_matrix) { |b| b.frm.button(:value=>"Create Matrix").click }
|
65
62
|
|
66
|
-
# Clicks the "
|
67
|
-
|
68
|
-
def add_column
|
69
|
-
frm.link(:text=>"Add Column").click
|
70
|
-
AddEditColumn.new(@browser)
|
71
|
-
end
|
63
|
+
# Clicks the "Save Changes" button
|
64
|
+
action(:save_changes) { |b| b.frm.button(:value=>"Save Changes").click }
|
72
65
|
|
73
|
-
# Clicks the "
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
66
|
+
# Clicks the "Select Style" link
|
67
|
+
action(:select_style) { |b| b.frm.link(:text=>"Select Style").click }
|
68
|
+
|
69
|
+
# Clicks the "Add Column" link
|
70
|
+
action(:add_column) { |b| b.frm.link(:text=>"Add Column").click }
|
79
71
|
|
72
|
+
# Clicks the "Add Row" link
|
73
|
+
action(:add_row) { |b| b.frm.link(:text=>"Add Row").click }
|
80
74
|
|
81
75
|
element(:title) { |b| b.frm.text_field(:id=>"title-id") }
|
82
76
|
|
@@ -89,53 +83,38 @@ class SelectMatrixStyle < BasePage
|
|
89
83
|
|
90
84
|
# Clicks the "Go Back" button and
|
91
85
|
# instantiates the AddEditMatrix Class.
|
92
|
-
|
93
|
-
frm.button(:value=>"Go Back").click
|
94
|
-
AddEditMatrix.new(@browser)
|
95
|
-
end
|
86
|
+
action(:go_back) { |b| b.frm.button(:value=>"Go Back").click }
|
96
87
|
|
97
88
|
# Clicks the "Select" link for the specified
|
98
89
|
# Style, then instantiates the AddEditMatrix Class.
|
99
|
-
|
100
|
-
frm.table(:class=>/listHier lines/).tr(:text=>/#{Regexp.escape(stylename)}/).link(:text=>"Select").click
|
101
|
-
AddEditMatrix.new(@browser)
|
102
|
-
end
|
90
|
+
action(:select_style) { |stylename, b| b.frm.table(:class=>/listHier lines/).tr(:text=>/#{Regexp.escape(stylename)}/).link(:text=>"Select").click }
|
103
91
|
|
104
92
|
end
|
105
93
|
|
106
|
-
|
107
|
-
class AddEditColumn < BasePage
|
94
|
+
class RowColumnCommon < BasePage
|
108
95
|
|
109
96
|
frame_element
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
97
|
+
class << self
|
98
|
+
def table_elements
|
99
|
+
action(:update) { |b| b.frm.button(:value=>"Update").click }
|
100
|
+
element(:name) { |b| b.frm.text_field(:name=>"description") }
|
101
|
+
element(:background_color) { |b| b.frm.text_field(:id=>"color-id") }
|
102
|
+
element(:font_color) { |b| b.frm.text_field(:id=>"textColor-id") }
|
103
|
+
end
|
116
104
|
end
|
117
|
-
|
118
|
-
|
119
|
-
element(:name) { |b| b.frm.text_field(:name=>"description") }
|
120
|
-
|
121
105
|
end
|
122
106
|
|
123
107
|
#
|
124
|
-
class
|
108
|
+
class AddEditColumn < RowColumnCommon
|
125
109
|
|
126
|
-
|
110
|
+
table_elements
|
127
111
|
|
128
|
-
|
129
|
-
# instantiates the AddEditMatrix Class.
|
130
|
-
def update
|
131
|
-
frm.button(:value=>"Update").click
|
132
|
-
AddEditMatrix.new(@browser)
|
133
|
-
end
|
112
|
+
end
|
134
113
|
|
114
|
+
#
|
115
|
+
class AddEditRow < RowColumnCommon
|
135
116
|
|
136
|
-
|
137
|
-
element(:background_color) { |b| b.frm.text_field(:id=>"color-id") }
|
138
|
-
element(:font_color) { |b| b.frm.text_field(:id=>"textColor-id") }
|
117
|
+
table_elements
|
139
118
|
|
140
119
|
end
|
141
120
|
|
@@ -145,25 +124,24 @@ class EditMatrixCells < BasePage
|
|
145
124
|
frame_element
|
146
125
|
|
147
126
|
# Clicks on the cell that is specified, based on
|
148
|
-
# the
|
149
|
-
|
150
|
-
# Note that the numbering begins in the upper left
|
151
|
-
# of the Matrix, with (1, 1) being the first EDITABLE
|
152
|
-
# cell, NOT the first cell in the table itself.
|
153
|
-
#
|
154
|
-
# In other words, ignore the header row and header column
|
155
|
-
# in your count (or, if you prefer, consider those
|
156
|
-
# to be numbered "0").
|
157
|
-
def edit(row, column)
|
158
|
-
frm.div(:class=>"portletBody").table(:summary=>"Matrix Scaffolding (click on a cell to edit)").tr(:index=>row).td(:index=>column-1).fire_event("onclick")
|
159
|
-
EditCell.new(@browser)
|
160
|
-
end
|
127
|
+
# the "id" found in the onclick tag for the cell.
|
128
|
+
action(:edit_cell_by_id) { |id, b| b.matrix_scaffolding.td(:html=>/#{id}/).fire_event("onclick") }
|
161
129
|
|
162
130
|
# Clicks the "Return to List" link and
|
163
131
|
# instantiates the Matrices Class.
|
164
|
-
|
165
|
-
|
166
|
-
|
132
|
+
action(:return_to_list) { |b| b.frm.link(:text=>"Return to List").click }
|
133
|
+
|
134
|
+
element(:matrix_scaffolding) { |b| b.frm.div(:class=>"portletBody").table(:summary=>"Matrix Scaffolding (click on a cell to edit)") }
|
135
|
+
|
136
|
+
element(:cells) { |b| b.frm.tds(:class=>/matrix-cell-border/).to_a }
|
137
|
+
|
138
|
+
element(:column_headers) { |b| b.matrix_scaffolding.tr(:index=>0).ths.to_a }
|
139
|
+
|
140
|
+
def edit_cell_by_row_and_column(row, column)
|
141
|
+
columns = []
|
142
|
+
column_headers.each { |col| columns << col.text }
|
143
|
+
columns.delete_at(0)
|
144
|
+
matrix_scaffolding.row(:text=>/#{Regexp.escape(row)}/).td(:index=>columns.index(column)).fire_event("onclick")
|
167
145
|
end
|
168
146
|
|
169
147
|
end
|
@@ -173,23 +151,17 @@ class EditCell < BasePage
|
|
173
151
|
|
174
152
|
frame_element
|
175
153
|
|
176
|
-
|
154
|
+
expected_element :select_evaluators_link
|
155
|
+
|
156
|
+
element(:select_evaluators_link) { |b| b.frm.link(:text=>"Select Evaluators") }
|
177
157
|
|
178
158
|
# Clicks the "Select Evaluators" link
|
179
159
|
# and instantiates the SelectEvaluators Class.
|
180
|
-
|
181
|
-
select_evaluators_link.wait_until_present
|
182
|
-
select_evaluators_link.click
|
183
|
-
SelectEvaluators.new(@browser)
|
184
|
-
end
|
160
|
+
action(:select_evaluators) { |p| p.select_evaluators_link.click }
|
185
161
|
|
186
162
|
# Clicks the Save Changes button and instantiates
|
187
163
|
# the EditMatrixCells Class.
|
188
|
-
|
189
|
-
frm.button(:value=>"Save Changes").click
|
190
|
-
EditMatrixCells.new(@browser)
|
191
|
-
end
|
192
|
-
|
164
|
+
action(:save_changes) { |b| b.frm.button(:value=>"Save Changes").click }
|
193
165
|
|
194
166
|
element(:title) { |b| b.frm.text_field(:id=>"title-id") }
|
195
167
|
element(:use_default_reflection_form) { |b| b.frm.checkbox(:id=>"defaultReflectionForm") }
|
@@ -209,12 +181,7 @@ class SelectEvaluators < BasePage
|
|
209
181
|
|
210
182
|
# Clicks the "Save" button and
|
211
183
|
# instantiates the EditCell Class.
|
212
|
-
|
213
|
-
frm.button(:value=>"Save").click
|
214
|
-
EditCell.new(@browser)
|
215
|
-
end
|
216
|
-
|
217
|
-
|
184
|
+
action(:save) { |b| b.frm.button(:value=>"Save").click }
|
218
185
|
element(:users) { |b| b.frm.select(:id=>"mainForm:availableUsers") }
|
219
186
|
element(:selected_users) { |b| b.frm.select(:id=>"mainForm:selectedUsers") }
|
220
187
|
element(:roles) { |b| b.frm.select(:id=>"mainForm:audSubV11:availableRoles") }
|
@@ -233,9 +200,6 @@ class ConfirmPublishMatrix < BasePage
|
|
233
200
|
|
234
201
|
# Clicks the "Continue" button and
|
235
202
|
# instantiates the Matrices Class.
|
236
|
-
|
237
|
-
frm.button(:value=>"Continue").click
|
238
|
-
Matrices.new(@browser)
|
239
|
-
end
|
203
|
+
action(:continue) { |b| b.frm.button(:value=>"Continue").click }
|
240
204
|
|
241
205
|
end
|
@@ -300,7 +300,7 @@ end
|
|
300
300
|
|
301
301
|
class CreateFolders < ResourcesBase
|
302
302
|
|
303
|
-
|
303
|
+
element(:folder_name) { |b| b.frm.text_field(:id=>"content_0") }
|
304
304
|
action(:create_folders_now) { |b| b.frm.button(:value=>"Create Folders Now").click }
|
305
305
|
|
306
306
|
end
|
@@ -310,7 +310,7 @@ class EditHTMLPageContent < BasePage
|
|
310
310
|
frame_element
|
311
311
|
include FCKEditor
|
312
312
|
|
313
|
-
|
313
|
+
element(:editor) { |b| b.frm.frame(:id=>"content___Frame") }
|
314
314
|
action(:continue) { |b| b.frm.button(id: "saveChanges").click }
|
315
315
|
element(:email_notification) { |b| b.frm.select(:id=>"notify") }
|
316
316
|
|
@@ -318,8 +318,8 @@ end
|
|
318
318
|
|
319
319
|
class EditHTMLPageProperties < ResourcesBase
|
320
320
|
|
321
|
-
|
322
|
-
|
321
|
+
element(:name) { |b| b.frm.text_field(id: "displayName_0") }
|
322
|
+
element(:description) { |b| b.frm.text_field(id: "description_0") }
|
323
323
|
|
324
324
|
action(:finish) { |b| b.frm.button(id: "finish_button").click }
|
325
325
|
|
@@ -349,23 +349,23 @@ class ReUseMaterial < SiteSetupBase
|
|
349
349
|
|
350
350
|
menu_elements
|
351
351
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
352
|
+
element(:announcements_checkbox) { |b| b.frm.checkbox(name: "sakai.announcements") }
|
353
|
+
element(:calendar_checkbox) { |b| b.frm.checkbox(name: "sakai.schedule") }
|
354
|
+
element(:discussion_forums_checkbox) { |b| b.frm.checkbox(name: "sakai.jforum.tool") }
|
355
|
+
element(:forums_checkbox) { |b| b.frm.checkbox(name: "sakai.forums") }
|
356
|
+
element(:chat_room_checkbox) { |b| b.frm.checkbox(name: "sakai.chat") }
|
357
|
+
element(:polls_checkbox) { |b| b.frm.checkbox(name: "sakai.poll") }
|
358
|
+
element(:syllabus_checkbox) { |b| b.frm.checkbox(name: "sakai.syllabus") }
|
359
|
+
element(:lessons_checkbox) { |b| b.frm.checkbox(name: "sakai.melete") }
|
360
|
+
element(:resources_checkbox) { |b| b.frm.checkbox(name: "sakai.resources") }
|
361
|
+
element(:assignments_checkbox) { |b| b.frm.checkbox(name: "sakai.assignment.grades") }
|
362
|
+
element(:tests_and_quizzes_checkbox) { |b| b.frm.checkbox(name: "sakai.samigo") }
|
363
|
+
element(:gradebook_checkbox) { |b| b.frm.checkbox(name: "sakai.gradebook.tool") }
|
364
|
+
element(:gradebook2_checkbox) { |b| b.frm.checkbox(name: "sakai.gradebook.gwt.rpc") }
|
365
|
+
element(:wiki_checkbox) { |b| b.frm.checkbox(name: "sakai.rwiki") }
|
366
|
+
element(:news_checkbox) { |b| b.frm.checkbox(name: "sakai.news") }
|
367
|
+
element(:web_content_checkbox) { |b| b.frm.checkbox(name: "sakai.iframe") }
|
368
|
+
element(:site_statistics_checkbox) { |b| b.frm.checkbox(name: "sakai.sitestats") }
|
369
369
|
action(:continue) { |b| b.frm.button(name: "eventSubmit_doContinue").click }
|
370
370
|
|
371
371
|
end
|
@@ -525,11 +525,13 @@ end
|
|
525
525
|
class ConfirmSiteSetup < BasePage
|
526
526
|
|
527
527
|
frame_element
|
528
|
-
|
528
|
+
|
529
|
+
element(:request_button) { |b| b.frm.button(:value=>"Request Site") }
|
530
|
+
|
529
531
|
# Clicks the Request Site button, then
|
530
532
|
# instantiates the SiteSetup Class.
|
531
|
-
action(:request_site){ |
|
532
|
-
|
533
|
+
action(:request_site){ |p| p.request_button.click }
|
534
|
+
|
533
535
|
# For portfolio sites...
|
534
536
|
# Clicks the "Create Site" button and
|
535
537
|
# instantiates the SiteSetup class.
|
@@ -569,17 +571,22 @@ end
|
|
569
571
|
#
|
570
572
|
class PortfolioSiteInfo < BasePage
|
571
573
|
|
574
|
+
include FCKEditor
|
572
575
|
frame_element
|
573
576
|
|
577
|
+
expected_element :editor
|
578
|
+
|
579
|
+
element(:editor) { |b| b.frm.frame(:id, "description___Frame") }
|
580
|
+
|
574
581
|
def description=(text)
|
575
|
-
|
582
|
+
editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
|
576
583
|
end
|
577
584
|
|
578
585
|
action(:continue) { |b| b.frm.button(:value=>"Continue").click }
|
579
586
|
|
580
587
|
element(:title) { |b| b.frm.text_field(:id=>"title") }
|
581
588
|
element(:url_alias) { |b| b.frm.text_field(:id=>"alias_0") }
|
582
|
-
element(:short_description) { |b| b.frm.
|
589
|
+
element(:short_description) { |b| b.frm.text_field(:id=>"short_description") }
|
583
590
|
element(:icon_url) { |b| b.frm.text_field(:id=>"iconUrl") }
|
584
591
|
element(:site_contact_name) { |b| b.frm.text_field(:id=>"siteContactName") }
|
585
592
|
element(:site_contact_email) { |b| b.frm.text_field(:id=>"siteContactEmail") }
|
@@ -594,7 +601,8 @@ class PortfolioSiteTools < BasePage
|
|
594
601
|
action(:continue) { |b| b.frm.button(:value=>"Continue").click }
|
595
602
|
|
596
603
|
element(:all_tools) { |b| b.frm.checkbox(:id=>"all") }
|
597
|
-
|
604
|
+
#TODO Add support for individual tool selection
|
605
|
+
|
598
606
|
end
|
599
607
|
|
600
608
|
#
|
@@ -10,11 +10,7 @@ class Sites < BasePage
|
|
10
10
|
# Clicks the first site Id link
|
11
11
|
# listed. Useful when you've run a search and
|
12
12
|
# you're certain you've got the result you want.
|
13
|
-
|
14
|
-
def click_top_item
|
15
|
-
frm.link(:href, /#{Regexp.escape("&panel=Main&sakai_action=doEdit")}/).click
|
16
|
-
EditSiteInfo.new(@browser)
|
17
|
-
end
|
13
|
+
action(:click_top_item) { |b| b.frm.link(:href, /#{Regexp.escape("&panel=Main&sakai_action=doEdit")}/).click }
|
18
14
|
|
19
15
|
# Clicks the specified Site in the list, using the
|
20
16
|
# specified id value to determine which item to click.
|
@@ -24,15 +20,9 @@ class Sites < BasePage
|
|
24
20
|
frm.text_field(:id=>"search_site").value=id
|
25
21
|
frm.link(:text=>"Site ID").click
|
26
22
|
frm.link(:text, id).click
|
27
|
-
EditSiteInfo.new(@browser)
|
28
23
|
end
|
29
24
|
|
30
|
-
|
31
|
-
# the EditSiteInfo page class.
|
32
|
-
def new_site
|
33
|
-
frm.link(:text, "New Site").click
|
34
|
-
EditSiteInfo.new(@browser)
|
35
|
-
end
|
25
|
+
action(:new_site) { |b| b.frm.link(:text, "New Site").click }
|
36
26
|
|
37
27
|
element(:search_field) { |b| b.frm.text_field(:id=>"search") }
|
38
28
|
action(:search_button) { |b| b.frm.link(text=>"Search").click }
|