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.
Files changed (90) hide show
  1. data/README.md +4 -0
  2. data/lib/sambal-cle/base_page.rb +20 -0
  3. data/lib/sambal-cle/core-ext.rb +90 -0
  4. data/lib/sambal-cle/data_objects/announcement.rb +82 -0
  5. data/lib/sambal-cle/data_objects/assessment.rb +32 -0
  6. data/lib/sambal-cle/data_objects/assignment.rb +205 -0
  7. data/lib/sambal-cle/data_objects/blog.rb +46 -0
  8. data/lib/sambal-cle/data_objects/blogger.rb +49 -0
  9. data/lib/sambal-cle/data_objects/chat_room.rb +54 -0
  10. data/lib/sambal-cle/data_objects/event.rb +89 -0
  11. data/lib/sambal-cle/data_objects/forum.rb +212 -0
  12. data/lib/sambal-cle/data_objects/lesson.rb +185 -0
  13. data/lib/sambal-cle/data_objects/message.rb +57 -0
  14. data/lib/sambal-cle/data_objects/poll.rb +74 -0
  15. data/lib/sambal-cle/data_objects/resource.rb +209 -0
  16. data/lib/sambal-cle/data_objects/site.rb +295 -0
  17. data/lib/sambal-cle/data_objects/syllabus.rb +73 -0
  18. data/lib/sambal-cle/data_objects/web_content_tool.rb +51 -0
  19. data/lib/sambal-cle/data_objects/wiki.rb +63 -0
  20. data/lib/sambal-cle/date_makers.rb +118 -0
  21. data/lib/sambal-cle/gem_ext.rb +23 -0
  22. data/lib/sambal-cle/page_helper.rb +22 -0
  23. data/lib/sambal-cle/page_maker.rb +48 -0
  24. data/lib/sambal-cle/page_objects/account.rb +111 -0
  25. data/lib/sambal-cle/page_objects/aliases.rb +43 -0
  26. data/lib/sambal-cle/page_objects/announcements.rb +190 -0
  27. data/lib/sambal-cle/page_objects/assessments.rb +874 -0
  28. data/lib/sambal-cle/page_objects/assignments.rb +770 -0
  29. data/lib/sambal-cle/page_objects/basic_lti.rb +6 -0
  30. data/lib/sambal-cle/page_objects/blogger.rb +205 -0
  31. data/lib/sambal-cle/page_objects/blogs.rb +60 -0
  32. data/lib/sambal-cle/page_objects/calendar.rb +330 -0
  33. data/lib/sambal-cle/page_objects/calendar_summary.rb +1 -0
  34. data/lib/sambal-cle/page_objects/chat_room.rb +22 -0
  35. data/lib/sambal-cle/page_objects/drop_box.rb +9 -0
  36. data/lib/sambal-cle/page_objects/email_archive.rb +22 -0
  37. data/lib/sambal-cle/page_objects/entity_picker.rb +62 -0
  38. data/lib/sambal-cle/page_objects/evaluations.rb +158 -0
  39. data/lib/sambal-cle/page_objects/feedback.rb +36 -0
  40. data/lib/sambal-cle/page_objects/forms.rb +120 -0
  41. data/lib/sambal-cle/page_objects/forums.rb +254 -0
  42. data/lib/sambal-cle/page_objects/glossary.rb +117 -0
  43. data/lib/sambal-cle/page_objects/gradebook.rb +29 -0
  44. data/lib/sambal-cle/page_objects/gradebook2.rb +17 -0
  45. data/lib/sambal-cle/page_objects/home.rb +36 -0
  46. data/lib/sambal-cle/page_objects/jforums.rb +444 -0
  47. data/lib/sambal-cle/page_objects/job_scheduler.rb +121 -0
  48. data/lib/sambal-cle/page_objects/lessons.rb +361 -0
  49. data/lib/sambal-cle/page_objects/login.rb +28 -0
  50. data/lib/sambal-cle/page_objects/matrix.rb +241 -0
  51. data/lib/sambal-cle/page_objects/media_gallery.rb +13 -0
  52. data/lib/sambal-cle/page_objects/messages.rb +622 -0
  53. data/lib/sambal-cle/page_objects/my_workspace.rb +44 -0
  54. data/lib/sambal-cle/page_objects/news.rb +8 -0
  55. data/lib/sambal-cle/page_objects/podcasts.rb +27 -0
  56. data/lib/sambal-cle/page_objects/polls.rb +69 -0
  57. data/lib/sambal-cle/page_objects/portfolio_templates.rb +161 -0
  58. data/lib/sambal-cle/page_objects/portfolios.rb +162 -0
  59. data/lib/sambal-cle/page_objects/post_em.rb +1 -0
  60. data/lib/sambal-cle/page_objects/profile.rb +51 -0
  61. data/lib/sambal-cle/page_objects/profile2.rb +344 -0
  62. data/lib/sambal-cle/page_objects/public_search.rb +61 -0
  63. data/lib/sambal-cle/page_objects/realms.rb +19 -0
  64. data/lib/sambal-cle/page_objects/resources.rb +326 -0
  65. data/lib/sambal-cle/page_objects/resources_roster.rb +0 -0
  66. data/lib/sambal-cle/page_objects/rosters.rb +70 -0
  67. data/lib/sambal-cle/page_objects/rwiki.rb +34 -0
  68. data/lib/sambal-cle/page_objects/search.rb +34 -0
  69. data/lib/sambal-cle/page_objects/sections.rb +295 -0
  70. data/lib/sambal-cle/page_objects/single_user.rb +1 -0
  71. data/lib/sambal-cle/page_objects/site_setup.rb +621 -0
  72. data/lib/sambal-cle/page_objects/site_statistics.rb +1 -0
  73. data/lib/sambal-cle/page_objects/sites.rb +255 -0
  74. data/lib/sambal-cle/page_objects/styles.rb +74 -0
  75. data/lib/sambal-cle/page_objects/syllabus.rb +166 -0
  76. data/lib/sambal-cle/page_objects/user_membership.rb +57 -0
  77. data/lib/sambal-cle/page_objects/users.rb +88 -0
  78. data/lib/sambal-cle/randomizers.rb +117 -0
  79. data/lib/sambal-cle/rich_text.rb +38 -0
  80. data/lib/sambal-cle/utilities.rb +31 -0
  81. data/lib/sambal-cle/workflows.rb +223 -0
  82. data/lib/sambal-cle.rb +31 -0
  83. data/sambal-cle.gemspec +14 -0
  84. data/test/add_assignment_to_calendar_spec.rb +86 -0
  85. data/test/assignment_announcements_spec.rb +71 -0
  86. data/test/assignment_gradebook_spec.rb +98 -0
  87. data/test/config.yml.template +4 -0
  88. data/test/directory.yml.template +123 -0
  89. data/test/duplicate_site_spec.rb +244 -0
  90. metadata +167 -0
@@ -0,0 +1,6 @@
1
+ #
2
+ class BasicLTI < BasePage
3
+
4
+ frame_element
5
+
6
+ end
@@ -0,0 +1,205 @@
1
+ #================
2
+ # Blogger Pages
3
+ #================
4
+
5
+ # The top page of a Site's Blogger feature.
6
+ class Blogger < BasePage
7
+
8
+ frame_element
9
+
10
+ # Clicks the View All button, then reinstantiates the Class.
11
+ def view_all
12
+ frm.link(:text=>"View all").click
13
+ Blogger.new(@browser)
14
+ end
15
+
16
+ # Clicks the View Members Blog link, then instantiates the
17
+ # ViewMembersBlog Class.
18
+ def view_members_blog
19
+ frm.link(:text=>"View member's blog").click
20
+ ViewMembersBlog.new(@browser)
21
+ end
22
+
23
+ # Returns true if the specified post title exists in the list. Otherwise returns false.
24
+ def post_private?(post_title)
25
+ frm.table(:class=>"tableHeader").row(:text=>/#{Regexp.escape(post_title)}/).image(:alt=>"p").exist?
26
+ end
27
+
28
+ # Clicks the Create New Post link and instantiates the CreateBloggerPost Class.
29
+ def create_new_post
30
+ frm.link(:text=>"Create new post").click
31
+ CreateBloggerPost.new(@browser)
32
+ end
33
+ # Clicks on the specified post title, then instantiates
34
+ # the ViewBloggerPost Class.
35
+ def open_post(post_title)
36
+ frm.link(:text=>post_title).click
37
+ ViewBloggerPost.new(@browser)
38
+ end
39
+
40
+ # Returns an array containing the displayed post titles (as string objects).
41
+ def post_titles
42
+ titles = []
43
+ if frm.table(:class=>"tableHeader").exist?
44
+ table = frm.table(:class=>"tableHeader")
45
+ table.rows.each do |row|
46
+ if row.link(:class=>"aTitleHeader").exist?
47
+ titles << row.link(:class=>"aTitleHeader").text
48
+ end
49
+ end
50
+ end
51
+ return titles
52
+ end
53
+
54
+ element(:search_field) { |b| b.frm.text_field(:id=>"_id1:idSearch") }
55
+ element(:show_comments) { |b| b.frm.checkbox(:id=>"_id1:showComments") }
56
+ element(:show_full_content) { |b| b.frm.checkbox(:id=>"_id1:showFullContent") }
57
+
58
+ end
59
+
60
+ # The page showing contents of a user's Blog.
61
+ class ViewMembersBlog < BasePage
62
+
63
+ frame_element
64
+
65
+ # Clicks on the member name specified.
66
+ # The name string obviously needs to match the
67
+ # text of the link exactly.
68
+ def member(name)
69
+ frm.link(:text=>name).click
70
+ Blogger.new(@browser)
71
+ end
72
+
73
+ end
74
+
75
+ # The page where users create a Post for their Blogger blog.
76
+ class CreateBloggerPost < BasePage
77
+
78
+ frame_element
79
+
80
+ # Enters the specified string into the FCKEditor for the Abstract.
81
+ def abstract=(text)
82
+ frm.frame(:id, "PostForm:shortTextBox_inputRichText___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
83
+ end
84
+
85
+ # Enters the specified string into the FCKEditor for the Text of the Blog.
86
+ def text=(text)
87
+ frm().frame(:id, "PostForm:tab0:main_text_inputRichText___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
88
+ end
89
+
90
+ # Clicks the Add to document button in the text
91
+ # tab.
92
+ def add_text_to_document
93
+ frm.div(:id=>"PostForm:tab0").button(:value=>"Add to document").click
94
+ end
95
+
96
+ # Clicks the Add to Document button on the Image tab.
97
+ #
98
+ # This method will fail if the image tab is not the currently selected tab.
99
+ def add_image_to_document
100
+ frm.div(:id=>"PostForm:tab1").button(:value=>"Add to document").click
101
+ end
102
+
103
+ # Clicks the Add to Document button on the Link tab.
104
+ #
105
+ # This method will fail if the Link tab is not the currently selected tab.
106
+ def add_link_to_document
107
+ frm.div(:id=>"PostForm:tab2").button(:value=>"Add to document").click
108
+ end
109
+
110
+ # Clicks the Add to Document button on the File tab.
111
+ #
112
+ # This method will fail if the File tab is not the currently selected tab.
113
+ def add_file_to_document
114
+ frm.div(:id=>"PostForm:tab3").button(:value=>"Add to document").click
115
+ end
116
+
117
+ # Enters the specified filename in the file field for images.
118
+ #
119
+ # The file path can be entered as an optional second parameter.
120
+ def image_file(filename, filepath="")
121
+ frm.file_field(:name=>"PostForm:tab1:_id29").set(filepath + filename)
122
+ end
123
+
124
+ # Enters the specified directory/filename in the file field.
125
+ def file_field(filename, filepath="")
126
+ frm().file_field(:name=>"PostForm:tab3:_id51").set(filepath + filename)
127
+ end
128
+
129
+ # Clicks the Preview button and instantiates the PreviewBloggerPost Class.
130
+ def preview
131
+ frm().button(:value=>"Preview").click
132
+ PreviewBloggerPost.new(@browser)
133
+ end
134
+
135
+ # Clicks the Save button and instantiates the Blogger Class.
136
+ def save
137
+ frm.button(:value=>"Save").click
138
+ Blogger.new(@browser)
139
+ end
140
+
141
+ element(:title) { |b| b.frm.text_field(:id=>"PostForm:idTitle") }
142
+ element(:keywords) { |b| b.frm.text_field(:id=>"PostForm:keyWords") }
143
+ element(:access) { |b| b.frm.select(:id=>"PostForm:selectVisibility") }
144
+ element(:read_only) { |b| b.frm.checkbox(:id=>"PostForm:readOnlyCheckBox") }
145
+ element(:allow_comments) { |b| b.frm.checkbox(:id=>"PostForm:allowCommentsCheckBox") }
146
+ action(:text) { |b| b.frm.button(:value=>"Text").click }
147
+ action(:images) { |b| b.frm.button(:value=>"Images").click }
148
+ action(:links) { |b| b.frm.button(:value=>"Links").click }
149
+ element(:description) { |b| b.frm.text_field(:id=>"PostForm:tab2:idLinkDescription") }
150
+ element(:url) { |b| b.frm.text_field(:id=>"PostForm:tab2:idLinkExpression") }
151
+ action(:files) { |b| b.frm.button(:value=>"Files").click }
152
+
153
+ end
154
+
155
+ # The Preview page for a Blog post.
156
+ class PreviewBloggerPost < BasePage
157
+
158
+ frame_element
159
+
160
+ # Clicks the Back button and instantiates the CreateBloggerPost Class.
161
+ def back
162
+ frm().button(:value=>"Back").click
163
+ CreateBloggerPost.new(@browser)
164
+ end
165
+
166
+ # Clicks the Save button and instantiates the CreateBloggerPost Class.
167
+ def save
168
+ frm.button(:value=>"Save").click
169
+ CreateBloggerPost.new(@browser)
170
+ end
171
+
172
+ end
173
+
174
+ # The page for Viewing a blog post.
175
+ class ViewBloggerPost < BasePage
176
+
177
+ frame_element
178
+
179
+ # Clicks the button for adding a comment to a blog post, then
180
+ # instantiates the AddBloggerComment Class.
181
+ def add_comment
182
+ frm.button(:value=>"Add comment").click
183
+ AddBloggerComment.new(@browser)
184
+ end
185
+
186
+ end
187
+
188
+ # The page for adding a comment to a Blog post.
189
+ class AddBloggerComment < BasePage
190
+
191
+ frame_element
192
+
193
+ # Clicks the Save button and instantiates
194
+ # The ViewBloggerPost Class.
195
+ def save
196
+ frm.button(:value=>"Save").click
197
+ ViewBloggerPost.new(@browser)
198
+ end
199
+
200
+ # Enters the specified string into the FCKEditor box for the Comment.
201
+ def your_comment=(text)
202
+ frm.frame(:id, "_id1:_id11_inputRichText___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
203
+ end
204
+
205
+ end
@@ -0,0 +1,60 @@
1
+ class BlogsBase < BasePage
2
+
3
+ frame_element
4
+
5
+ class << self
6
+ def menu_elements
7
+ # AddBlogEntry
8
+ action(:add_blog_entry) { |b| b.frm.link(:text=>"Add blog entry").click }
9
+ end
10
+ end
11
+ end
12
+
13
+ class Blogs < BlogsBase
14
+
15
+ menu_elements
16
+
17
+ # Returns an array containing the list of Bloggers
18
+ # in the "All the blogs" table.
19
+ def blogger_list
20
+ bloggers = []
21
+ frm.table(:class=>"listHier lines").rows.each do |row|
22
+ bloggers << row[1].text
23
+ end
24
+ bloggers.delete_at(0)
25
+ return bloggers
26
+ end
27
+ end
28
+
29
+ class AddBlogEntry < BlogsBase
30
+
31
+ menu_elements
32
+
33
+ include FCKEditor
34
+
35
+ expected_element :editor
36
+
37
+ element(:editor) { |b| b.frm.frame(:id, "blog-text-input:1:input___Frame") }
38
+
39
+ def blog_text=(text)
40
+ editor.td(:id, "xEditingArea").frame(:index=>0).wait_until_present
41
+ editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
42
+ end
43
+
44
+ # BlogsList
45
+ action(:publish_entry) { |b| b.frm.button(:value=>"Publish entry").click }
46
+ # BlogsList
47
+ action(:save_draft){ |b| b.frm.button(:value=>"Save Draft").click }
48
+
49
+ element(:title) { |b| b.frm.text_field(:name=>"title-input") }
50
+ element(:only_site_admins) { |b| b.frm.radio(:id=>"instructors-only-radio") }
51
+ element(:all_members) { |b| b.frm.radio(:id=>"all-members-radio") }
52
+ element(:publicly_viewable) { |b| b.frm.radio(:id=>"public-viewable-radio") }
53
+
54
+ end
55
+
56
+ class BlogsList < BlogsBase
57
+
58
+ menu_elements
59
+
60
+ end
@@ -0,0 +1,330 @@
1
+ class CalendarBase < BasePage
2
+
3
+ frame_element
4
+ basic_page_elements
5
+
6
+ class << self
7
+ def menu_elements
8
+ # AddEditEvent
9
+ action(:add_event) { |b| b.frm.link(:text=>"Add").click }
10
+
11
+ # AddEditFields
12
+ action(:fields) { |b| b.frm.link(:text=>"Fields").click }
13
+
14
+ # ImportStepOne
15
+ action(:import) { |b| b.frm.link(:text=>"Import").click }
16
+
17
+ #TODO: Finish adding menu buttons here
18
+ end
19
+ end
20
+
21
+ end
22
+
23
+ # Top page of the Calendar
24
+ # For now it includes all views, though that probably
25
+ # means it will have to be re-instantiated every time
26
+ # a new view is selected.
27
+ class Calendar < CalendarBase
28
+
29
+ menu_elements
30
+
31
+ # Selects the specified item in the View select list.
32
+ element(:view) { |b| b.frm.select(:id=>"view") }
33
+
34
+ # Selects the specified item in the Show select list.
35
+ element(:show) { |b| b.frm.select(:id=>"timeFilterOption") }
36
+ alias :show_events :show
37
+
38
+ # Clicks the link to the specified event, then
39
+ # instantiates the EventDetail class.
40
+ def open_event(title)
41
+ truncated = title[0..5]
42
+ frm.link(:text=>/#{Regexp.escape(truncated)}/).click
43
+ end
44
+
45
+ # Returns the href value of the target link
46
+ # use for validation when you are testing whether the link
47
+ # will appear again on another screen, since often times
48
+ # validation by title text alone will not work.
49
+ def event_href(title)
50
+ truncated = title[0..5]
51
+ frm.link(:text=>/#{Regexp.escape(truncated)}/).href
52
+ end
53
+
54
+ # Selects the specified value in the start month select list.
55
+ element(:start_month) { |b| b.frm.select(:id=>"customStartMonth") }
56
+
57
+ # Selects the specified value in the start day select list.
58
+ element(:start_day) { |b| b.frm.select(:id=>"customStartDay") }
59
+
60
+ # Selects the specified value in the start year select list.
61
+ element(:start_year) { |b| b.frm.select(:id=>"customStartYear") }
62
+
63
+ # Selects the specified value in the end month select list.
64
+ element(:end_month) { |b| b.frm.select(:id=>"customEndMonth") }
65
+
66
+ # Selects the specified value in the End Day select list.
67
+ element(:end_day) { |b| b.frm.select(:id=>"customEndDay") }
68
+
69
+ # Selects the specified value in the End Year select list.
70
+ element(:end_year) { |b| b.frm.select(:id=>"customEndYear") }
71
+
72
+ # Clicks the Filter Events button, then re-instantiates
73
+ # the Calendar class to avoid the possibility of an
74
+ # ObsoleteElement error.
75
+ action(:filter_events) { |b| b.frm.button(:name=>"eventSubmit_doCustomdate").click }
76
+
77
+ # Clicks the Go to Today button, then reinstantiates
78
+ # the Calendar class.
79
+ action(:go_to_today) { |b| b.frm.button(:value=>"Go to Today").click }
80
+
81
+ # Returns an array for the listed events.
82
+ # This array contains more than simply strings of the event titles, because
83
+ # often the titles are truncated to fit on the screen. In addition, getting the "title"
84
+ # tag of the link is often problematic because titles can contain double-quotes, which
85
+ # will mess up the HTML of the anchor tag (there is probably an XSS vulnerability to
86
+ # exploit, there. This should be extensively tested.).
87
+ #
88
+ # Because of these issues, the array contains the title tag, the anchor text, and
89
+ # the entire href string for every event listed on the page. Having all three items
90
+ # available should ensure that verification steps don't give false results--especially
91
+ # when you are doing a negative test (checking that an event is NOT present).
92
+ def events_list
93
+ list = {}
94
+ if frm.table(:class=>"calendar").exist?
95
+ events_table = frm.table(:class=>"calendar")
96
+ else
97
+ events_table = frm.table(:class=>"listHier lines nolines")
98
+ end
99
+ events_table.links.each do |link|
100
+ list.store(link.title, {:text=>link.text,
101
+ :href=>link.href,
102
+ :html=>link.html[/(?<="location=").+doDescription/] }
103
+ )
104
+ end
105
+ list
106
+ end
107
+ alias event_list events_list
108
+ alias events event_list
109
+
110
+ # Clicks the "Previous X" button, where X might be Day, Week, or Month,
111
+ # then reinstantiates the Calendar class to ensure against any obsolete element
112
+ # errors.
113
+ action(:previous) { |b| b.frm.button(:name=>"eventSubmit_doPrev").click }
114
+
115
+ # Clicks the "Next X" button, where X might be Day, Week, or Month,
116
+ # then reinstantiates the Calendar class to ensure against any obsolete element
117
+ # errors.
118
+ action(:next) { |b| b.frm.button(:name=>"eventSubmit_doNext").click }
119
+
120
+ # Clicks the "Today" button and reinstantiates the class.
121
+ action(:today) { |b| b.frm.button(:value=>"Today").click }
122
+
123
+ action(:earlier) { |b| b.frm.link(:text=>"Earlier").click }
124
+
125
+ action(:later) { |b| b.frm.link(:text=>"Later").click }
126
+
127
+ # Clicks the "Set as Default View" button
128
+ action(:set_as_default_view) { |b| b.frm.link(:text=>"Set as Default View").click }
129
+
130
+ end
131
+
132
+ # The page that appears when you click on an event in the Calendar
133
+ class EventDetail < CalendarBase
134
+
135
+ menu_elements
136
+ # Clicks the Go to Today button, then instantiates
137
+ # the Calendar class.
138
+ action(:go_to_today) { |b| b.frm.button(:value=>"Go to Today").click }
139
+
140
+ action(:back_to_calendar) { |b| b.frm.button(:value=>"Back to Calendar").click }
141
+
142
+ action(:last_event) { |b| b.frm().button(:value=>"< Last Event").click }
143
+
144
+ action(:next_event) { |b| b.frm().button(:value=>"Next Event >").click }
145
+
146
+ value(:event_title) { |b| b.frm.div(:class=>"portletBody").h3.text }
147
+
148
+ action(:edit) { |b| b.frm.button(:value=>"Edit").click }
149
+
150
+ action(:remove_event) { |b| b.frm.button(:value=>"Remove event").click }
151
+
152
+ # Returns a hash object containing the contents of the event details
153
+ # table on the page, with each of the header column items as a Key
154
+ # and the associated data column as the corresponding Value.
155
+ def details
156
+ details = {}
157
+ frm.table(:class=>"itemSummary").rows.each do |row|
158
+ details.store(row.th.text, row.td.text)
159
+ end
160
+ details
161
+ end
162
+
163
+ value(:message_html) { |b| b.frm.th(text: "Description").parent.td.html }
164
+
165
+ end
166
+
167
+ #
168
+ class AddEditEvent < CalendarBase
169
+
170
+ include FCKEditor
171
+
172
+ menu_elements
173
+
174
+ expected_element :editor
175
+
176
+ # Calendar class
177
+ action(:save_event) { |b| b.frm.button(:value=>"Save Event").click }
178
+
179
+ def message=(text)
180
+ editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
181
+ end
182
+
183
+ # The FCKEditor object. Use this method to set up a "wait_until_present"
184
+ # step, since sometimes it takes a long time for this object to load.
185
+ element(:editor) { |b| b.frm.frame(:id, "description___Frame") }
186
+
187
+ action(:frequency) { |b| b.frm.button(:name=>"eventSubmit_doEditfrequency").click }
188
+
189
+ action(:add_attachments) { |b| b.frm.button(:value=>"Add Attachments").click }
190
+
191
+ action(:add_remove_attachments) { |b| b.frm.button(:value=>"Add/remove attachments").click }
192
+
193
+ # Returns true if the page has a link with the
194
+ # specified file name. Use for test case asserts.
195
+ def attachment?(file_name)
196
+ frm.link(:text=>file_name).exist?
197
+ end
198
+
199
+ # Use this method to enter text into custom fields
200
+ # on the page. The "field" variable is the name of the
201
+ # field, while the "text" is the string you want to put into
202
+ # it.
203
+ def custom_field_text(field, text)
204
+ frm.text_field(:name=>field).set(text)
205
+ end
206
+
207
+ element(:title) { |b| b.frm.text_field(:id=>"activitytitle") }
208
+ element(:month) { |b| b.frm.select(:id=>"month") }
209
+ element(:day) { |b| b.frm.select(:id=>"day") }
210
+ element(:year) { |b| b.frm.select(:id=>"yearSelect") }
211
+ element(:start_hour) { |b| b.frm.select(:id=>"startHour") }
212
+ element(:start_minute) { |b| b.frm.select(:id=>"startMinute") }
213
+ element(:start_meridian) { |b| b.frm.select(:id=>"startAmpm") }
214
+ element(:hours) { |b| b.frm.select(:id=>"duHour") }
215
+ element(:minutes) { |b| b.frm.select(:id=>"duMinute") }
216
+ element(:end_hour) { |b| b.frm.select(:id=>"endHour") }
217
+ element(:end_minute) { |b| b.frm.select(:id=>"endMinute") }
218
+ element(:end_meridian) { |b| b.frm.select(:id=>"endAmpm") }
219
+ element(:display_to_site) { |b| b.frm.radio(:id=>"site") }
220
+ element(:event_type) { |b| b.frm.select(:id=>"eventType") }
221
+ element(:location) { |b| b.frm.text_field(:name=>"location") }
222
+
223
+ end
224
+
225
+ # The page that appears when the Frequency button is clicked on the Add/Edit
226
+ # Event page.
227
+ class EventFrequency < CalendarBase
228
+
229
+ action(:save_frequency) { |b| b.frm.button(:value=>"Save Frequency").click }
230
+
231
+ action(:cancel) { |b| b.frm.button(:value=>"Cancel").click }
232
+
233
+ element(:event_frequency) { |b| b.frm.select(:id=>"frequencySelect") }
234
+ element(:interval) { |b| b.frm.select(:id=>"interval") }
235
+ element(:ends_after) { |b| b.frm.select(:name=>"count") }
236
+ element(:ends_month) { |b| b.frm.select(:id=>"endMonth") }
237
+ element(:ends_day) { |b| b.frm.select(:id=>"endDay") }
238
+ element(:ends_year) { |b| b.frm.select(:id=>"endYear") }
239
+ element(:after) { |b| b.frm.radio(:id=>"count") }
240
+ element(:on) { |b| b.frm.radio(:id=>"till") }
241
+ element(:never) { |b| b.frm.radio(:id=>"never") }
242
+
243
+ end
244
+
245
+ class AddEditFields < CalendarBase
246
+
247
+ # Clicks the Save Field Changes buton and instantiates
248
+ # The Calendar or EventDetail class--unless the Alert Message box appears,
249
+ # in which case it re-instantiates the class.
250
+ action(:save_field_changes) { |b| b.frm.button(:value=>"Save Field Changes").click }
251
+
252
+ action(:create_field) { |b| b.frm.button(:value=>"Create Field").click }
253
+
254
+ # Checks the checkbox for the specified field
255
+ def check_remove(field_name)
256
+ frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(field_name)}/).checkbox.set
257
+ end
258
+
259
+ element(:field_name) { |b| b.frm.text_field(:id=>"textfield") }
260
+
261
+ end
262
+
263
+ class ImportStepOne < BasePage
264
+
265
+ frame_element
266
+
267
+ action(:continue) { |b| b.frm.button(:value=>"Continue").click }
268
+ element(:microsoft_outlook) { |b| b.frm.radio(:id=>"importType_Outlook") }
269
+ element(:meeting_maker) { |b| b.frm.radio(:id=>"importType_MeetingMaker") }
270
+ element(:generic_calendar_import) { |b| b.frm.radio(:id=>"importType_Generic") }
271
+
272
+ end
273
+
274
+ class ImportStepTwo < BasePage
275
+
276
+ frame_element
277
+
278
+ # Goes to ImportStepThree
279
+ action(:continue) { |b| b.frm.button(:value=>"Continue").click }
280
+
281
+ # Enters the specified filename in the file field.
282
+ #
283
+ # Note that the file path is an optional second parameter, if you do not want to
284
+ # include the full path in the filename.
285
+ def import_file(filename, filepath="")
286
+ frm.file_field(:name=>"importFile").set(filepath + filename)
287
+ end
288
+
289
+ end
290
+
291
+ class ImportStepThree < BasePage
292
+
293
+ frame_element
294
+
295
+ expected_element :import_events_for_site
296
+
297
+ # Goes to Calendar
298
+ action(:import_events) { |b| b.frm.button(:value=>"Import Events").click }
299
+
300
+ # Returns an array containing the list of Activity names on the page.
301
+ def events
302
+ list = []
303
+ frm.table(:class=>/listHier lines/).rows.each do |row|
304
+ if row.label(:for=>/eventSelected/).exist?
305
+ list << row.label.text
306
+ end
307
+ end
308
+ names = []
309
+ list.uniq!
310
+ list.each do | item |
311
+ name = item[/(?<=\s).+(?=\s\s\()/]
312
+ names << name
313
+ end
314
+ names
315
+ end
316
+
317
+ # Returns the date of the specified event
318
+ def event_date(event_name)
319
+ frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)[0].text
320
+ end
321
+
322
+ # Unchecks the checkbox for the specified event
323
+ def uncheck_event(event_name)
324
+ frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)
325
+ end
326
+
327
+ element(:import_events_for_site) { |b| b.frm.radio(:id=>"site") }
328
+ element(:import_events_for_selected_groups) { |b| b.frm.radio(:id=>"groups") }
329
+
330
+ end
@@ -0,0 +1 @@
1
+ # Work needs to be done here. :-)
@@ -0,0 +1,22 @@
1
+ #================
2
+ # Chat Room Pages
3
+ #================
4
+
5
+ #
6
+ class ChatRoom < BasePage
7
+
8
+ frame_element
9
+
10
+ value(:total_messages_shown) { |b| b.frame(:class=>"wcwmenu").div(:id=>"chat2_messages_shown_total").text }
11
+
12
+ action(:options) { |b| b.frm.link(text: "Options").click }
13
+
14
+ end
15
+
16
+ class ManageRooms < BasePage
17
+
18
+ frame_element
19
+
20
+ action(:add_room) { |b| b.frm.link(text: "Add Room").click }
21
+
22
+ end
@@ -0,0 +1,9 @@
1
+ #================
2
+ # Drop Box pages
3
+ #================
4
+
5
+ # TODO: See what is needed in this class (and if it's needed at all)
6
+ #class DropBox < ResourcesBase
7
+
8
+
9
+ #end
@@ -0,0 +1,22 @@
1
+ #
2
+ class EmailArchive < BasePage
3
+
4
+ frame_element
5
+
6
+ # EmailArchiveOptions
7
+ action(:options){ |b| b.frm.link(:text=>"Options").click }
8
+
9
+ # Returns an array containing the
10
+ def email_list
11
+ end
12
+
13
+ element(:search_field) { |b| b.frm.text_field(:id=>"search") }
14
+ action(:search_button) { |b| b.frm.button(:value=>"Search").click }
15
+
16
+ end
17
+
18
+ class EmailArchiveOptions < BasePage
19
+
20
+ frame_element
21
+
22
+ end