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.
- data/Gemfile +3 -5
- data/Gemfile.lock +6 -9
- data/lib/sambal-cle/base_page.rb +21 -3
- data/lib/sambal-cle/data_objects/announcement.rb +1 -1
- data/lib/sambal-cle/data_objects/assignment.rb +3 -2
- data/lib/sambal-cle/data_objects/course.rb +5 -4
- data/lib/sambal-cle/data_objects/event.rb +7 -7
- data/lib/sambal-cle/data_objects/forum.rb +3 -2
- data/lib/sambal-cle/data_objects/lesson.rb +3 -1
- data/lib/sambal-cle/data_objects/resource.rb +3 -1
- data/lib/sambal-cle/page_objects/account.rb +15 -66
- data/lib/sambal-cle/page_objects/aliases.rb +3 -2
- data/lib/sambal-cle/page_objects/announcements.rb +16 -31
- data/lib/sambal-cle/page_objects/assessments.rb +22 -55
- data/lib/sambal-cle/page_objects/assignments.rb +1 -1
- data/lib/sambal-cle/page_objects/blogger.rb +21 -77
- data/lib/sambal-cle/page_objects/blogs.rb +3 -5
- data/lib/sambal-cle/page_objects/calendar.rb +22 -40
- data/lib/sambal-cle/page_objects/chat_room.rb +2 -2
- data/lib/sambal-cle/page_objects/email_archive.rb +1 -2
- data/lib/sambal-cle/page_objects/evaluations.rb +78 -50
- data/lib/sambal-cle/page_objects/feedback.rb +1 -5
- data/lib/sambal-cle/page_objects/forms.rb +14 -55
- data/lib/sambal-cle/page_objects/forums.rb +11 -24
- data/lib/sambal-cle/page_objects/glossary.rb +6 -12
- data/lib/sambal-cle/page_objects/home.rb +7 -18
- data/lib/sambal-cle/page_objects/jforums.rb +60 -197
- data/lib/sambal-cle/page_objects/job_scheduler.rb +16 -49
- data/lib/sambal-cle/page_objects/lessons.rb +11 -34
- data/lib/sambal-cle/page_objects/matrix.rb +12 -14
- data/lib/sambal-cle/page_objects/messages.rb +71 -466
- data/lib/sambal-cle/page_objects/my_workspace.rb +3 -3
- data/lib/sambal-cle/page_objects/podcasts.rb +1 -6
- data/lib/sambal-cle/page_objects/polls.rb +5 -5
- data/lib/sambal-cle/page_objects/portfolio_templates.rb +16 -66
- data/lib/sambal-cle/page_objects/portfolios.rb +17 -67
- data/lib/sambal-cle/page_objects/profile.rb +5 -16
- data/lib/sambal-cle/page_objects/profile2.rb +51 -119
- data/lib/sambal-cle/page_objects/public_search.rb +6 -27
- data/lib/sambal-cle/page_objects/realms.rb +2 -2
- data/lib/sambal-cle/page_objects/resources.rb +89 -116
- data/lib/sambal-cle/page_objects/resources_roster.rb +1 -0
- data/lib/sambal-cle/page_objects/rosters.rb +3 -13
- data/lib/sambal-cle/page_objects/rwiki.rb +2 -6
- data/lib/sambal-cle/page_objects/search.rb +10 -10
- data/lib/sambal-cle/page_objects/sections.rb +40 -81
- data/lib/sambal-cle/page_objects/site_setup.rb +46 -74
- data/lib/sambal-cle/page_objects/sites.rb +24 -110
- data/lib/sambal-cle/page_objects/styles.rb +6 -51
- data/lib/sambal-cle/page_objects/syllabus.rb +12 -26
- data/lib/sambal-cle/page_objects/user_membership.rb +3 -15
- data/lib/sambal-cle/page_objects/users.rb +9 -25
- data/sambal-cle.gemspec +1 -1
- data/test/add_assignment_to_calendar_spec.rb +55 -1
- data/test/config.yml +1 -1
- data/test/duplicate_site_spec.rb +11 -10
- data/test/import_site_content_spec.rb +6 -5
- metadata +2 -2
@@ -1,22 +1,11 @@
|
|
1
|
-
|
2
1
|
# The page where you search for public courses and projects.
|
3
2
|
class SearchPublic < BasePage
|
4
3
|
|
5
4
|
frame_element
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
def search_for=(string)
|
13
|
-
@browser.frame(:index=>0).text_field(:id=>"searchbox").set(Regexp.escape(string))
|
14
|
-
end
|
15
|
-
|
16
|
-
def search_for_sites
|
17
|
-
@browser.frame(:index=>0).button(:value=>"Search for Sites").click
|
18
|
-
SearchPublicResults.new(@browser)
|
19
|
-
end
|
6
|
+
action(:home) { |b| b.frame(:index=>0).link(:text=>"Home").click }
|
7
|
+
element(:search_for) { |b| b.frame(:index=>0).text_field(:id=>"searchbox") }
|
8
|
+
action(:search_for_sites) { |b| b.frame(:index=>0).button(:value=>"Search for Sites").click }
|
20
9
|
|
21
10
|
end
|
22
11
|
|
@@ -25,15 +14,8 @@ class SearchPublicResults < BasePage
|
|
25
14
|
|
26
15
|
frame_element
|
27
16
|
|
28
|
-
|
29
|
-
|
30
|
-
SiteSummaryPage.new(@browser)
|
31
|
-
end
|
32
|
-
|
33
|
-
def home
|
34
|
-
@browser.frame(:id=>"ifrm").link(:text=>"Home").click
|
35
|
-
Login.new(@browser)
|
36
|
-
end
|
17
|
+
action(:click_site) { |site_name, b| b.frame(:index=>0).link(:text=>site_name).click }
|
18
|
+
action(:home) { |b| b.frame(:id=>"ifrm").link(:text=>"Home").click }
|
37
19
|
|
38
20
|
end
|
39
21
|
|
@@ -43,10 +25,7 @@ class SiteSummaryPage < BasePage
|
|
43
25
|
|
44
26
|
frame_element
|
45
27
|
|
46
|
-
|
47
|
-
@browser.frame(:index=>0).button(:value=>"Return to List").click
|
48
|
-
SearchPublicResults.new(@browser)
|
49
|
-
end
|
28
|
+
action(:return_to_list) { |b| b.frame(:index=>0).button(:value=>"Return to List").click }
|
50
29
|
|
51
30
|
def syllabus_attachments
|
52
31
|
links = []
|
@@ -7,8 +7,8 @@ class Realms < BasePage
|
|
7
7
|
|
8
8
|
frame_element
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
link("New Realm")
|
11
|
+
link("Search")
|
12
12
|
element(:select_page_size) { |b| b.frm.select_list(:name=>"selectPageSize") }
|
13
13
|
action(:next) { |b| b.frm.button(:name=>"eventSubmit_doList_next").click }
|
14
14
|
action(:last) { |b| b.frm.button(:name=>"eventSubmit_doList_last").click }
|
@@ -10,7 +10,61 @@ class ResourcesBase < BasePage
|
|
10
10
|
|
11
11
|
frame_element
|
12
12
|
|
13
|
-
|
13
|
+
class << self
|
14
|
+
|
15
|
+
def resources_elements
|
16
|
+
element(:files_table) { |b| b.frm.table(:class=>/listHier lines/) }
|
17
|
+
|
18
|
+
# Use this as a means of checking if the file is visible or not
|
19
|
+
action(:item) { |name, b| b.frm.link(:text=>name) }
|
20
|
+
|
21
|
+
# Clicks the Select button next to the specified file.
|
22
|
+
action(:select_file) { |filename, b| b.files_table.row(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click }
|
23
|
+
|
24
|
+
# Clicks the Remove button.
|
25
|
+
action(:remove) { |b| b.frm.button(:value=>"Remove").click }
|
26
|
+
|
27
|
+
# Clicks the remove link for the specified item in the attachment list.
|
28
|
+
action(:remove_item) { |file_name, b| b.files_table.row(:text=>/#{Regexp.escape(file_name)}/).link(:href=>/doRemoveitem/).click }
|
29
|
+
|
30
|
+
# Clicks the Move button.
|
31
|
+
action(:move) { |b| b.frm.button(:value=>"Move").click }
|
32
|
+
|
33
|
+
# Clicks the Show Other Sites link.
|
34
|
+
action(:show_other_sites) { |b| b.frm.link(:text=>"Show other sites").click }
|
35
|
+
|
36
|
+
action(:href) { |item, b| b.frm.link(:text=>item).href }
|
37
|
+
|
38
|
+
# Clicks on the specified folder image, which
|
39
|
+
# will open the folder tree and remain on the page.
|
40
|
+
action(:open_folder) { |foldername, b| b.files_table.row(:text=>/#{Regexp.escape(foldername)}/).link(:title=>"Open this folder").click }
|
41
|
+
|
42
|
+
# Clicks on the specified folder name, which should open
|
43
|
+
# the folder contents on a refreshed page.
|
44
|
+
action(:go_to_folder) { |foldername, b| b.frm.link(:text=>foldername).click }
|
45
|
+
|
46
|
+
# Sets the URL field to the specified value.
|
47
|
+
action(:url=) { |url_string, b| b.frm.text_field(:id=>"url").set(url_string) }
|
48
|
+
|
49
|
+
# Clicks the Add button next to the URL field.
|
50
|
+
action(:add) { |b| b.frm.button(:value=>"Add").click }
|
51
|
+
|
52
|
+
# Gets the value of the access level cell for the specified
|
53
|
+
# file.
|
54
|
+
action(:access_level) { |filename, b| b.files_table.row(:text=>/#{Regexp.escape(filename)}/)[6].text }
|
55
|
+
|
56
|
+
element(:upload_file_field) { |b| b.frm.file_field(:id=>"upload") }
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
# Resources page for a given Site, in the Course Tools menu
|
65
|
+
class Resources < ResourcesBase
|
66
|
+
|
67
|
+
resources_elements
|
14
68
|
|
15
69
|
# Returns an array of the displayed folder names.
|
16
70
|
def folder_names
|
@@ -37,84 +91,6 @@ class ResourcesBase < BasePage
|
|
37
91
|
names
|
38
92
|
end
|
39
93
|
|
40
|
-
# Use this as a means of checking if the file is visible or not
|
41
|
-
def item(name)
|
42
|
-
frm.link(:text=>name)
|
43
|
-
end
|
44
|
-
|
45
|
-
# Clicks the Select button next to the specified file.
|
46
|
-
def select_file(filename)
|
47
|
-
files_table.row(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click
|
48
|
-
end
|
49
|
-
|
50
|
-
# Clicks the Remove button.
|
51
|
-
action(:remove) { |b| b.frm.button(:value=>"Remove").click }
|
52
|
-
|
53
|
-
# Clicks the remove link for the specified item in the attachment list.
|
54
|
-
def remove_item(file_name)
|
55
|
-
files_table.row(:text=>/#{Regexp.escape(file_name)}/).link(:href=>/doRemoveitem/).click
|
56
|
-
end
|
57
|
-
|
58
|
-
# Clicks the Move button.
|
59
|
-
action(:move) { |b| b.frm.button(:value=>"Move").click }
|
60
|
-
|
61
|
-
# Clicks the Show Other Sites link.
|
62
|
-
action(:show_other_sites) { |b| b.frm.link(:text=>"Show other sites").click }
|
63
|
-
|
64
|
-
def href(item)
|
65
|
-
frm.link(:text=>item).href
|
66
|
-
end
|
67
|
-
|
68
|
-
# Clicks on the specified folder image, which
|
69
|
-
# will open the folder tree and remain on the page.
|
70
|
-
def open_folder(foldername)
|
71
|
-
files_table.row(:text=>/#{Regexp.escape(foldername)}/).link(:title=>"Open this folder").click
|
72
|
-
end
|
73
|
-
|
74
|
-
# Clicks on the specified folder name, which should open
|
75
|
-
# the folder contents on a refreshed page.
|
76
|
-
def go_to_folder(foldername)
|
77
|
-
frm.link(:text=>foldername).click
|
78
|
-
end
|
79
|
-
|
80
|
-
# Sets the URL field to the specified value.
|
81
|
-
def url=(url_string)
|
82
|
-
frm.text_field(:id=>"url").set(url_string)
|
83
|
-
end
|
84
|
-
|
85
|
-
# Clicks the Add button next to the URL field.
|
86
|
-
action(:add) { |b| b.frm.button(:value=>"Add").click }
|
87
|
-
|
88
|
-
# Gets the value of the access level cell for the specified
|
89
|
-
# file.
|
90
|
-
def access_level(filename)
|
91
|
-
files_table.row(:text=>/#{Regexp.escape(filename)}/)[6].text
|
92
|
-
end
|
93
|
-
|
94
|
-
def edit_details(name)
|
95
|
-
open_actions_menu(name)
|
96
|
-
files_table.row(:text=>/#{Regexp.escape(name)}/).link(:text=>"Edit Details").click
|
97
|
-
end
|
98
|
-
|
99
|
-
def edit_content(html_page_name)
|
100
|
-
open_actions_menu(html_page_name)
|
101
|
-
files_table.row(:text=>/#{Regexp.escape(html_page_name)}/).link(:text=>"Edit Content").click
|
102
|
-
end
|
103
|
-
|
104
|
-
# Clicks the Create Folders menu item in the
|
105
|
-
# Add menu of the specified folder.
|
106
|
-
def create_subfolders_in(folder_name)
|
107
|
-
open_add_menu(folder_name)
|
108
|
-
files_table.row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create Folders").click
|
109
|
-
end
|
110
|
-
|
111
|
-
def create_html_page_in(folder_name)
|
112
|
-
open_add_menu(folder_name)
|
113
|
-
files_table.row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create HTML Page").click
|
114
|
-
end
|
115
|
-
|
116
|
-
element(:upload_file_field) { |b| b.frm.file_field(:id=>"upload") }
|
117
|
-
|
118
94
|
# Enters the specified file into the file field name (assuming it's in the
|
119
95
|
# data/sakai-cle-test-api folder or a subfolder therein)
|
120
96
|
#
|
@@ -150,10 +126,9 @@ class ResourcesBase < BasePage
|
|
150
126
|
end
|
151
127
|
files_table.row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Upload Files").click
|
152
128
|
end
|
153
|
-
alias upload_file_to_folder upload_files_to_folder
|
154
129
|
|
155
130
|
# Clicks the "Attach a copy" link for the specified
|
156
|
-
# file
|
131
|
+
# file.
|
157
132
|
# If an alert box appears, the method will call itself again.
|
158
133
|
# Note that this can lead to an infinite loop. Will need to fix later.
|
159
134
|
def attach_a_copy(file_name)
|
@@ -193,6 +168,28 @@ class ResourcesBase < BasePage
|
|
193
168
|
end
|
194
169
|
end
|
195
170
|
|
171
|
+
def edit_details(name)
|
172
|
+
open_actions_menu(name)
|
173
|
+
files_table.row(:text=>/#{Regexp.escape(name)}/).link(:text=>"Edit Details").click
|
174
|
+
end
|
175
|
+
|
176
|
+
def edit_content(html_page_name)
|
177
|
+
open_actions_menu(html_page_name)
|
178
|
+
files_table.row(:text=>/#{Regexp.escape(html_page_name)}/).link(:text=>"Edit Content").click
|
179
|
+
end
|
180
|
+
|
181
|
+
# Clicks the Create Folders menu item in the
|
182
|
+
# Add menu of the specified folder.
|
183
|
+
def create_subfolders_in(folder_name)
|
184
|
+
open_add_menu(folder_name)
|
185
|
+
files_table.row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create Folders").click
|
186
|
+
end
|
187
|
+
|
188
|
+
def create_html_page_in(folder_name)
|
189
|
+
open_add_menu(folder_name)
|
190
|
+
files_table.row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create HTML Page").click
|
191
|
+
end
|
192
|
+
|
196
193
|
# Clicks the Continue button
|
197
194
|
def continue
|
198
195
|
frm.div(:class=>"highlightPanel").span(:id=>"submitnotifxxx").wait_while_present
|
@@ -207,17 +204,12 @@ class ResourcesBase < BasePage
|
|
207
204
|
files_table.row(:text=>/#{Regexp.escape(name)}/).li(:text=>/Action/, :class=>"menuOpen").fire_event("onclick")
|
208
205
|
end
|
209
206
|
|
210
|
-
end
|
211
|
-
|
212
|
-
# Resources page for a given Site, in the Course Tools menu
|
213
|
-
class Resources < ResourcesBase
|
214
|
-
|
215
|
-
|
216
|
-
|
217
207
|
end
|
218
208
|
|
219
209
|
class ResourcesUploadFiles < ResourcesBase
|
220
210
|
|
211
|
+
resources_elements
|
212
|
+
|
221
213
|
@@filex=0 # TODO: This is almost certainly not going to work right.
|
222
214
|
|
223
215
|
# Enters the specified folder/filename value into
|
@@ -254,48 +246,29 @@ class EditFileDetails < ResourcesBase
|
|
254
246
|
|
255
247
|
# Clicks the Update button, then instantiates
|
256
248
|
# the Resources page class.
|
257
|
-
|
258
|
-
frm.button(:value=>"Update").click
|
259
|
-
Resources.new(@browser)
|
260
|
-
end
|
249
|
+
action(:update) { |b| b.frm.button(:value=>"Update").click }
|
261
250
|
|
262
251
|
# Enters the specified string into the title field.
|
263
|
-
|
264
|
-
frm.text_field(:id=>"displayName_0").set(title)
|
265
|
-
end
|
252
|
+
element(:title) { b.frm.text_field(:id=>"displayName_0") }
|
266
253
|
|
267
254
|
# Enters the specified string into the description field.
|
268
|
-
|
269
|
-
frm.text_field(:id=>"description_0").set(description)
|
270
|
-
end
|
255
|
+
element(:description) { |b| b.frm.text_field(:id=>"description_0") }
|
271
256
|
|
272
|
-
|
273
|
-
def select_publicly_viewable
|
274
|
-
frm.radio(:id=>"access_mode_public_0").set
|
275
|
-
end
|
257
|
+
element(:publicly_viewable) { |b| b.frm.radio(:id=>"access_mode_public_0") }
|
276
258
|
|
277
|
-
|
278
|
-
# condition.
|
279
|
-
def check_show_only_if_condition
|
280
|
-
frm.checkbox(:id=>"cbCondition_0")
|
281
|
-
end
|
259
|
+
element(:show_only_if_condition) { |b| b.frm.checkbox(:id=>"cbCondition_0") }
|
282
260
|
|
283
261
|
# Selects the specified Gradebook item value in the
|
284
262
|
# select list.
|
285
|
-
|
286
|
-
frm.select(:id=>"selectResource_0").select(item)
|
287
|
-
end
|
263
|
+
element(:gradebook_item) { |b| b.frm.select(:id=>"selectResource_0") }
|
288
264
|
|
289
265
|
# Selects the specified value in the item condition
|
290
266
|
# field.
|
291
|
-
|
292
|
-
frm.select(:id=>"selectCondition_0").select(condition)
|
293
|
-
end
|
267
|
+
element(:item_condition) { |b| b.frm.select(:id=>"selectCondition_0") }
|
294
268
|
|
295
269
|
# Sets the Grade field to the specified value.
|
296
|
-
|
297
|
-
|
298
|
-
end
|
270
|
+
element(:assignment_grade) { |b| b.frm.text_field(:id=>"assignment_grade_0") }
|
271
|
+
|
299
272
|
end
|
300
273
|
|
301
274
|
class CreateFolders < ResourcesBase
|
@@ -0,0 +1 @@
|
|
1
|
+
# Work to be done here.
|
@@ -7,10 +7,7 @@ class Roster < BasePage
|
|
7
7
|
|
8
8
|
frame_element
|
9
9
|
|
10
|
-
|
11
|
-
frm.button(:value=>"Find").click
|
12
|
-
Roster.new @browser
|
13
|
-
end
|
10
|
+
button("Find")
|
14
11
|
|
15
12
|
def names
|
16
13
|
list = []
|
@@ -25,11 +22,7 @@ class Roster < BasePage
|
|
25
22
|
# Then instantiates the RosterProfileView class.
|
26
23
|
# Note that it expects an exact match for the name string, otherwise
|
27
24
|
# the script will error out.
|
28
|
-
|
29
|
-
frm.link(:text=>name).click
|
30
|
-
RosterProfileView.new @browser
|
31
|
-
end
|
32
|
-
|
25
|
+
action(:view) { |name, b| b.frm.link(:text=>name).click }
|
33
26
|
|
34
27
|
element(:name_or_id) { |b| b.frm.text_field(:id=>"roster_form:search") }
|
35
28
|
|
@@ -40,10 +33,7 @@ class RosterProfileView < BasePage
|
|
40
33
|
|
41
34
|
frame_element
|
42
35
|
|
43
|
-
|
44
|
-
frm.button(:value=>"Back").click
|
45
|
-
Roster.new(@browser)
|
46
|
-
end
|
36
|
+
button("Back")
|
47
37
|
|
48
38
|
# Returns a hash containing the contents of the Public Information
|
49
39
|
# table on the page, with the keys being the row headers and the values
|
@@ -23,12 +23,8 @@ class Rwiki < RwikiBase
|
|
23
23
|
action(:save) { |b| b.frm.button(text: "Save").click }
|
24
24
|
action(:cancel) { |b| b.frm.button(text: "Cancel").click }
|
25
25
|
|
26
|
-
|
27
|
-
frm.link(:text=>title).click
|
28
|
-
end
|
26
|
+
action(:open_wiki) { |title, b| b.frm.link(:text=>title).click }
|
29
27
|
|
30
|
-
|
31
|
-
frm.link(:text=>title).href
|
32
|
-
end
|
28
|
+
action(:wiki_href) { |title, b| b.frm.link(:text=>title).href }
|
33
29
|
|
34
30
|
end
|
@@ -7,7 +7,7 @@ class Search < BasePage
|
|
7
7
|
|
8
8
|
frame_element
|
9
9
|
|
10
|
-
|
10
|
+
link "Admin"
|
11
11
|
element(:search_field) { |b| b.frm.text_field(:id=>"search") }
|
12
12
|
action(:search_button) { |b| b.frm.button(:name=>"sb").click }
|
13
13
|
element(:this_site) { |b| b.frm.radio(:id=>"searchSite") }
|
@@ -21,14 +21,14 @@ class SearchAdmin < BasePage
|
|
21
21
|
|
22
22
|
frame_element
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
link "Search"
|
25
|
+
link "Rebuild Site Index"
|
26
|
+
link "Refresh Site Index"
|
27
|
+
link "Rebuild Whole Index"
|
28
|
+
link "Refresh Whole Index"
|
29
|
+
link "Remove Lock"
|
30
|
+
link "Reload Index"
|
31
|
+
link "Enable Diagnostics"
|
32
|
+
link "Disable Diagnostics"
|
33
33
|
|
34
34
|
end
|
@@ -9,12 +9,10 @@ class SectionsBase < BasePage
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
def menu_elements
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
action(:student_memberships) { |b| b.frm.link(:text=>"Student Memberships").click }
|
17
|
-
action(:options) { |b| b.frm.link(:text=>"Options").click }
|
12
|
+
link("Add Sections")
|
13
|
+
link("Overview")
|
14
|
+
link("Student Memberships")
|
15
|
+
link("Options")
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -26,24 +24,13 @@ class Sections < SectionsBase
|
|
26
24
|
|
27
25
|
# Clicks the Edit link for the specified section.
|
28
26
|
# Then instantiates the AddEditSections class.
|
29
|
-
|
30
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Edit/).click
|
31
|
-
AddEditSections.new(@browser)
|
32
|
-
end
|
27
|
+
action(:edit) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Edit/).click }
|
33
28
|
|
34
|
-
|
35
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign TAs/).click
|
36
|
-
AssignTeachingAssistants.new(@browser)
|
37
|
-
end
|
29
|
+
action(:assign_tas) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign TAs/).click }
|
38
30
|
|
39
|
-
|
40
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign Students/).click
|
41
|
-
AssignStudents.new(@browser)
|
42
|
-
end
|
31
|
+
action(:assign_students) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign Students/).click }
|
43
32
|
|
44
|
-
|
45
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>/remove/).set
|
46
|
-
end
|
33
|
+
action(:check) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>/remove/).set }
|
47
34
|
|
48
35
|
def section_names
|
49
36
|
names = []
|
@@ -55,49 +42,30 @@ class Sections < SectionsBase
|
|
55
42
|
return names
|
56
43
|
end
|
57
44
|
|
58
|
-
|
59
|
-
frm.button(:value=>"Remove Sections").click
|
60
|
-
Sections.new(@browser)
|
61
|
-
end
|
45
|
+
button("Remove Sections")
|
62
46
|
|
63
47
|
# Returns the text of the Teach Assistant cell for the specified
|
64
48
|
# Section.
|
65
|
-
|
66
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[1].text
|
67
|
-
end
|
49
|
+
action(:tas_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[1].text }
|
68
50
|
|
69
51
|
#
|
70
|
-
|
71
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[2].text
|
72
|
-
end
|
52
|
+
action(:days_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[2].text }
|
73
53
|
|
74
54
|
#
|
75
|
-
|
76
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[3].text
|
77
|
-
end
|
55
|
+
action(:time_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[3].text }
|
78
56
|
|
79
57
|
#
|
80
|
-
|
81
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[4].text
|
82
|
-
end
|
58
|
+
action(:location_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[4].text }
|
83
59
|
|
84
60
|
#
|
85
|
-
|
86
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[5].text
|
87
|
-
end
|
61
|
+
action(:current_size_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[5].text }
|
88
62
|
|
89
63
|
#
|
90
|
-
|
91
|
-
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[6].text
|
92
|
-
end
|
64
|
+
action(:availability_for) { |title, b| b.frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[6].text }
|
93
65
|
|
94
|
-
|
95
|
-
frm.div(:class=>"validation").text
|
96
|
-
end
|
66
|
+
value(:alert_text) { |b| b.frm.div(:class=>"validation").text }
|
97
67
|
|
98
|
-
|
99
|
-
frm.div(:class=>"success").text
|
100
|
-
end
|
68
|
+
value(:success_text) { |b| b.frm.div(:class=>"success").text }
|
101
69
|
|
102
70
|
end
|
103
71
|
|
@@ -111,14 +79,7 @@ class AddEditSections < SectionsBase
|
|
111
79
|
menu_elements
|
112
80
|
|
113
81
|
# The Update button is only available when editing an existing Sections record.
|
114
|
-
|
115
|
-
frm.button(:value=>"Update").click
|
116
|
-
if frm.div(:class=>"validation").exist?
|
117
|
-
AddEditSections.new(@browser)
|
118
|
-
else
|
119
|
-
Sections.new(@browser)
|
120
|
-
end
|
121
|
-
end
|
82
|
+
button("Update")
|
122
83
|
|
123
84
|
# This method takes an array object containing strings of the
|
124
85
|
# days of the week and then clicks the appropriate checkboxes, based
|
@@ -155,41 +116,39 @@ class AddEditSections < SectionsBase
|
|
155
116
|
|
156
117
|
end
|
157
118
|
|
158
|
-
|
159
|
-
class AssignTeachingAssistants < SectionsBase
|
119
|
+
class AssignBase < SectionsBase
|
160
120
|
|
161
121
|
menu_elements
|
162
122
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
123
|
+
class << self
|
124
|
+
def assign_elements
|
125
|
+
element(:available_tas) { |b| b.frm.select(:id=>"memberForm:availableUsers") }
|
126
|
+
element(:assigned_tas) { |b| b.frm.select(:id=>"memberForm:selectedUsers") }
|
127
|
+
action(:assign) { |b| b.frm.button(:value=>">").click }
|
128
|
+
action(:unassign) { |b| b.frm.button(:value=>"<").click }
|
129
|
+
action(:assign_all) { |b| b.frm.button(:value=>">>").click }
|
130
|
+
action(:unassign_all) { |b| b.frm.button(:value=>"<<").click }
|
131
|
+
end
|
167
132
|
|
168
|
-
|
169
|
-
element(:assigned_tas) { |b| b.frm.select(:id=>"memberForm:selectedUsers") }
|
170
|
-
action(:assign) { |b| b.frm.button(:value=>">").click }
|
171
|
-
action(:unassign) { |b| b.frm.button(:value=>"<").click }
|
172
|
-
action(:assign_all) { |b| b.frm.button(:value=>">>").click }
|
173
|
-
action(:unassign_all) { |b| b.frm.button(:value=>"<<").click }
|
133
|
+
end
|
174
134
|
|
175
135
|
end
|
176
136
|
|
177
137
|
#
|
178
|
-
class
|
138
|
+
class AssignTeachingAssistants < AssignBase
|
179
139
|
|
180
|
-
|
140
|
+
assign_elements
|
181
141
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
142
|
+
button "Assign TAs"
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
class AssignStudents < AssignBase
|
148
|
+
|
149
|
+
assign_elements
|
186
150
|
|
187
|
-
|
188
|
-
element(:assigned_students) { |b| b.frm.select(:id=>"memberForm:selectedUsers") }
|
189
|
-
action(:assign) { |b| b.frm.button(:value=>">").click }
|
190
|
-
action(:unassign) { |b| b.frm.button(:value=>"<").click }
|
191
|
-
action(:assign_all) { |b| b.frm.button(:value=>">>").click }
|
192
|
-
action(:unassign_all) { |b| b.frm.button(:value=>"<<").click }
|
151
|
+
button "Assign students"
|
193
152
|
|
194
153
|
end
|
195
154
|
|