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
data/lib/sambal-cle/utilities.rb
CHANGED
@@ -16,10 +16,4 @@ module Utilities
|
|
16
16
|
return $~.to_s
|
17
17
|
end
|
18
18
|
|
19
|
-
# TODO: Pull this out because it's a dupe. Fix anything that's broken because this is commented out...
|
20
|
-
# Shorthand method for making a data object for testing.
|
21
|
-
#def make data_object_class, opts={}
|
22
|
-
# data_object_class.new @browser, opts
|
23
|
-
#end
|
24
|
-
|
25
19
|
end
|
data/lib/sambal-cle/workflows.rb
CHANGED
@@ -1,124 +1,123 @@
|
|
1
1
|
# Workflows is a module containing helper navigation methods
|
2
2
|
module Workflows
|
3
3
|
|
4
|
-
def self.menu_link name, opts={}
|
4
|
+
def self.menu_link name, title, opts={}
|
5
5
|
define_method name.to_s do
|
6
|
-
|
6
|
+
@browser.link(opts).click unless @browser.title=~/#{title}/
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
# Opens "My Sites" and then clicks on the matching
|
11
|
-
# Site name
|
11
|
+
# Site name--unless the specified site is what you're already in.
|
12
|
+
# Shortens the name used for search so
|
12
13
|
# that truncated names are not a problem.
|
13
|
-
# Should be followed by the Home class.
|
14
|
-
#
|
15
|
-
# Will error out if there are not matching links.
|
16
14
|
def open_my_site_by_name(name)
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
unless @browser.title=~/#{name}/
|
16
|
+
@browser.link(:text, "My Sites").click
|
17
|
+
@browser.link(:text, /#{Regexp.escape(name[0..19])}/).click
|
18
|
+
end
|
20
19
|
end
|
21
20
|
|
22
21
|
# Clicks the "Account" link in the Adminstration Workspace
|
23
22
|
# Should be followed by the UserAccount class.
|
24
23
|
#
|
25
24
|
# Throws an error if the link is not present.
|
26
|
-
menu_link :account, :text=>"Account"
|
25
|
+
menu_link :account, "Account", :text=>"Account"
|
27
26
|
|
28
27
|
# Clicks the "Aliases" link in the Administration Workspace
|
29
28
|
# menu, then should be followed by the Aliases class.
|
30
|
-
menu_link :aliases, :text=>"Aliases"
|
29
|
+
menu_link :aliases, "Aliases", :text=>"Aliases"
|
31
30
|
|
32
31
|
# Clicks the link for the Administration Workspace, then
|
33
32
|
# should be followed by the MyWorkspace class.
|
34
|
-
menu_link :administration_workspace, :text=>"Administration Workspace"
|
33
|
+
menu_link :administration_workspace, "Administration Workspace", :text=>"Administration Workspace"
|
35
34
|
|
36
35
|
# Clicks the Announcements link goes to
|
37
36
|
# the Announcements class.
|
38
|
-
menu_link :announcements, :class=>'icon-sakai-announcements'
|
37
|
+
menu_link :announcements, "Announcements", :class=>'icon-sakai-announcements'
|
39
38
|
|
40
39
|
# Clicks the Assignments link, goes to
|
41
40
|
# the AssignmentsList class.
|
42
|
-
menu_link :assignments, :class=>"icon-sakai-assignment-grades"
|
41
|
+
menu_link :assignments, "Assignments", :class=>"icon-sakai-assignment-grades"
|
43
42
|
|
44
43
|
# BasicLTI class
|
45
|
-
menu_link :basic_lti, :class=>"icon-sakai-basiclti"
|
44
|
+
menu_link :basic_lti, "Basic LTI", :class=>"icon-sakai-basiclti"
|
46
45
|
|
47
46
|
# Blogs class
|
48
|
-
menu_link :blogs, :class=>"icon-sakai-blogwow"
|
47
|
+
menu_link :blogs, "Blogs", :class=>"icon-sakai-blogwow"
|
49
48
|
|
50
49
|
# Clicks the Blogger link in the Site menu and
|
51
50
|
# instantiates the Blogger Class.
|
52
|
-
menu_link :blogger, :class=>"icon-blogger"
|
51
|
+
menu_link :blogger, "Blogger", :class=>"icon-blogger"
|
53
52
|
|
54
53
|
# Clicks the Calendar link, then instantiates
|
55
54
|
# the Calendar class.
|
56
|
-
menu_link :calendar, :text=>"Calendar"
|
55
|
+
menu_link :calendar, "Calendar", :text=>"Calendar"
|
57
56
|
|
58
|
-
menu_link :certification, :text=>"Certification"
|
57
|
+
menu_link :certification, "Certification", :text=>"Certification"
|
59
58
|
|
60
59
|
# ChatRoom class
|
61
|
-
menu_link :chat_room, :class=>"icon-sakai-chat"
|
60
|
+
menu_link :chat_room, "Chat Room", :class=>"icon-sakai-chat"
|
62
61
|
|
63
|
-
menu_link :configuration_viewer, :text=>"Configuration Viewer"
|
64
|
-
menu_link :customizer, :text=>"Customizer"
|
62
|
+
menu_link :configuration_viewer, "Configuration Viewer", :text=>"Configuration Viewer"
|
63
|
+
menu_link :customizer, "Customizer", :text=>"Customizer"
|
65
64
|
|
66
65
|
# JForum page class.
|
67
|
-
menu_link :discussion_forums, :class=>"icon-sakai-jforum-tool"
|
66
|
+
menu_link :discussion_forums, "Discussion Forums", :class=>"icon-sakai-jforum-tool"
|
68
67
|
|
69
68
|
# DropBox class
|
70
|
-
menu_link :drop_box, :class=>"icon-sakai-dropbox"
|
69
|
+
menu_link :drop_box, "Drop Box", :class=>"icon-sakai-dropbox"
|
71
70
|
|
72
|
-
menu_link :email, :text=>"Email"
|
71
|
+
menu_link :email, "Email", :text=>"Email"
|
73
72
|
|
74
73
|
# Email Archive class
|
75
|
-
menu_link :email_archive, :class=>"icon-sakai-mailbox"
|
74
|
+
menu_link :email_archive, "Email Archive", :class=>"icon-sakai-mailbox"
|
76
75
|
|
77
|
-
menu_link :email_template_administration, :text=>"Email Template Administration"
|
76
|
+
menu_link :email_template_administration, "Email Template Administration", :text=>"Email Template Administration"
|
78
77
|
|
79
78
|
# EvaluationSystem class
|
80
|
-
menu_link :evaluation_system, :class=>"icon-sakai-rsf-evaluation"
|
79
|
+
menu_link :evaluation_system, "Evaluation System", :class=>"icon-sakai-rsf-evaluation"
|
81
80
|
|
82
81
|
# Feedback class
|
83
|
-
menu_link :feedback, :class=>"icon-sakai-postem"
|
82
|
+
menu_link :feedback, "Feedback", :class=>"icon-sakai-postem"
|
84
83
|
|
85
84
|
# Forms class
|
86
|
-
menu_link :forms, :text=>"Forms", :class=>"icon-sakai-metaobj"
|
85
|
+
menu_link :forms, "Forms", :text=>"Forms", :class=>"icon-sakai-metaobj"
|
87
86
|
|
88
87
|
# Forums class.
|
89
|
-
menu_link :forums, :text=>"Forums"
|
88
|
+
menu_link :forums, "Forums", :text=>"Forums"
|
90
89
|
|
91
90
|
# Glossary Class.
|
92
|
-
menu_link :glossary, :text=>"Glossary"
|
91
|
+
menu_link :glossary, "Glossary", :text=>"Glossary"
|
93
92
|
|
94
93
|
# Gradebook Class.
|
95
|
-
menu_link :gradebook, :text=>"Gradebook"
|
94
|
+
menu_link :gradebook, "Gradebook", :text=>"Gradebook"
|
96
95
|
|
97
96
|
# Gradebook2 class
|
98
|
-
menu_link :gradebook2, :text=>"Gradebook2"
|
97
|
+
menu_link :gradebook2, "Gradebook2", :text=>"Gradebook2"
|
99
98
|
|
100
|
-
menu_link :help, :text=>"Help"
|
99
|
+
menu_link :help, "Help", :text=>"Help"
|
101
100
|
|
102
101
|
# Home class--unless the target page happens to be
|
103
102
|
# My Workspace, in which case the MyWorkspace
|
104
103
|
# page should be used.
|
105
|
-
menu_link :home, :text=>"Home"
|
104
|
+
menu_link :home, "Home", :text=>"Home"
|
106
105
|
|
107
106
|
# Job Scheduler class.
|
108
|
-
menu_link :job_scheduler, :text=>"Job Scheduler"
|
107
|
+
menu_link :job_scheduler, "Job Scheduler", :text=>"Job Scheduler"
|
109
108
|
|
110
109
|
# Lessons class
|
111
|
-
menu_link :lessons, :text=>"Lessons"
|
110
|
+
menu_link :lessons, "Lessons", :text=>"Lessons"
|
112
111
|
|
113
|
-
menu_link :lesson_builder, :text=>"Lesson Builder"
|
114
|
-
menu_link :link_tool, :text=>"Link Tool"
|
115
|
-
menu_link :live_virtual_classroom, :text=>"Live Virtual Classroom"
|
112
|
+
menu_link :lesson_builder, "Lesson Builder", :text=>"Lesson Builder"
|
113
|
+
menu_link :link_tool, "Link Tool", :text=>"Link Tool"
|
114
|
+
menu_link :live_virtual_classroom, "Live Virtual Classroom", :text=>"Live Virtual Classroom"
|
116
115
|
|
117
116
|
# Matrices Class
|
118
|
-
menu_link :matrices, :text=>"Matrices"
|
117
|
+
menu_link :matrices, "Matrices", :text=>"Matrices"
|
119
118
|
|
120
119
|
# MediaGallery class
|
121
|
-
menu_link :media_gallery, :class=>"icon-sakai-kaltura"
|
120
|
+
menu_link :media_gallery, "Media Gallery", :class=>"icon-sakai-kaltura"
|
122
121
|
|
123
122
|
menu_link :membership, :text=>"Membership"
|
124
123
|
menu_link :memory, :text=>"Memory"
|
@@ -128,92 +127,94 @@ module Workflows
|
|
128
127
|
menu_link :my_sites, :text=>"My Sites"
|
129
128
|
|
130
129
|
# MyWorkspace Class.
|
131
|
-
menu_link :my_workspace, :text=>"My Workspace"
|
130
|
+
menu_link :my_workspace, "My Workspace", :text=>"My Workspace"
|
132
131
|
|
133
132
|
# News
|
134
|
-
menu_link :news, :class=>"icon-sakai-news"
|
133
|
+
menu_link :news, "News", :class=>"icon-sakai-news"
|
135
134
|
|
136
|
-
menu_link :online, :text=>"On-Line"
|
137
|
-
menu_link :oauth_providers, :text=>"Oauth Providers"
|
138
|
-
menu_link :oauth_tokens, :text=>"Oauth Tokens"
|
135
|
+
menu_link :online, "On-Line", :text=>"On-Line"
|
136
|
+
menu_link :oauth_providers, "Oauth Providers", :text=>"Oauth Providers"
|
137
|
+
menu_link :oauth_tokens, "Oauth Tokens", :text=>"Oauth Tokens"
|
139
138
|
menu_link :openSyllabus, :text=>"OpenSyllabus"
|
140
139
|
|
141
140
|
# Podcasts
|
142
|
-
menu_link :podcasts, :class=>"icon-sakai-podcasts"
|
141
|
+
menu_link :podcasts, "Podcasts", :class=>"icon-sakai-podcasts"
|
143
142
|
|
144
143
|
# Polls class
|
145
|
-
menu_link :polls, :class=>"icon-sakai-poll"
|
144
|
+
menu_link :polls, "Polls", :class=>"icon-sakai-poll"
|
146
145
|
|
147
146
|
# Portfolios class
|
148
|
-
menu_link :portfolios, :class=>"icon-osp-presentation"
|
147
|
+
menu_link :portfolios, "Portfolios", :class=>"icon-osp-presentation"
|
149
148
|
|
150
149
|
# PortfolioTemplates
|
151
|
-
menu_link :portfolio_templates, :text=>"Portfolio Templates"
|
150
|
+
menu_link :portfolio_templates, "Portfolio Templates", :text=>"Portfolio Templates"
|
152
151
|
|
153
|
-
menu_link :preferences, :text=>"Preferences"
|
152
|
+
menu_link :preferences, "Preferences", :text=>"Preferences"
|
154
153
|
|
155
|
-
menu_link :profile, :text=>"Profile"
|
154
|
+
menu_link :profile, "Profile", :text=>"Profile"
|
156
155
|
|
157
156
|
# Profile2 class
|
158
|
-
menu_link :profile2, :class=>"icon-sakai-profile2"
|
157
|
+
menu_link :profile2, "Profile2", :class=>"icon-sakai-profile2"
|
159
158
|
|
160
|
-
menu_link :realms, :text=>"Realms"
|
159
|
+
menu_link :realms, "Realms", :text=>"Realms"
|
161
160
|
|
162
161
|
# Resources class.
|
163
|
-
menu_link :resources, :text=>"Resources"
|
162
|
+
menu_link :resources, "Resources", :text=>"Resources"
|
164
163
|
|
165
164
|
# Roster
|
166
|
-
menu_link :roster, :class=>"icon-sakai-site-roster"
|
165
|
+
menu_link :roster, "Roster", :class=>"icon-sakai-site-roster"
|
167
166
|
|
168
|
-
menu_link :rsmart_support, :text=>"rSmart Support"
|
167
|
+
menu_link :rsmart_support, "rSmart Support", :text=>"rSmart Support"
|
169
168
|
|
170
169
|
# Because "Search" is used in many pages,
|
171
170
|
# The Search button found in the Site Management
|
172
171
|
# Menu must be given the more explicit name
|
173
|
-
menu_link :site_management_search, :class=>"icon-sakai-search"
|
172
|
+
menu_link :site_management_search, "Search", :class=>"icon-sakai-search"
|
174
173
|
|
175
174
|
# Sections
|
176
|
-
menu_link :sections, :class=>"icon-sakai-sections"
|
175
|
+
menu_link :sections, "Sections", :class=>"icon-sakai-sections"
|
177
176
|
|
178
|
-
menu_link :site_archive, :text=>"Site Archive"
|
177
|
+
menu_link :site_archive, "Site Archive", :text=>"Site Archive"
|
179
178
|
|
180
179
|
# SiteEditor class.
|
181
|
-
menu_link :site_editor, :text=>"Site Editor"
|
180
|
+
menu_link :site_editor, "Site Editor", :text=>"Site Editor"
|
182
181
|
|
183
182
|
# SiteSetup class.
|
184
|
-
menu_link :site_setup, :text=>"Site Setup"
|
183
|
+
menu_link :site_setup, "Site Setup", :text=>"Site Setup"
|
185
184
|
|
186
|
-
menu_link :site_statistics, :text=>"Site Statistics"
|
185
|
+
menu_link :site_statistics, "Site Statistics", :text=>"Site Statistics"
|
187
186
|
|
188
187
|
# Sites class.
|
189
|
-
menu_link :sites, :class=>"icon-sakai-sites"
|
188
|
+
menu_link :sites, "Sites", :class=>"icon-sakai-sites"
|
190
189
|
|
191
|
-
menu_link :skin_manager, :text=>"Skin Manager"
|
192
|
-
menu_link :super_user, :text=>"Super User"
|
190
|
+
menu_link :skin_manager, "Skin Manager", :text=>"Skin Manager"
|
191
|
+
menu_link :super_user, "Super User", :text=>"Super User"
|
193
192
|
|
194
193
|
# Styles
|
195
|
-
menu_link :styles, :text=>"Styles"
|
194
|
+
menu_link :styles, "Styles", :text=>"Styles"
|
196
195
|
|
197
196
|
# Syllabus class.
|
198
|
-
menu_link :syllabus, :text=>"Syllabus"
|
197
|
+
menu_link :syllabus, "Syllabus", :text=>"Syllabus"
|
199
198
|
|
200
199
|
# AssessmentsList class OR the TakeAssessmentList for students
|
201
|
-
menu_link :assessments, :class=>"icon-sakai-samigo"
|
200
|
+
menu_link :assessments, "Tests & Quizzes", :class=>"icon-sakai-samigo"
|
202
201
|
alias :tests_and_quizzes :assessments
|
203
202
|
|
204
203
|
# UserMembership
|
205
|
-
menu_link :user_membership, :class=>"icon-sakai-usermembership"
|
204
|
+
menu_link :user_membership, "User Membership", :class=>"icon-sakai-usermembership"
|
206
205
|
|
207
206
|
# Users
|
208
|
-
menu_link :users, :class=>"icon-sakai-users"
|
207
|
+
menu_link :users, "Users", :class=>"icon-sakai-users"
|
209
208
|
|
210
209
|
# WebContent
|
211
|
-
menu_link :web_content, :class=>"icon-sakai-iframe"
|
210
|
+
menu_link :web_content, "Web Content", :class=>"icon-sakai-iframe"
|
212
211
|
|
213
212
|
# Wikis
|
214
|
-
menu_link :wiki, :class=>"icon-sakai-rwiki"
|
213
|
+
menu_link :wiki, "Wiki", :class=>"icon-sakai-rwiki"
|
215
214
|
|
216
215
|
# The Page Reset button, found on all Site pages
|
217
|
-
|
216
|
+
def reset
|
217
|
+
@browser.link(:href=>/tool-reset/).click
|
218
|
+
end
|
218
219
|
|
219
220
|
end
|
data/lib/sambal-cle.rb
CHANGED
@@ -7,9 +7,9 @@ Dir["#{File.dirname(__FILE__)}/sambal-cle/data_objects/*.rb"].each {|f| require
|
|
7
7
|
# Initialize this class at the start of your test cases to
|
8
8
|
# open the specified test browser at the specified Sakai welcome page URL.
|
9
9
|
#
|
10
|
-
# The initialization will
|
10
|
+
# The initialization will
|
11
11
|
# create the @browser variable used throughout the page classes
|
12
|
-
class
|
12
|
+
class SambalCLE
|
13
13
|
|
14
14
|
attr_reader :browser
|
15
15
|
|
data/sambal-cle.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'sambal-cle'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.5'
|
4
4
|
s.summary = %q{rSmart's test framework for testing Sakai-CLE}
|
5
5
|
s.description = %q{This gem is used for creating test scripts for the Sakai Collaborative Learning Environment.}
|
6
6
|
s.files = Dir.glob("**/**/**")
|
@@ -8,6 +8,6 @@ spec = Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["Abraham Heward", "Jon Utter"]
|
9
9
|
s.email = %w{"aheward@rsmart.com" "jutter@rsmart.com"}
|
10
10
|
s.homepage = 'https://github.com/rSmart'
|
11
|
-
s.add_dependency 'test-factory', '>= 0.0.
|
11
|
+
s.add_dependency 'test-factory', '>= 0.0.7'
|
12
12
|
s.required_ruby_version = '>= 1.9.2'
|
13
13
|
end
|
@@ -15,7 +15,7 @@ describe "Assignment Due Date on Calendar" do
|
|
15
15
|
# Get the test configuration data
|
16
16
|
@config = YAML.load_file("config.yml")
|
17
17
|
@directory = YAML.load_file("directory.yml")
|
18
|
-
@sakai =
|
18
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
19
19
|
@browser = @sakai.browser
|
20
20
|
|
21
21
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -28,10 +28,10 @@ describe "Assignment Due Date on Calendar" do
|
|
28
28
|
:type=>"Instructor"
|
29
29
|
@instructor1.log_in
|
30
30
|
|
31
|
-
@site = make
|
31
|
+
@site = make CourseSiteObject
|
32
32
|
@site.create
|
33
|
-
@site.add_official_participants
|
34
|
-
@site.add_official_participants
|
33
|
+
@site.add_official_participants @student.type, @student.id
|
34
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
35
35
|
|
36
36
|
@assignment1 = make AssignmentObject, :site=>@site.name, :title=>random_string, :grade_scale=>"Letter grade", :instructions=>random_multiline(500, 10, :string), :open=>minutes_ago(5)
|
37
37
|
@assignment2 = make AssignmentObject, :allow_resubmission=>:set, :add_due_date=>:set, :site=>@site.name, :title=>random_nicelink(15), :open=>hours_ago(5), :student_submissions=>"Inline only", :grade_scale=>"Letter grade", :instructions=>random_multiline(750, 13, :string)
|
@@ -14,7 +14,7 @@ describe "Assessments" do
|
|
14
14
|
# Get the test configuration data
|
15
15
|
@config = YAML.load_file("config.yml")
|
16
16
|
@directory = YAML.load_file("directory.yml")
|
17
|
-
@sakai =
|
17
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
18
18
|
@browser = @sakai.browser
|
19
19
|
|
20
20
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'sambal-cle'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
describe "Assessment Feedback" do
|
6
|
+
|
7
|
+
include Workflows
|
8
|
+
include Foundry
|
9
|
+
include StringFactory
|
10
|
+
include DateFactory
|
11
|
+
|
12
|
+
before :all do
|
13
|
+
# Get the test configuration data
|
14
|
+
@config = YAML.load_file("config.yml")
|
15
|
+
@directory = YAML.load_file("directory.yml")
|
16
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
17
|
+
@browser = @sakai.browser
|
18
|
+
|
19
|
+
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
20
|
+
:first_name=>@directory['person1']['firstname'], :last_name=>@directory['person1']['lastname']
|
21
|
+
@instructor = make UserObject, :id=>@directory['person3']['id'], :password=>@directory['person3']['password'],
|
22
|
+
:first_name=>@directory['person3']['firstname'], :last_name=>@directory['person3']['lastname'],
|
23
|
+
:type=>"Instructor"
|
24
|
+
@instructor.log_in
|
25
|
+
|
26
|
+
@site = make CourseSiteObject
|
27
|
+
@site.create
|
28
|
+
@site.add_official_participants @student.type, @student.id
|
29
|
+
|
30
|
+
@assessment = make AssessmentObject, :site=>@site.name,
|
31
|
+
:feedback_delivery=>:immediate_feedback,
|
32
|
+
:feedback_authoring=>:both_feedback_levels,
|
33
|
+
:release_options=>[:release_question_level_feedback, :release_selection_level_feedback]
|
34
|
+
@assessment.create
|
35
|
+
|
36
|
+
@assessment.add_question :type=>"Multiple Choice",
|
37
|
+
:answers_feedback=>[random_alphanums, random_alphanums, random_alphanums, random_alphanums],
|
38
|
+
:correct_answer_feedback=>random_alphanums,
|
39
|
+
:incorrect_answer_feedback=>random_alphanums
|
40
|
+
@assessment.add_question :type=>"Survey",
|
41
|
+
:feedback=>random_alphanums
|
42
|
+
@assessment.add_question :type=>"Short Answer/Essay",
|
43
|
+
:feedback=>random_alphanums
|
44
|
+
@assessment.add_question :type=>"Fill in the Blank",
|
45
|
+
:correct_answer_feedback=>random_alphanums,
|
46
|
+
:incorrect_answer_feedback=>random_alphanums
|
47
|
+
@assessment.add_question :type=>"Numeric Response",
|
48
|
+
:correct_answer_feedback=>random_alphanums,
|
49
|
+
:incorrect_answer_feedback=>random_alphanums
|
50
|
+
@assessment.add_question :type=>"Matching",
|
51
|
+
:correct_answer_feedback=>random_alphanums,
|
52
|
+
:incorrect_answer_feedback=>random_alphanums
|
53
|
+
@assessment.add_question :type=>"True False",
|
54
|
+
:correct_answer_feedback=>random_alphanums,
|
55
|
+
:incorrect_answer_feedback=>random_alphanums
|
56
|
+
@assessment.add_question :type=>"Audio Recording",
|
57
|
+
:feedback=>random_alphanums
|
58
|
+
@assessment.add_question :type=>"File Upload",
|
59
|
+
:feedback=>random_alphanums
|
60
|
+
@assessment.add_question :type=>"Calculated Question",
|
61
|
+
:correct_answer_feedback=>random_alphanums,
|
62
|
+
:incorrect_answer_feedback=>random_alphanums
|
63
|
+
|
64
|
+
@assessment.publish
|
65
|
+
|
66
|
+
@instructor.log_out
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
after :all do
|
71
|
+
@browser.close
|
72
|
+
end
|
73
|
+
|
74
|
+
xit "feedback" do
|
75
|
+
# Test cases pending underlying submission code.
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'sambal-cle'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
describe "Publishing Assessments" do
|
6
|
+
|
7
|
+
include Workflows
|
8
|
+
include Foundry
|
9
|
+
include DateFactory
|
10
|
+
|
11
|
+
before :all do
|
12
|
+
# Get the test configuration data
|
13
|
+
@config = YAML.load_file("config.yml")
|
14
|
+
@directory = YAML.load_file("directory.yml")
|
15
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
16
|
+
@browser = @sakai.browser
|
17
|
+
|
18
|
+
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
19
|
+
:first_name=>@directory['person1']['firstname'], :last_name=>@directory['person1']['lastname']
|
20
|
+
@instructor1 = make UserObject, :id=>@directory['person3']['id'], :password=>@directory['person3']['password'],
|
21
|
+
:first_name=>@directory['person3']['firstname'], :last_name=>@directory['person3']['lastname'],
|
22
|
+
:type=>"Instructor"
|
23
|
+
@instructor2 = make UserObject, :id=>@directory['person4']['id'], :password=>@directory['person4']['password'],
|
24
|
+
:first_name=>@directory['person4']['firstname'], :last_name=>@directory['person4']['lastname'],
|
25
|
+
:type=>"Instructor"
|
26
|
+
@instructor1.log_in
|
27
|
+
|
28
|
+
@site = make CourseSiteObject
|
29
|
+
@site.create
|
30
|
+
@site.add_official_participants @student.type, @student.id
|
31
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
32
|
+
|
33
|
+
@assessment1 = make AssessmentObject, :site=>@site.name
|
34
|
+
@assessment1.create
|
35
|
+
|
36
|
+
1.times{ @assessment1.add_part }
|
37
|
+
3.times{ @assessment1.add_question }
|
38
|
+
|
39
|
+
@assessment2 = make AssessmentObject, :site=>@site.name
|
40
|
+
@assessment2.create
|
41
|
+
|
42
|
+
1.times{ @assessment2.add_part }
|
43
|
+
3.times{ @assessment2.add_question }
|
44
|
+
|
45
|
+
@assessment2.publish
|
46
|
+
|
47
|
+
@assessment3 = make AssessmentObject, :site=>@site.name, :available_date=>in_an_hour
|
48
|
+
@assessment3.create
|
49
|
+
|
50
|
+
1.times{ @assessment3.add_part }
|
51
|
+
3.times{ @assessment3.add_question }
|
52
|
+
|
53
|
+
@assessment3.publish
|
54
|
+
|
55
|
+
@instructor1.log_out
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
after :all do
|
60
|
+
@browser.close
|
61
|
+
end
|
62
|
+
|
63
|
+
it "Instructors can see pending, published, and inactive assessments made by others" do
|
64
|
+
@instructor2.log_in
|
65
|
+
open_my_site_by_name @site.name
|
66
|
+
tests_and_quizzes
|
67
|
+
on AssessmentsList do |list|
|
68
|
+
list.pending_assessment_titles.should include @assessment1.title
|
69
|
+
list.published_assessment_titles.should include @assessment2.title
|
70
|
+
list.inactive_assessment_titles.should include @assessment3.title
|
71
|
+
end
|
72
|
+
@instructor2.log_out
|
73
|
+
end
|
74
|
+
|
75
|
+
it "Students can see published assessments that are currently available" do
|
76
|
+
@student.log_in
|
77
|
+
open_my_site_by_name @site.name
|
78
|
+
tests_and_quizzes
|
79
|
+
on StudentAssessmentsList do |list|
|
80
|
+
list.available_assessments.should include @assessment2.title
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
it "Students cannot see published assessments prior to the available date" do
|
85
|
+
@student.log_in
|
86
|
+
open_my_site_by_name @site.name
|
87
|
+
tests_and_quizzes
|
88
|
+
on StudentAssessmentsList do |list|
|
89
|
+
list.available_assessments.should_not include @assessment3.title
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
it "Students cannot see unpublished assessments" do
|
94
|
+
@student.log_in
|
95
|
+
open_my_site_by_name @site.name
|
96
|
+
tests_and_quizzes
|
97
|
+
on StudentAssessmentsList do |list|
|
98
|
+
list.available_assessments.should_not include @assessment1.title
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
@@ -15,7 +15,7 @@ describe "Assignments appearing in Announcements" do
|
|
15
15
|
# Get the test configuration data
|
16
16
|
@config = YAML.load_file("config.yml")
|
17
17
|
@directory = YAML.load_file("directory.yml")
|
18
|
-
@sakai =
|
18
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
19
19
|
@browser = @sakai.browser
|
20
20
|
|
21
21
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -28,10 +28,10 @@ describe "Assignments appearing in Announcements" do
|
|
28
28
|
:type=>"Instructor"
|
29
29
|
@instructor1.log_in
|
30
30
|
|
31
|
-
@site = make
|
31
|
+
@site = make CourseSiteObject
|
32
32
|
@site.create
|
33
|
-
@site.add_official_participants
|
34
|
-
@site.add_official_participants
|
33
|
+
@site.add_official_participants @student.type, @student.id
|
34
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
35
35
|
|
36
36
|
@assignment1 = make AssignmentObject, :status=>"Draft", :add_open_announcement=>:set, :site=>@site.name, :title=>random_xss_string(30), :open=>in_an_hour, :student_submissions=>"Attachments only", :grade_scale=>"Points", :max_points=>"100", :instructions=>random_multiline(600, 12, :string)
|
37
37
|
@assignment2 = make AssignmentObject, :site=>@site.name, :add_open_announcement=>:set, :open=>an_hour_ago
|
@@ -15,7 +15,7 @@ describe "Duplicating an Assignment" do
|
|
15
15
|
# Get the test configuration data
|
16
16
|
@config = YAML.load_file("config.yml")
|
17
17
|
@directory = YAML.load_file("directory.yml")
|
18
|
-
@sakai =
|
18
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
19
19
|
@browser = @sakai.browser
|
20
20
|
|
21
21
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -28,10 +28,10 @@ describe "Duplicating an Assignment" do
|
|
28
28
|
:type=>"Instructor"
|
29
29
|
@instructor1.log_in
|
30
30
|
|
31
|
-
@site = make
|
31
|
+
@site = make CourseSiteObject
|
32
32
|
@site.create
|
33
|
-
@site.add_official_participants
|
34
|
-
@site.add_official_participants
|
33
|
+
@site.add_official_participants @student.type, @student.id
|
34
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
35
35
|
|
36
36
|
@assignment = make AssignmentObject, :site=>@site.name, :title=>random_string(25), :open=>next_monday, :grade_scale=>"Pass", :instructions=>random_alphanums
|
37
37
|
|
@@ -15,7 +15,7 @@ describe "Assignments" do
|
|
15
15
|
# Get the test configuration data
|
16
16
|
@config = YAML.load_file("config.yml")
|
17
17
|
@directory = YAML.load_file("directory.yml")
|
18
|
-
@sakai =
|
18
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
19
19
|
@browser = @sakai.browser
|
20
20
|
|
21
21
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -28,10 +28,10 @@ describe "Assignments" do
|
|
28
28
|
:type=>"Instructor"
|
29
29
|
@instructor1.log_in
|
30
30
|
|
31
|
-
@site = make
|
31
|
+
@site = make CourseSiteObject
|
32
32
|
@site.create
|
33
|
-
@site.add_official_participants
|
34
|
-
@site.add_official_participants
|
33
|
+
@site.add_official_participants @student.type, @student.id
|
34
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
35
35
|
|
36
36
|
@assignment = make AssignmentObject, :site=>@site.name, :title=>random_string(25), :open=>next_monday, :grade_scale=>"Pass", :instructions=>random_multiline(300, 15, :string)
|
37
37
|
|
@@ -17,7 +17,7 @@ describe "Assignment Permissions" do
|
|
17
17
|
# Get the test configuration data
|
18
18
|
@config = YAML.load_file("config.yml")
|
19
19
|
@directory = YAML.load_file("directory.yml")
|
20
|
-
@sakai =
|
20
|
+
@sakai = SambalCLE.new(@config['browser'], @config['url'])
|
21
21
|
@browser = @sakai.browser
|
22
22
|
|
23
23
|
@student = make UserObject, :id=>@directory['person1']['id'], :password=>@directory['person1']['password'],
|
@@ -30,12 +30,12 @@ describe "Assignment Permissions" do
|
|
30
30
|
:type=>"Instructor"
|
31
31
|
@instructor1.log_in
|
32
32
|
|
33
|
-
@site = make
|
33
|
+
@site = make CourseSiteObject
|
34
34
|
@site.create
|
35
|
-
@site.add_official_participants
|
36
|
-
@site.add_official_participants
|
35
|
+
@site.add_official_participants @student.type, @student.id
|
36
|
+
@site.add_official_participants @instructor2.type, @instructor2.id
|
37
37
|
|
38
|
-
@site = make
|
38
|
+
@site = make CourseSiteObject
|
39
39
|
@site.create
|
40
40
|
|
41
41
|
@site.add_official_participants :role=>"Student", :participants=>[@student]
|