sambal-cle 0.1.5 → 0.1.6

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.
Files changed (58) hide show
  1. data/Gemfile +3 -5
  2. data/Gemfile.lock +6 -9
  3. data/lib/sambal-cle/base_page.rb +21 -3
  4. data/lib/sambal-cle/data_objects/announcement.rb +1 -1
  5. data/lib/sambal-cle/data_objects/assignment.rb +3 -2
  6. data/lib/sambal-cle/data_objects/course.rb +5 -4
  7. data/lib/sambal-cle/data_objects/event.rb +7 -7
  8. data/lib/sambal-cle/data_objects/forum.rb +3 -2
  9. data/lib/sambal-cle/data_objects/lesson.rb +3 -1
  10. data/lib/sambal-cle/data_objects/resource.rb +3 -1
  11. data/lib/sambal-cle/page_objects/account.rb +15 -66
  12. data/lib/sambal-cle/page_objects/aliases.rb +3 -2
  13. data/lib/sambal-cle/page_objects/announcements.rb +16 -31
  14. data/lib/sambal-cle/page_objects/assessments.rb +22 -55
  15. data/lib/sambal-cle/page_objects/assignments.rb +1 -1
  16. data/lib/sambal-cle/page_objects/blogger.rb +21 -77
  17. data/lib/sambal-cle/page_objects/blogs.rb +3 -5
  18. data/lib/sambal-cle/page_objects/calendar.rb +22 -40
  19. data/lib/sambal-cle/page_objects/chat_room.rb +2 -2
  20. data/lib/sambal-cle/page_objects/email_archive.rb +1 -2
  21. data/lib/sambal-cle/page_objects/evaluations.rb +78 -50
  22. data/lib/sambal-cle/page_objects/feedback.rb +1 -5
  23. data/lib/sambal-cle/page_objects/forms.rb +14 -55
  24. data/lib/sambal-cle/page_objects/forums.rb +11 -24
  25. data/lib/sambal-cle/page_objects/glossary.rb +6 -12
  26. data/lib/sambal-cle/page_objects/home.rb +7 -18
  27. data/lib/sambal-cle/page_objects/jforums.rb +60 -197
  28. data/lib/sambal-cle/page_objects/job_scheduler.rb +16 -49
  29. data/lib/sambal-cle/page_objects/lessons.rb +11 -34
  30. data/lib/sambal-cle/page_objects/matrix.rb +12 -14
  31. data/lib/sambal-cle/page_objects/messages.rb +71 -466
  32. data/lib/sambal-cle/page_objects/my_workspace.rb +3 -3
  33. data/lib/sambal-cle/page_objects/podcasts.rb +1 -6
  34. data/lib/sambal-cle/page_objects/polls.rb +5 -5
  35. data/lib/sambal-cle/page_objects/portfolio_templates.rb +16 -66
  36. data/lib/sambal-cle/page_objects/portfolios.rb +17 -67
  37. data/lib/sambal-cle/page_objects/profile.rb +5 -16
  38. data/lib/sambal-cle/page_objects/profile2.rb +51 -119
  39. data/lib/sambal-cle/page_objects/public_search.rb +6 -27
  40. data/lib/sambal-cle/page_objects/realms.rb +2 -2
  41. data/lib/sambal-cle/page_objects/resources.rb +89 -116
  42. data/lib/sambal-cle/page_objects/resources_roster.rb +1 -0
  43. data/lib/sambal-cle/page_objects/rosters.rb +3 -13
  44. data/lib/sambal-cle/page_objects/rwiki.rb +2 -6
  45. data/lib/sambal-cle/page_objects/search.rb +10 -10
  46. data/lib/sambal-cle/page_objects/sections.rb +40 -81
  47. data/lib/sambal-cle/page_objects/site_setup.rb +46 -74
  48. data/lib/sambal-cle/page_objects/sites.rb +24 -110
  49. data/lib/sambal-cle/page_objects/styles.rb +6 -51
  50. data/lib/sambal-cle/page_objects/syllabus.rb +12 -26
  51. data/lib/sambal-cle/page_objects/user_membership.rb +3 -15
  52. data/lib/sambal-cle/page_objects/users.rb +9 -25
  53. data/sambal-cle.gemspec +1 -1
  54. data/test/add_assignment_to_calendar_spec.rb +55 -1
  55. data/test/config.yml +1 -1
  56. data/test/duplicate_site_spec.rb +11 -10
  57. data/test/import_site_content_spec.rb +6 -5
  58. metadata +2 -2
@@ -9,7 +9,7 @@ class ChatRoom < BasePage
9
9
 
10
10
  value(:total_messages_shown) { |b| b.frame(:class=>"wcwmenu").div(:id=>"chat2_messages_shown_total").text }
11
11
 
12
- action(:options) { |b| b.frm.link(text: "Options").click }
12
+ link "Options"
13
13
 
14
14
  end
15
15
 
@@ -17,6 +17,6 @@ class ManageRooms < BasePage
17
17
 
18
18
  frame_element
19
19
 
20
- action(:add_room) { |b| b.frm.link(text: "Add Room").click }
20
+ link "Add Room"
21
21
 
22
22
  end
@@ -3,8 +3,7 @@ class EmailArchive < BasePage
3
3
 
4
4
  frame_element
5
5
 
6
- # EmailArchiveOptions
7
- action(:options){ |b| b.frm.link(:text=>"Options").click }
6
+ link "Options"
8
7
 
9
8
  # Returns an array containing the
10
9
  def email_list
@@ -2,55 +2,76 @@
2
2
  # Evaluation System Pages
3
3
  #================
4
4
 
5
- # The "Evaluations Dashboard"
6
- class EvaluationSystem < BasePage
5
+ class EvaluationSystemBase < BasePage
7
6
 
8
7
  frame_element
9
8
 
10
- # MyTemplates
11
- action(:my_templates) { |b| b.frm.link(:text=>"My Templates").click }
9
+ class << self
12
10
 
13
- # AddTemplateTitle
14
- action(:add_template) { |b| b.frm.link(:text=>"Add Template").click }
11
+ def menu_elements
12
+ link("Administrate")
13
+ link("Evaluations dashboard")
14
+ link("My Evaluations")
15
+ link("My Templates")
16
+ link("My Items")
17
+ link("My Scales")
18
+ link("My Email Templates")
19
+ action(:take_evaluation) { |evaluation_name, b| b.frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/).link.click }
20
+ action(:status_of) { |evaluation_name, b| b.frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/)[1][1].text }
15
21
 
16
- # TakeEvaluation
17
- def take_evaluation(evaluation_name)
18
- frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/).link.click
19
- TakeEvaluation.new(@browser)
20
- end
22
+ end
21
23
 
22
- def status_of(evaluation_name)
23
- frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/)[1][1].text
24
24
  end
25
25
 
26
26
  end
27
27
 
28
- #
29
- class AddTemplateTitle < BasePage
28
+ class EvaluationAdministrate < EvaluationSystemBase
30
29
 
31
- frame_element
30
+ menu_elements
32
31
 
33
- def save
34
- frm.button(:value=>"Save").click
35
- EditTemplate.new(@browser)
36
- end
32
+ # TODO: The "Search" link will need to be defined differently because there are multiple "Searches" on the page
33
+
34
+ link("Control Reporting")
35
+ link("Control Email Settings")
36
+ link("Control Eval Admin")
37
+ link("Test EvalGroupProvider")
38
+ link("Synchronize Group Memberships")
39
+
40
+ button("Save Settings")
41
+
42
+ end
43
+
44
+ class EvaluationsDashboard < EvaluationSystemBase
45
+
46
+ menu_elements
47
+
48
+ link("Add Template")
49
+ link("Add Evaluation")
50
+
51
+ end
52
+
53
+ #
54
+ class AddTemplateTitle < EvaluationSystemBase
55
+
56
+ menu_elements
57
+ basic_page_elements
37
58
 
38
59
  element(:title) { |b| b.frm.text_field(:id=>"title") }
39
60
  element(:description) { |b| b.frm.text_area(:id=>"description") }
40
61
 
41
62
  end
42
63
 
43
-
44
64
  #
45
65
  class EditTemplate < BasePage
46
66
 
67
+ include FCKEditor
47
68
  frame_element
48
69
 
49
70
  def item_text=(text)
50
71
  frm.frame(:id, "item-text___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
51
72
  end
52
73
 
53
- action(:new_evaluation) { |b| b.frm.link(:text=>"New evaluation").click }
74
+ link("New evaluation")
54
75
 
55
76
  def add
56
77
  frm.button(:value=>"Add").click
@@ -60,10 +81,10 @@ class EditTemplate < BasePage
60
81
  def save_item
61
82
  frm.button(:value=>"Save item").click
62
83
  frm.link(:text=>"New evaluation").wait_until_present
63
- EditTemplate.new @browser
64
84
  end
65
85
 
66
86
  element(:item) { |b| b.frm.select_list(:id=>"add-item-control::add-item-classification-selection").click }
87
+
67
88
  end
68
89
 
69
90
 
@@ -77,10 +98,7 @@ class NewEvaluation < BasePage
77
98
 
78
99
  element(:editor) { |b| b.frm.frame(:id, "instructions:1:input___Frame") }
79
100
 
80
- def continue_to_settings
81
- frm.button(:value=>"Continue to Settings").click
82
- EvaluationSettings.new(@browser)
83
- end
101
+ button("Continue to Settings")
84
102
 
85
103
  def instructions=(text)
86
104
  frm.frame(:id, "instructions:1:input___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
@@ -90,37 +108,29 @@ class NewEvaluation < BasePage
90
108
 
91
109
  end
92
110
 
93
-
94
111
  #
95
112
  class EvaluationSettings < BasePage
96
113
 
97
114
  frame_element
98
115
 
99
- def continue_to_assign_to_courses
100
- frm.button(:value=>"Continue to Assign to Courses").click
101
- EditEvaluationAssignment.new(@browser)
102
- end
103
-
116
+ button("Continue to Assign to Courses")
104
117
 
105
118
  end
106
119
 
107
-
108
120
  #
109
121
  class EditEvaluationAssignment < BasePage
110
122
 
111
123
  frame_element
112
124
 
113
- def save_assigned_groups
114
- frm.button(:value=>"Save Assigned Groups").click
115
- ConfirmEvaluation.new(@browser)
116
- end
125
+ button("Save Assigned Groups")
117
126
 
118
127
  def check_group(title)
119
128
  frm.table(:class=>"listHier lines nolines").wait_until_present
120
129
  frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>"selectedGroupIDs").set
121
130
  end
122
131
 
123
- action(:assign_to_evaluation_groups) { |b| b.frm.link(:text=>"Assign to Evaluation Groups").click }
132
+ link("Assign to Evaluation Groups")
133
+
124
134
  end
125
135
 
126
136
 
@@ -129,18 +139,40 @@ class ConfirmEvaluation < BasePage
129
139
 
130
140
  frame_element
131
141
 
132
- def done
133
- frm.button(:value=>"Done").click
134
- MyEvaluations.new(@browser)
135
- end
142
+ action(:done) { |b| b.frm.button(:value=>"Done").click }
136
143
 
137
144
  end
138
145
 
139
146
  #
140
- class MyEvaluations < BasePage
147
+ class MyEvaluations < EvaluationSystemBase
141
148
 
142
- frame_element
149
+ menu_elements
150
+
151
+ link("Add Evaluation")
143
152
 
153
+ end
154
+
155
+ class MyTemplates < EvaluationSystemBase
156
+
157
+ menu_elements
158
+
159
+ end
160
+
161
+ class MyItems < EvaluationSystemBase
162
+
163
+ menu_elements
164
+
165
+ end
166
+
167
+ class MyScales < EvaluationSystemBase
168
+
169
+ menu_elements
170
+
171
+ end
172
+
173
+ class MyEmailTemplates < EvaluationSystemBase
174
+
175
+ menu_elements
144
176
 
145
177
  end
146
178
 
@@ -149,10 +181,6 @@ class TakeEvaluation < BasePage
149
181
 
150
182
  frame_element
151
183
 
152
- def submit_evaluation
153
- frm.button(:value=>"Submit Evaluation").click
154
- EvaluationSystem.new(@browser)
155
- end
156
-
184
+ action(:submit_evaluation) { |b| b.frm.button(:value=>"Submit Evaluation").click }
157
185
 
158
186
  end
@@ -7,10 +7,7 @@ class Feedback < BasePage
7
7
 
8
8
  frame_element
9
9
 
10
- def add
11
- frm.link(:text=>"Add").click
12
- AddUpdateFeedback.new(@browser)
13
- end
10
+ link "Add"
14
11
 
15
12
  # Returns an array containing the titles
16
13
  # of the Feedback items listed on the page.
@@ -30,7 +27,6 @@ class AddUpdateFeedback < BasePage
30
27
 
31
28
  frame_element
32
29
 
33
-
34
30
  element(:title) { |b| b.frm.text_field(:id=>"_idJsp1:title") }
35
31
 
36
32
  end
@@ -7,26 +7,13 @@ class Forms < BasePage
7
7
 
8
8
  frame_element
9
9
 
10
- # Clicks the Add button and instantiates
11
- # the AddForm Class.
12
- def add
13
- frm.link(:text=>"Add").click
14
- AddForm.new(@browser)
15
- end
10
+ link "Add"
16
11
 
17
12
  # Clicks the Publish buton for the specified
18
- # Form, then instantiates the PublishForm Class.
19
- def publish(form_name)
20
- frm.table(:class=>"listHier lines nolines").tr(:text, /#{Regexp.escape(form_name)}/).link(:text=>/Publish/).click
21
- PublishForm.new(@browser)
22
- end
13
+ # Form
14
+ action(:publish) { |form_name, b| b.frm.table(:class=>"listHier lines nolines").tr(:text, /#{Regexp.escape(form_name)}/).link(:text=>/Publish/).click }
23
15
 
24
- # Clicks the Import button, then
25
- # instantiates the ImportForms Class.
26
- def import
27
- frm.link(:text=>"Import").click
28
- ImportForms.new(@browser)
29
- end
16
+ link "Import"
30
17
 
31
18
  end
32
19
 
@@ -34,35 +21,24 @@ class ImportForms < BasePage
34
21
 
35
22
  frame_element
36
23
 
37
- def import
38
- frm.button(:value=>"Import").click
39
- Forms.new(@browser)
40
- end
24
+ button "Import"
41
25
 
42
- def select_file
43
- frm.link(:text=>"Select File...").click
44
- AttachFileFormImport.new(@browser)
45
- end
26
+ link "Select File..."
46
27
 
47
28
  end
48
29
 
49
30
  class AddForm < BasePage
50
31
 
32
+ include FCKEditor
51
33
  frame_element
52
34
 
53
- def select_schema_file
54
- frm.link(:text=>"Select Schema File").click
55
- SelectSchemaFile.new(@browser)
56
- end
35
+ link "Select Schema File"
57
36
 
58
37
  def instruction=(text)
59
38
  frm.frame(:id, "instruction___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
60
39
  end
61
40
 
62
- def add_form
63
- frm.button(:value=>"Add Form").click
64
- Forms.new(@browser)
65
- end
41
+ button "Add Form"
66
42
 
67
43
  element(:name) { |b| b.frm.text_field(:id=>"description-id") }
68
44
 
@@ -73,21 +49,11 @@ class SelectSchemaFile < BasePage
73
49
 
74
50
  frame_element
75
51
 
76
- def show_other_sites
77
- frm.link(:title=>"Show other sites").click
78
- SelectSchemaFile.new(@browser)
79
- end
52
+ action(:show_other_sites) { |b| b.frm.link(:title=>"Show other sites").click }
80
53
 
81
- def open_folder(name)
82
- frm.link(:text=>name).click
83
- SelectSchemaFile.new(@browser)
84
- end
54
+ action(:open_folder) { |name, b| b.frm.link(:text=>name).click }
85
55
 
86
- def select_file(filename)
87
- index = file_names.index(filename)
88
- frm.table(:class=>"listHier lines").tr(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click
89
- SelectSchemaFile.new(@browser)
90
- end
56
+ action(:select_file) { |filename, b| b.frm.table(:class=>"listHier lines").tr(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click }
91
57
 
92
58
  def file_names #FIXME
93
59
  names = []
@@ -100,11 +66,7 @@ class SelectSchemaFile < BasePage
100
66
  return names
101
67
  end
102
68
 
103
- def continue
104
- frm.button(:value=>"Continue").click
105
- frm.frame(:id, "instruction___Frame").td(:id, "xEditingArea").wait_until_present
106
- AddForm.new(@browser)
107
- end
69
+ button "Continue"
108
70
 
109
71
  end
110
72
 
@@ -112,9 +74,6 @@ class PublishForm < BasePage
112
74
 
113
75
  frame_element
114
76
 
115
- def yes
116
- frm.button(:value=>"Yes").click
117
- Forms.new(@browser)
118
- end
77
+ button "Yes"
119
78
 
120
79
  end
@@ -18,10 +18,10 @@ class Forums < BasePage
18
18
  end
19
19
 
20
20
  # OrganizeForums
21
- action(:organize) { |b| b.frm.link(:text=>"Organize").click }
21
+ link "Organize"
22
22
 
23
23
  # ForumTemplateSettings
24
- action(:template_settings) { |b| b.frm.link(:text=>"Template Settings").click }
24
+ link "Template Settings"
25
25
 
26
26
  element(:forums_table) { |b| b.frm.div(:class=>"portletBody").table(:id=>"msgForum:forums") }
27
27
 
@@ -76,7 +76,7 @@ class TopicPage < BasePage
76
76
  frame_element
77
77
 
78
78
  # ComposeForumMessage
79
- action(:post_new_thread) { |b| b.frm.link(:text=>"Post New Thread").click }
79
+ link "Post New Thread"
80
80
 
81
81
  def thread_titles
82
82
  titles = []
@@ -93,7 +93,7 @@ class TopicPage < BasePage
93
93
  end
94
94
 
95
95
  # TopicPage
96
- action(:display_entire_message){ |b| b.frm.link(:text=>"Display Entire Message").click }
96
+ link "Display Entire Message"
97
97
 
98
98
  end
99
99
 
@@ -102,7 +102,7 @@ class ViewForumThread < BasePage
102
102
  frame_element
103
103
 
104
104
  # ComposeForumMessage
105
- action(:reply_to_thread) { |b| b.frm.link(:text=>"Reply to Thread").click }
105
+ link "Reply to Thread"
106
106
 
107
107
  # ComposeForumMessage
108
108
  # TODO: Figure out a better way to do this...
@@ -119,7 +119,7 @@ class ComposeForumMessage < BasePage
119
119
  expected_element :editor
120
120
 
121
121
  # TopicPage, probably
122
- action(:post_message) { |b| b.frm.button(:text=>"Post Message").click }
122
+ button "Post Message"
123
123
 
124
124
  element(:editor) { |b| b.frm.frame(:id, "dfCompose:df_compose_body_inputRichText___Frame") }
125
125
 
@@ -129,7 +129,7 @@ class ComposeForumMessage < BasePage
129
129
 
130
130
  value(:reply_text) { |b| b.frame(:index=>1).div(:class=>"singleMessageReply").text }
131
131
 
132
- action(:cancel) { |b| b.frm.button(:value=>"Cancel").click }
132
+ button "Cancel"
133
133
 
134
134
  element(:title) { |b| b.frm.text_field(:id=>"dfCompose:df_compose_title") }
135
135
 
@@ -138,23 +138,16 @@ end
138
138
  class ForumTemplateSettings < BasePage
139
139
 
140
140
  frame_element
141
+ basic_page_elements
141
142
 
142
143
  value(:page_title) { |b| b.frm.div(:class=>"portletBody").h3(:index=>0).text }
143
144
 
144
- # Forums
145
- action(:save) { |b| b.frm.button(:value=>"Save").click }
146
-
147
- # Forums
148
- action(:cancel) { |b| b.frm.button(:value=>"Cancel").click }
149
-
150
145
  end
151
146
 
152
147
  class OrganizeForums < BasePage
153
148
 
154
149
  frame_element
155
-
156
- # Forums
157
- action(:save) { |b| b.frm.button(:value=>"Save").click }
150
+ basic_page_elements
158
151
 
159
152
  # These are set to so that the user
160
153
  # does not have to start the list at zero...
@@ -172,10 +165,7 @@ class EditForum < BasePage
172
165
 
173
166
  include FCKEditor
174
167
  frame_element
175
-
176
- # Forums
177
- action(:save) { |b| b.frm.button(:value=>"Save").click }
178
- action(:cancel) { |b| b.frm.button(:value=>"Cancel").click }
168
+ basic_page_elements
179
169
 
180
170
  # AddEditTopic
181
171
  action(:save_and_add) { |b| b.frm.button(:value=>"Save Settings & Add Topic").click }
@@ -198,6 +188,7 @@ class AddEditTopic < BasePage
198
188
 
199
189
  include FCKEditor
200
190
  frame_element
191
+ basic_page_elements
201
192
 
202
193
  @@table_index=0 # TODO: Seriously think about a better way to do this
203
194
 
@@ -209,10 +200,6 @@ class AddEditTopic < BasePage
209
200
  editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
210
201
  end
211
202
 
212
- # Forums
213
- action(:save) { |b| b.frm.button(:value=>"Save").click }
214
- action(:cancel) { |b| b.frm.button(:value=>"Cancel").click }
215
-
216
203
  action(:add_attachments) { |b| b.frm.button(:value=>/Add.+ttachment/).click }
217
204
 
218
205
  def roles