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,98 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'sambal-cle'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
describe "Assignments" do
|
6
|
+
|
7
|
+
include Utilities
|
8
|
+
include Workflows
|
9
|
+
include PageHelper
|
10
|
+
include Randomizers
|
11
|
+
include DateMakers
|
12
|
+
|
13
|
+
before :all do
|
14
|
+
|
15
|
+
# Get the test configuration data
|
16
|
+
@config = YAML.load_file("config.yml")
|
17
|
+
@directory = YAML.load_file("directory.yml")
|
18
|
+
@sakai = SakaiCLE.new(@config['browser'], @config['url'])
|
19
|
+
@browser = @sakai.browser
|
20
|
+
|
21
|
+
@student = @directory['person1']['id']
|
22
|
+
@spassword = @directory['person1']['password']
|
23
|
+
@instructor1 = @directory['person3']['id']
|
24
|
+
@ipassword = @directory['person3']['password']
|
25
|
+
|
26
|
+
@instructor2 = @directory['person4']['id']
|
27
|
+
@password1 = @directory['person4']['password']
|
28
|
+
|
29
|
+
@sakai.page.login(@instructor1, @ipassword)
|
30
|
+
|
31
|
+
@site = make SiteObject
|
32
|
+
@site.create
|
33
|
+
|
34
|
+
@site.add_official_participants :role=>"Student", :participants=>[@student]
|
35
|
+
@site.add_official_participants :role=>"Instructor", :participants=>[@instructor2]
|
36
|
+
|
37
|
+
@assignment = make AssignmentObject, :site=>@site.name, :title=>random_string(25), :open=>next_monday, :grade_scale=>"Pass", :instructions=>random_multiline(300, 15, :string)
|
38
|
+
|
39
|
+
@assignment.create
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
after :all do
|
44
|
+
# Close the browser window
|
45
|
+
@sakai.browser.close
|
46
|
+
end
|
47
|
+
|
48
|
+
it "Assignments with 'Pass' grade scale cannot be added to the Gradebook" do
|
49
|
+
@assignment.edit :status=>"Editing", :add_to_gradebook=>:set
|
50
|
+
on AssignmentAdd do |edit|
|
51
|
+
sleep 0.1
|
52
|
+
edit.add_to_gradebook.should_not be_set
|
53
|
+
edit.gradebook_warning.should be_present
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "Assignments with 'Ungraded' grade scale cannot be added to the Gradebook" do
|
58
|
+
on AssignmentAdd do |edit|
|
59
|
+
edit.grade_scale.select "Ungraded"
|
60
|
+
edit.add_to_gradebook.set
|
61
|
+
sleep 0.1
|
62
|
+
edit.add_to_gradebook.should_not be_set
|
63
|
+
edit.gradebook_warning.should be_present
|
64
|
+
edit.gradebook_warning.wait_while_present
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
it "Assignments with 'Letter grade' grade scale cannot be added to the Gradebook" do
|
69
|
+
on AssignmentAdd do |edit|
|
70
|
+
edit.grade_scale.select "Letter grade"
|
71
|
+
edit.add_to_gradebook.set
|
72
|
+
sleep 0.1
|
73
|
+
edit.add_to_gradebook.should_not be_set
|
74
|
+
edit.gradebook_warning.should be_present
|
75
|
+
edit.gradebook_warning.wait_while_present
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it "Assignments with 'Checkmark' grade scale cannot be added to the Gradebook" do
|
80
|
+
on AssignmentAdd do |edit|
|
81
|
+
edit.grade_scale.select "Checkmark"
|
82
|
+
edit.add_to_gradebook.set
|
83
|
+
sleep 0.1
|
84
|
+
edit.add_to_gradebook.should_not be_set
|
85
|
+
edit.gradebook_warning.should be_present
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
it "Assignments graded by points can be added to the gradebook" do
|
90
|
+
reset
|
91
|
+
@assignment.edit :grade_scale=>"Points", :max_points=>"111", :add_to_gradebook=>:set
|
92
|
+
gradebook
|
93
|
+
on Gradebook do |book|
|
94
|
+
book.items_titles.should include @assignment.title
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# When real values are entered below, this file should be renamed to config.yml
|
2
|
+
browser: :firefox # Can be :chrome, :ie, :firefox, or :safari
|
3
|
+
url: # Should be the url for the login page, e.g.: http://www.rsmart.com
|
4
|
+
data_directory: # Use the full path to the directory containing your test data files. e.g.: /Users/clarkkent/data/
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# When real values are entered below, this file should be renamed to config.yml
|
2
|
+
# Note that if you're going to use the rSmart test cases, you should leave the Roles as set.
|
3
|
+
# Also make sure the ids are all lowercase.
|
4
|
+
# The site data will all get updated automatically, so that section can be left alone.
|
5
|
+
admin:
|
6
|
+
username:
|
7
|
+
password:
|
8
|
+
person1:
|
9
|
+
id:
|
10
|
+
firstname:
|
11
|
+
lastname:
|
12
|
+
email:
|
13
|
+
password:
|
14
|
+
role: Student
|
15
|
+
person2:
|
16
|
+
id:
|
17
|
+
firstname:
|
18
|
+
lastname:
|
19
|
+
email:
|
20
|
+
password:
|
21
|
+
role: Student
|
22
|
+
person3:
|
23
|
+
id:
|
24
|
+
firstname:
|
25
|
+
lastname:
|
26
|
+
email:
|
27
|
+
password:
|
28
|
+
role: Instructor
|
29
|
+
person4:
|
30
|
+
id:
|
31
|
+
firstname:
|
32
|
+
lastname:
|
33
|
+
email:
|
34
|
+
password:
|
35
|
+
role: Instructor
|
36
|
+
person5:
|
37
|
+
id:
|
38
|
+
firstname:
|
39
|
+
lastname:
|
40
|
+
email:
|
41
|
+
password:
|
42
|
+
role: Student
|
43
|
+
person6:
|
44
|
+
id:
|
45
|
+
firstname:
|
46
|
+
lastname:
|
47
|
+
email:
|
48
|
+
password:
|
49
|
+
role: Student
|
50
|
+
person7:
|
51
|
+
id:
|
52
|
+
firstname:
|
53
|
+
lastname:
|
54
|
+
email:
|
55
|
+
password:
|
56
|
+
role: Student
|
57
|
+
person8:
|
58
|
+
id:
|
59
|
+
firstname:
|
60
|
+
lastname:
|
61
|
+
email:
|
62
|
+
password:
|
63
|
+
role: Student
|
64
|
+
person9:
|
65
|
+
id:
|
66
|
+
firstname:
|
67
|
+
lastname:
|
68
|
+
email:
|
69
|
+
password:
|
70
|
+
role: Student
|
71
|
+
person10:
|
72
|
+
id:
|
73
|
+
firstname:
|
74
|
+
lastname:
|
75
|
+
email:
|
76
|
+
password:
|
77
|
+
role: Student
|
78
|
+
person11:
|
79
|
+
id:
|
80
|
+
firstname:
|
81
|
+
lastname:
|
82
|
+
email:
|
83
|
+
password:
|
84
|
+
role: Student
|
85
|
+
person12:
|
86
|
+
id:
|
87
|
+
firstname:
|
88
|
+
lastname:
|
89
|
+
email:
|
90
|
+
password:
|
91
|
+
role: Student
|
92
|
+
person13:
|
93
|
+
id:
|
94
|
+
firstname:
|
95
|
+
lastname:
|
96
|
+
email:
|
97
|
+
password:
|
98
|
+
type: registered
|
99
|
+
person14:
|
100
|
+
id:
|
101
|
+
firstname:
|
102
|
+
lastname:
|
103
|
+
email:
|
104
|
+
password:
|
105
|
+
type: guest
|
106
|
+
site1:
|
107
|
+
type: course
|
108
|
+
name: zoorVk-g *0JLW*6o lHX*8N-r 201120
|
109
|
+
id: b933c70c-f2c7-402f-8fa9-691ab39a654e
|
110
|
+
assignment1: "!m:]}TE,\\i"
|
111
|
+
assignment2: Cj2byg_1vnhmCct
|
112
|
+
assignment3: "\"><BODY ONLOAD=alert('XSS')>"
|
113
|
+
assignment4: X7>'nmN[QJW{z/KjYs=A"\L-"
|
114
|
+
assignment5: "'%#$US2vX;2WZ/$.WVE#W}cB;o4XdW"
|
115
|
+
quiz1: ucf]h8&BX*
|
116
|
+
quiz2: HG5Qexp8Pw
|
117
|
+
group0: I9/}l,}zO2L"Op/NlpEJZ&R1rj/$hkO|m@2BY1D-?Nn*KQXV4}xR&)NOn&H`wt+Se`KD/zCwE|GV+Uov5hzh - 201206201521
|
118
|
+
group1: u6zFW,M+{I)tY!dzray%I>1:y'R3F@7b4R}yL52k59(n*:,6O"smb9-1m=yh]xQ/JKRuJx@J\6N/"am@0:F. - 201206201521
|
119
|
+
section1: xG":Gr>Pw/
|
120
|
+
section2: "\"<A HREF=\"http://1113982867/\">XSS</A>"
|
121
|
+
site2:
|
122
|
+
type: portfolio
|
123
|
+
name: DhGuJf1AUK
|
@@ -0,0 +1,244 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'sambal-cle'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
describe "Duplicate Site" do
|
6
|
+
|
7
|
+
include Utilities
|
8
|
+
include Workflows
|
9
|
+
include PageHelper
|
10
|
+
|
11
|
+
before :all do
|
12
|
+
|
13
|
+
# Get the test configuration data
|
14
|
+
@config = YAML.load_file("config.yml")
|
15
|
+
@directory = YAML.load_file("directory.yml")
|
16
|
+
@sakai = SakaiCLE.new(@config['browser'], @config['url'])
|
17
|
+
@browser = @sakai.browser
|
18
|
+
# This test case uses the logins of several users
|
19
|
+
@file_path = @config['data_directory']
|
20
|
+
@source_site_string = "Links to various items in this site:"
|
21
|
+
|
22
|
+
# Log in to Sakai
|
23
|
+
@sakai.page.login(@instructor, @ipassword)
|
24
|
+
|
25
|
+
@site1 = make SiteObject, :description=>"Original Site"
|
26
|
+
@site1.create
|
27
|
+
|
28
|
+
@source_site_string << "<br />\n<br />\nSite ID: #{@site1.id}<br />\n<br />\n"
|
29
|
+
|
30
|
+
@assignment = make AssignmentObject, :site=>@site1.name, :instructions=>@source_site_string
|
31
|
+
@assignment.create
|
32
|
+
@assignment.get_info
|
33
|
+
|
34
|
+
@source_site_string << "Assignment...<br />\nID:(n) #{@assignment.id}<br />\n"
|
35
|
+
@source_site_string << "Link (made 'by hand'): <a href=\"#{@assignment.link}\">#{@assignment.title}</a><br />\n"
|
36
|
+
@source_site_string << "URL from Entity picker:(x) <a href=\"#{@assignment.url}\">#{@assignment.title}</a><br />\n"
|
37
|
+
@source_site_string << "<em>Direct</em> URL from Entity picker:(y) <a href=\"#{@assignment.direct_url}\">#{@assignment.title}</a><br />\n<br />\n#{@assignment.direct_url}<br />\n<br />\n"
|
38
|
+
@source_site_string << "<em>Portal</em> URL from Entity picker:(z) <a href=\"#{@assignment.portal_url}\">#{@assignment.title}</a><br />\n<br />\n#{@assignment.portal_url}<br />\n<br />\n"
|
39
|
+
|
40
|
+
@announcement = make AnnouncementObject, :site=>@site1.name, :body=>@assignment.link
|
41
|
+
@announcement.create
|
42
|
+
|
43
|
+
@source_site_string << "<br />\nAnnouncement link: <a href=\"#{@announcement.link}\">#{@announcement.title}</a><br />\n"
|
44
|
+
|
45
|
+
@file = make FileObject, :site=>@site1.name, :name=>"flower02.jpg", :source_path=>@file_path+"images/"
|
46
|
+
@file.create
|
47
|
+
|
48
|
+
@source_site_string << "<br />\nUploaded file: <a href=\"#{@file.href}\">#{@file.name}</a><br />\n"
|
49
|
+
|
50
|
+
@htmlpage = make HTMLPageObject, :site=>@site1.name, :folder=>"#{@site1.name} Resources", :html=>@source_site_string
|
51
|
+
@htmlpage.create
|
52
|
+
|
53
|
+
@source_site_string << "<br />\nHTML Page: <a href=\"#{@htmlpage.url}\">#{@htmlpage.name}</a><br />\n"
|
54
|
+
|
55
|
+
@folder = make FolderObject, :site=>@site1.name, :parent_folder=>"#{@site1.name} Resources"
|
56
|
+
@folder.create
|
57
|
+
|
58
|
+
@nestedhtmlpage = make HTMLPageObject, :site=>@site1.name, :folder=>@folder.name, :html=>@source_site_string
|
59
|
+
@nestedhtmlpage.create
|
60
|
+
|
61
|
+
@source_site_string << "<br />\nNested HTML Page: <a href=\"#{@nestedhtmlpage.url}\">#{@nestedhtmlpage.name}</a><br />\n"
|
62
|
+
|
63
|
+
@web_content1 = make WebContentObject, :title=>@htmlpage.name, :source=>@htmlpage.url, :site=>@htmlpage.site
|
64
|
+
@web_content1.create
|
65
|
+
|
66
|
+
@web_content2 = make WebContentObject, :title=>@nestedhtmlpage.name, :source=>@nestedhtmlpage.url, :site=>@nestedhtmlpage.site
|
67
|
+
@web_content2.create
|
68
|
+
|
69
|
+
@module = make ModuleObject, :site=>@site1.name
|
70
|
+
@module.create
|
71
|
+
|
72
|
+
@source_site_string << "<br />\nModule: <a href=\"#{@module.href}\">#{@module.name}</a><br />\n"
|
73
|
+
|
74
|
+
@section1 = make ContentSectionObject, :site=>@site1.name, :module=>@module.title, :content_type=>"Compose content with editor",
|
75
|
+
:editor_content=>@source_site_string
|
76
|
+
@section1.create
|
77
|
+
|
78
|
+
@source_site_string << "<br />\nSection 1: <a href=\"#{@section1.href}\">#{@section1.name}</a><br />\n"
|
79
|
+
|
80
|
+
@section2 = make ContentSectionObject, :site=>@site1.name, :module=>@module.title, :content_type=>"Upload or link to a file",
|
81
|
+
:file_name=>"flower01.jpg", :file_path=>@file_path+"images/"
|
82
|
+
@section2.create
|
83
|
+
|
84
|
+
@source_site_string << "<br />Section 2: <a href=\"#{@section2.href}\">#{@section2.name}</a><br />"
|
85
|
+
|
86
|
+
@section3 = make ContentSectionObject, :site=>@site1.name, :module=>@module.title, :content_type=>"Link to new or existing URL resource on server",
|
87
|
+
:url=>@htmlpage.url, :url_title=>@htmlpage.name
|
88
|
+
@section3.create
|
89
|
+
|
90
|
+
@section4 = make ContentSectionObject, :site=>@site1.name, :module=>@module.title, :content_type=>"Upload or link to a file in Resources",
|
91
|
+
:file_name=>@nestedhtmlpage.name, :file_folder=>@nestedhtmlpage.folder
|
92
|
+
@section4.create
|
93
|
+
|
94
|
+
@wiki = make WikiObject, :site=>@site1.name, :content=>"{image:worksite:/#{@file.name}}\n\n{worksiteinfo}\n\n{sakai-sections}"
|
95
|
+
@wiki.create
|
96
|
+
|
97
|
+
@source_site_string << "<br />Wiki: <a href=\"#{@wiki.href}\">#{@wiki.title}</a><br />"
|
98
|
+
|
99
|
+
@syllabus = make SyllabusObject, :content=>@source_site_string, :site=>@site1.name
|
100
|
+
@syllabus.create
|
101
|
+
|
102
|
+
@forum = make ForumObject, :site=>@site1.name, :short_description=>random_alphanums, :description=>@source_site_string
|
103
|
+
@forum.create
|
104
|
+
@forum.get_entity_info
|
105
|
+
|
106
|
+
@source_site_string << "<br />\nForum link: <a href=\"#{@forum.direct_link}\">#{@forum.title}</a><br />\n"
|
107
|
+
|
108
|
+
@topic = make TopicObject, :site=>@site1.name, :forum=>@forum.title, :description=>@source_site_string
|
109
|
+
@topic.create
|
110
|
+
@topic.get_entity_info
|
111
|
+
|
112
|
+
@source_site_string << "<br />\nTopic link: <a href=\"#{@topic.direct_link}\">#{@topic.title}</a><br />\n"
|
113
|
+
|
114
|
+
@event = make EventObject, :site=>@site1.name, :message=>@source_site_string
|
115
|
+
@event.create
|
116
|
+
|
117
|
+
@forum.edit :description=>@source_site_string
|
118
|
+
|
119
|
+
@topic.edit :description=>@source_site_string
|
120
|
+
|
121
|
+
@assignment.edit :instructions=>@source_site_string
|
122
|
+
|
123
|
+
@announcement.edit :body=>@source_site_string
|
124
|
+
|
125
|
+
@htmlpage.edit_content @source_site_string
|
126
|
+
|
127
|
+
@nestedhtmlpage.edit_content @source_site_string
|
128
|
+
|
129
|
+
@section1.edit :editor_content=>@source_site_string
|
130
|
+
|
131
|
+
@site2 = @site1.duplicate
|
132
|
+
|
133
|
+
@new_assignment = make AssignmentObject, :site=>@site2.name, :status=>"Draft", :title=>@assignment.title
|
134
|
+
@new_assignment.get_info
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
after :all do
|
139
|
+
# Close the browser window
|
140
|
+
@browser.close
|
141
|
+
end
|
142
|
+
|
143
|
+
def check_this_stuff(thing)
|
144
|
+
thing.should match /Site ID: #{@site2.id}/
|
145
|
+
thing.should match /\(y\) <a href..#{@new_assignment.direct_url}/
|
146
|
+
thing.should_not match /Announcement link:.+#{@announcement.id}.+#{@announcement.title}/
|
147
|
+
thing.should match /Uploaded file:.+#{@site2.id}.+#{@file.name}/
|
148
|
+
thing.should match /#{@site2.id}\/#{@htmlpage.name}/
|
149
|
+
thing.should match /#{@site2.id}\/#{@folder.name}\/#{@nestedhtmlpage.name}/
|
150
|
+
thing.should match /Wiki:.+#{@site2.id}.+#{@wiki.name}/
|
151
|
+
thing.should_not match /Forum link:.+#{@forum.direct_link}.+#{@forum.title}/
|
152
|
+
thing.should_not match /Topic link:.+#{@topic.direct_link}.+#{@topic.title}/
|
153
|
+
|
154
|
+
# These are not expected to work:
|
155
|
+
#puts "Assignment ID updated? " + (thing[/ID:\(n\) #{@new_assignment.id}/]==nil ? "no" : "yes")
|
156
|
+
#puts "Assignment Link updated? " + (thing[/hand.\): <a href.+#{@new_assignment.link}.+doView_assignment/]==nil ? "no" : "yes")
|
157
|
+
#puts "Entity picker Assignment URL updated? " + (thing[/\(x\) <a href.+#{@new_assignment.url}.+doView_submission/]==nil ? "no" : "yes")
|
158
|
+
#puts "Assignment Portal Link updated? " + (thing[/\(z\) <a href..#{@new_assignment.portal_url}/]==nil ? "no" : "yes")
|
159
|
+
#puts "Module Link updated? " + (thing[/Module:.+#{@site2.id}.+#{@module.name}/]==nil ? "no" : "yes")
|
160
|
+
#puts "Section 1 Link updated? " + (thing[/Section 1:.+#{@site2.id}.+#{@section1.name}/]==nil ? "no" : "yes")
|
161
|
+
#puts "Section 2 Link updated? " + (thing[/Section 2:.+#{@site2.id}.+#{@section2.name}/]==nil ? "no" : "yes")
|
162
|
+
#puts "Wiki link updated? " + (thing[/#{@site2.id}/]==nil ? "no" : "yes")
|
163
|
+
#puts "Syllabus Link updated? " + (thing[/Syllabus: #{@site2.id}/]==nil ? "no" : "yes")
|
164
|
+
end
|
165
|
+
|
166
|
+
it "duplicates Assignments correctly" do
|
167
|
+
|
168
|
+
check_this_stuff(@new_assignment.instructions)
|
169
|
+
end
|
170
|
+
|
171
|
+
it "duplicates Web Content pages correctly" do
|
172
|
+
open_my_site_by_name @site2.name unless @browser.title=~/#{@site2.name}/
|
173
|
+
@browser.link(:text=>@web_content1.title, :href=>/#{@site2.id}/).should be_present
|
174
|
+
@browser.link(:text=>@web_content2.title, :href=>/#{@site2.id}/).should be_present
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
it "duplicates Announcements correctly" do
|
179
|
+
@new_announcement = make AnnouncementObject, :site=>@site2.name, :title=>@announcement.title
|
180
|
+
@new_announcement.view
|
181
|
+
|
182
|
+
check_this_stuff(@new_announcement.message_html)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "duplicates Forums correctly" do
|
186
|
+
@new_forum = make ForumObject, :site=>@site2.name, :title=>@forum.title
|
187
|
+
@new_forum.view
|
188
|
+
|
189
|
+
check_this_stuff(@new_forum.description_html)
|
190
|
+
end
|
191
|
+
|
192
|
+
it "duplicates Topics correctly" do
|
193
|
+
@new_topic = make TopicObject, :site=>@site2.name, :forum=>@forum.title, :title=>@topic.title
|
194
|
+
@new_topic.view
|
195
|
+
check_this_stuff(@new_topic.description_html)
|
196
|
+
end
|
197
|
+
|
198
|
+
xit "duplicates Lessons correctly" do
|
199
|
+
lessons
|
200
|
+
on Lessons do |lessons|
|
201
|
+
lessons.lessons_list.should include @module.title
|
202
|
+
lessons.sections_list(@module.title).should include @section1.title
|
203
|
+
lessons.sections_list(@module.title).should include @section2.title
|
204
|
+
lessons.sections_list(@module.title).should include @section3.title
|
205
|
+
lessons.sections_list(@module.title).should include @section4.title
|
206
|
+
lessons.open_section @section1.title
|
207
|
+
end
|
208
|
+
on AddEditContentSection do |section|
|
209
|
+
@text = section.get_source_text section.content_editor
|
210
|
+
end
|
211
|
+
|
212
|
+
check_this_stuff @text
|
213
|
+
end
|
214
|
+
|
215
|
+
it "duplicates Syllabi correctly" do
|
216
|
+
@new_syllabus = make SyllabusObject, :site=>@site2.name, :title=>@syllabus.title
|
217
|
+
@new_syllabus.get_properties
|
218
|
+
|
219
|
+
check_this_stuff @new_syllabus.content
|
220
|
+
end
|
221
|
+
|
222
|
+
it "duplicates Wikis correctly" do
|
223
|
+
@new_wiki = make WikiObject, :site=>@site2.name, :title=>@wiki.title
|
224
|
+
@new_wiki.get_content
|
225
|
+
|
226
|
+
@new_wiki.content.should == @wiki.content
|
227
|
+
end
|
228
|
+
|
229
|
+
it "duplicates Resources correctly" do
|
230
|
+
resources
|
231
|
+
on Resources do |resources|
|
232
|
+
resources.folder_names.should include @folder.name
|
233
|
+
resources.file_names.should include @file.name
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
it "duplicates Events correctly" do
|
238
|
+
@new_event = make EventObject, :title=>@event.title, :site=>@site2.name
|
239
|
+
@new_event.view
|
240
|
+
|
241
|
+
check_this_stuff @new_event.message_html
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
metadata
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sambal-cle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Abraham Heward
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-10-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: watir-webdriver
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.5.5
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.5.5
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: selenium-webdriver
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.21.2
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.21.2
|
46
|
+
description: The Sambal-CLE gem provides an API for interacting with pages and page
|
47
|
+
elements in rSmart's deployment of the Sakai Collaborative Learning Environment.
|
48
|
+
email:
|
49
|
+
- ! '"aheward@rsmart.com"'
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- lib/sambal-cle/base_page.rb
|
55
|
+
- lib/sambal-cle/core-ext.rb
|
56
|
+
- lib/sambal-cle/data_objects/announcement.rb
|
57
|
+
- lib/sambal-cle/data_objects/assessment.rb
|
58
|
+
- lib/sambal-cle/data_objects/assignment.rb
|
59
|
+
- lib/sambal-cle/data_objects/blog.rb
|
60
|
+
- lib/sambal-cle/data_objects/blogger.rb
|
61
|
+
- lib/sambal-cle/data_objects/chat_room.rb
|
62
|
+
- lib/sambal-cle/data_objects/event.rb
|
63
|
+
- lib/sambal-cle/data_objects/forum.rb
|
64
|
+
- lib/sambal-cle/data_objects/lesson.rb
|
65
|
+
- lib/sambal-cle/data_objects/message.rb
|
66
|
+
- lib/sambal-cle/data_objects/poll.rb
|
67
|
+
- lib/sambal-cle/data_objects/resource.rb
|
68
|
+
- lib/sambal-cle/data_objects/site.rb
|
69
|
+
- lib/sambal-cle/data_objects/syllabus.rb
|
70
|
+
- lib/sambal-cle/data_objects/web_content_tool.rb
|
71
|
+
- lib/sambal-cle/data_objects/wiki.rb
|
72
|
+
- lib/sambal-cle/date_makers.rb
|
73
|
+
- lib/sambal-cle/gem_ext.rb
|
74
|
+
- lib/sambal-cle/page_helper.rb
|
75
|
+
- lib/sambal-cle/page_maker.rb
|
76
|
+
- lib/sambal-cle/page_objects/account.rb
|
77
|
+
- lib/sambal-cle/page_objects/aliases.rb
|
78
|
+
- lib/sambal-cle/page_objects/announcements.rb
|
79
|
+
- lib/sambal-cle/page_objects/assessments.rb
|
80
|
+
- lib/sambal-cle/page_objects/assignments.rb
|
81
|
+
- lib/sambal-cle/page_objects/basic_lti.rb
|
82
|
+
- lib/sambal-cle/page_objects/blogger.rb
|
83
|
+
- lib/sambal-cle/page_objects/blogs.rb
|
84
|
+
- lib/sambal-cle/page_objects/calendar.rb
|
85
|
+
- lib/sambal-cle/page_objects/calendar_summary.rb
|
86
|
+
- lib/sambal-cle/page_objects/chat_room.rb
|
87
|
+
- lib/sambal-cle/page_objects/drop_box.rb
|
88
|
+
- lib/sambal-cle/page_objects/email_archive.rb
|
89
|
+
- lib/sambal-cle/page_objects/entity_picker.rb
|
90
|
+
- lib/sambal-cle/page_objects/evaluations.rb
|
91
|
+
- lib/sambal-cle/page_objects/feedback.rb
|
92
|
+
- lib/sambal-cle/page_objects/forms.rb
|
93
|
+
- lib/sambal-cle/page_objects/forums.rb
|
94
|
+
- lib/sambal-cle/page_objects/glossary.rb
|
95
|
+
- lib/sambal-cle/page_objects/gradebook.rb
|
96
|
+
- lib/sambal-cle/page_objects/gradebook2.rb
|
97
|
+
- lib/sambal-cle/page_objects/home.rb
|
98
|
+
- lib/sambal-cle/page_objects/jforums.rb
|
99
|
+
- lib/sambal-cle/page_objects/job_scheduler.rb
|
100
|
+
- lib/sambal-cle/page_objects/lessons.rb
|
101
|
+
- lib/sambal-cle/page_objects/login.rb
|
102
|
+
- lib/sambal-cle/page_objects/matrix.rb
|
103
|
+
- lib/sambal-cle/page_objects/media_gallery.rb
|
104
|
+
- lib/sambal-cle/page_objects/messages.rb
|
105
|
+
- lib/sambal-cle/page_objects/my_workspace.rb
|
106
|
+
- lib/sambal-cle/page_objects/news.rb
|
107
|
+
- lib/sambal-cle/page_objects/podcasts.rb
|
108
|
+
- lib/sambal-cle/page_objects/polls.rb
|
109
|
+
- lib/sambal-cle/page_objects/portfolio_templates.rb
|
110
|
+
- lib/sambal-cle/page_objects/portfolios.rb
|
111
|
+
- lib/sambal-cle/page_objects/post_em.rb
|
112
|
+
- lib/sambal-cle/page_objects/profile.rb
|
113
|
+
- lib/sambal-cle/page_objects/profile2.rb
|
114
|
+
- lib/sambal-cle/page_objects/public_search.rb
|
115
|
+
- lib/sambal-cle/page_objects/realms.rb
|
116
|
+
- lib/sambal-cle/page_objects/resources.rb
|
117
|
+
- lib/sambal-cle/page_objects/resources_roster.rb
|
118
|
+
- lib/sambal-cle/page_objects/rosters.rb
|
119
|
+
- lib/sambal-cle/page_objects/rwiki.rb
|
120
|
+
- lib/sambal-cle/page_objects/search.rb
|
121
|
+
- lib/sambal-cle/page_objects/sections.rb
|
122
|
+
- lib/sambal-cle/page_objects/single_user.rb
|
123
|
+
- lib/sambal-cle/page_objects/site_setup.rb
|
124
|
+
- lib/sambal-cle/page_objects/site_statistics.rb
|
125
|
+
- lib/sambal-cle/page_objects/sites.rb
|
126
|
+
- lib/sambal-cle/page_objects/styles.rb
|
127
|
+
- lib/sambal-cle/page_objects/syllabus.rb
|
128
|
+
- lib/sambal-cle/page_objects/user_membership.rb
|
129
|
+
- lib/sambal-cle/page_objects/users.rb
|
130
|
+
- lib/sambal-cle/randomizers.rb
|
131
|
+
- lib/sambal-cle/rich_text.rb
|
132
|
+
- lib/sambal-cle/utilities.rb
|
133
|
+
- lib/sambal-cle/workflows.rb
|
134
|
+
- lib/sambal-cle.rb
|
135
|
+
- README.md
|
136
|
+
- sambal-cle.gemspec
|
137
|
+
- test/add_assignment_to_calendar_spec.rb
|
138
|
+
- test/assignment_announcements_spec.rb
|
139
|
+
- test/assignment_gradebook_spec.rb
|
140
|
+
- test/config.yml.template
|
141
|
+
- test/directory.yml.template
|
142
|
+
- test/duplicate_site_spec.rb
|
143
|
+
homepage: https://github.com/rSmart/sambal-cle
|
144
|
+
licenses: []
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 1.9.2
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
requirements: []
|
162
|
+
rubyforge_project:
|
163
|
+
rubygems_version: 1.8.24
|
164
|
+
signing_key:
|
165
|
+
specification_version: 3
|
166
|
+
summary: Sakai-CLE functional testing API for the rSmart Collaborative Learning Environment
|
167
|
+
test_files: []
|