sambal-cle 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +18 -22
- data/lib/sambal-cle/data_objects/questions.rb +9 -2
- data/lib/sambal-cle/page_objects/assessments.rb +5 -0
- data/sambal-cle.gemspec +1 -1
- data/test/duplicate_site_spec.rb +17 -0
- metadata +2 -2
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,32 +1,29 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.2
|
5
|
-
childprocess (0.3.
|
6
|
-
ffi (~> 1.0.6)
|
4
|
+
addressable (2.3.2)
|
5
|
+
childprocess (0.3.6)
|
6
|
+
ffi (~> 1.0, >= 1.0.6)
|
7
7
|
diff-lcs (1.1.3)
|
8
|
-
ffi (1.
|
9
|
-
libwebsocket (0.1.
|
8
|
+
ffi (1.1.5)
|
9
|
+
libwebsocket (0.1.5)
|
10
10
|
addressable
|
11
|
-
multi_json (1.
|
12
|
-
rspec (2.
|
13
|
-
rspec-core (~> 2.
|
14
|
-
rspec-expectations (~> 2.
|
15
|
-
rspec-mocks (~> 2.
|
16
|
-
rspec-core (2.
|
17
|
-
rspec-expectations (2.
|
11
|
+
multi_json (1.3.7)
|
12
|
+
rspec (2.11.0)
|
13
|
+
rspec-core (~> 2.11.0)
|
14
|
+
rspec-expectations (~> 2.11.0)
|
15
|
+
rspec-mocks (~> 2.11.0)
|
16
|
+
rspec-core (2.11.1)
|
17
|
+
rspec-expectations (2.11.3)
|
18
18
|
diff-lcs (~> 1.1.3)
|
19
|
-
rspec-mocks (2.
|
20
|
-
rubyzip (0.9.
|
21
|
-
|
22
|
-
selenium-webdriver (>= 2.21.2)
|
23
|
-
watir-webdriver (>= 0.5.5)
|
24
|
-
selenium-webdriver (2.25.0)
|
19
|
+
rspec-mocks (2.11.3)
|
20
|
+
rubyzip (0.9.9)
|
21
|
+
selenium-webdriver (2.26.0)
|
25
22
|
childprocess (>= 0.2.5)
|
26
23
|
libwebsocket (~> 0.1.3)
|
27
24
|
multi_json (~> 1.0)
|
28
25
|
rubyzip
|
29
|
-
test-factory (0.0.
|
26
|
+
test-factory (0.0.7)
|
30
27
|
watir-webdriver (>= 0.6.1)
|
31
28
|
watir-webdriver (0.6.1)
|
32
29
|
selenium-webdriver (>= 2.18.0)
|
@@ -36,6 +33,5 @@ PLATFORMS
|
|
36
33
|
|
37
34
|
DEPENDENCIES
|
38
35
|
rspec
|
39
|
-
|
40
|
-
|
41
|
-
watir-webdriver (>= 0.6.0)
|
36
|
+
test-factory (>= 0.0.7)
|
37
|
+
watir-webdriver (>= 0.6.1)
|
@@ -151,7 +151,8 @@ class ShortAnswerQuestion
|
|
151
151
|
include Workflows
|
152
152
|
include StringFactory
|
153
153
|
|
154
|
-
attr_accessor :assessment, :part, :text, :point_value, :model_answer, :feedback,
|
154
|
+
attr_accessor :assessment, :part, :text, :point_value, :model_answer, :feedback,
|
155
|
+
:pool, :rich_text
|
155
156
|
|
156
157
|
def initialize(browser, opts={})
|
157
158
|
@browser = browser
|
@@ -160,6 +161,7 @@ class ShortAnswerQuestion
|
|
160
161
|
:text=>random_alphanums,
|
161
162
|
:point_value=>(rand(100)+1).to_s,
|
162
163
|
:model_answer=>random_alphanums,
|
164
|
+
:rich_text=>false
|
163
165
|
}
|
164
166
|
options = defaults.merge(opts)
|
165
167
|
|
@@ -175,7 +177,12 @@ class ShortAnswerQuestion
|
|
175
177
|
edit.question_type "Short Answer/Essay"
|
176
178
|
end
|
177
179
|
on ShortAnswer do |add|
|
178
|
-
|
180
|
+
if @rich_text
|
181
|
+
add.toggle_question_editor
|
182
|
+
add.enter_source_text(add.question_editor, @text)
|
183
|
+
else
|
184
|
+
add.question_text.set @text
|
185
|
+
end
|
179
186
|
add.answer_point_value.set @point_value
|
180
187
|
add.model_short_answer.set @model_answer
|
181
188
|
add.feedback.fit @feedback
|
@@ -510,12 +510,17 @@ end
|
|
510
510
|
# The page for setting up a Short Answer/Essay question
|
511
511
|
class ShortAnswer < AssessmentsBase
|
512
512
|
|
513
|
+
include FCKEditor
|
513
514
|
menu_bar_elements
|
514
515
|
question_page_elements
|
515
516
|
|
516
517
|
element(:model_short_answer) { |b| b.frm.text_field(:id=>"itemForm:_id129_textinput") }
|
517
518
|
element(:feedback) { |b| b.frm.text_field(:id=>"itemForm:_id133_textinput") }
|
518
519
|
|
520
|
+
action(:toggle_question_editor) { |b| b.frm.link(:id=>"itemForm:_id69_toggle").click; b.question_editor.wait_until_present }
|
521
|
+
|
522
|
+
element(:question_editor) { |b| b.frm.frame(:id, "itemForm:_id69_textinput___Frame") }
|
523
|
+
|
519
524
|
end
|
520
525
|
|
521
526
|
# The page for setting up a Fill-in-the-blank question
|
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.7'
|
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("**/**/**")
|
data/test/duplicate_site_spec.rb
CHANGED
@@ -131,6 +131,9 @@ describe "Duplicate Site" do
|
|
131
131
|
|
132
132
|
@section1.edit :editor_content=>@source_site_string
|
133
133
|
|
134
|
+
@assessment = make AssessmentObject :site=>@site.name
|
135
|
+
@assessment.add_question :type=>"Short Answer/Essay", :rich_text=>true, :text=>%|<img width="203" height="196" src="https://#{$base_url}/access/content/group/#{@site1.id}/#{@file.name}" alt="" />|
|
136
|
+
|
134
137
|
@site2 = @site1.duplicate
|
135
138
|
|
136
139
|
@new_assignment = make AssignmentObject, :site=>@site2.name, :status=>"Draft", :title=>@assignment.title
|
@@ -244,4 +247,18 @@ describe "Duplicate Site" do
|
|
244
247
|
check_this_stuff @new_event.message_html
|
245
248
|
end
|
246
249
|
|
250
|
+
it "duplicates Assessments correctly" do
|
251
|
+
@new_assessment = make AssessmentObject, :title=>@assessment.title, :site=>@site2.name
|
252
|
+
@new_assessment.questions=@assessment.questions
|
253
|
+
assessments
|
254
|
+
on AssessmentsList do |list|
|
255
|
+
list.pending_assessment_titles.should include @new_assessment.title
|
256
|
+
list.edit @new_assessment.title
|
257
|
+
end
|
258
|
+
on EditAssessment do |edit|
|
259
|
+
edit.edit_question(1,1)
|
260
|
+
sleep 120
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
247
264
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sambal-cle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: test-factory
|