Module: AssignmentAddMethods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/assignments.rb

Overview

The page where you create a new assignment

Instance Method Summary collapse

Instance Method Details

#add_attachmentsObject

Clicks the Add Attachments button, then instantiates the AssignmentAttachments page class.



201
202
203
204
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 201

def add_attachments
  frm.button(:value=>"Add Attachments").click
  AssignmentAttachments.new(@browser)
end

#alert_textObject

Grabs the text contained in the alert box when it is present on the page (will throw an error if called when the box is not present).



175
176
177
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 175

def alert_text
  frm.div(:class=>"portletBody").div(:class=>"alertMessage").text
end

#cancelObject

Clicks the Cancel button, then instantiates the AssignmentsList page class.



160
161
162
163
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 160

def cancel
  frm.button(:value=>"Cancel", :index=>-1).click
  AssignmentsList.new(@browser)
end

#gradebook_warningObject

This is the warning message that appears when you select to add an assignment to the gradebook.



195
196
197
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 195

def gradebook_warning
  frm.div(:class, "portletBody").span(:id, "gradebookListWarnAssoc")
end

#instructions=(instructions) ⇒ Object

Sends the specified text to the text box in the FCKEditor on the page.



181
182
183
184
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 181

def instructions=(instructions)
  frm.frame(:id, "new_assignment_instructions___Frame").td(:id, "xEditingArea").frame(:index=>0).wait_until_present
  frm.frame(:id, "new_assignment_instructions___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(instructions)
end

#postObject

Clicks the Post button, then instantiates the AssignmentsList page class.



153
154
155
156
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 153

def post
  frm.button(:value=>"Post").click
  AssignmentsList.new(@browser)
end

#previewObject

Clicks the Preview button, then instantiates the AssignmentsPreview page class.



188
189
190
191
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 188

def preview
  frm.button(:value=>"Preview").click
  AssignmentsPreview.new(@browser)
end

#save_draftObject

Clicks the Save Draft button, then instantiates the AssignmentsList page class.



167
168
169
170
# File 'lib/kuali-sakai-common-lib/assignments.rb', line 167

def save_draft
  frm.button(:name=>"save").click
  AssignmentsList.new(@browser)
end