Class: AssessmentObject
- Inherits:
-
Object
- Object
- AssessmentObject
- Includes:
- PageHelper, Utilities, Workflows
- Defined in:
- lib/sakai-cle-test-api/data_objects/assessment.rb
Instance Attribute Summary collapse
-
#site ⇒ Object
Returns the value of attribute site.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ AssessmentObject
constructor
A new instance of AssessmentObject.
Methods included from Workflows
menu_link, #open_my_site_by_name
Methods included from Utilities
#current_hour, #current_month, #current_year, #get_filename, #in_15_minutes, #last_hour, #last_month, #last_year, #make, #make_date, #next_hour, #next_month, #next_year, #on_page, #random_alphanums, #random_alphanums_plus, #random_email, #random_high_ascii, #random_letters, #random_multiline, #random_nicelink, #random_string, #random_xss_string, #tomorrow, #yesterday
Methods included from PageHelper
#make, #on, #visit, #wait_until
Constructor Details
#initialize(browser, opts = {}) ⇒ AssessmentObject
Returns a new instance of AssessmentObject.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sakai-cle-test-api/data_objects/assessment.rb', line 9 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :site=>"placeholder" } = defaults.merge(opts) @title=[:title] @site=[:site] raise "You must specify a Site for your Assessment" if @site==nil end |
Instance Attribute Details
#site ⇒ Object
Returns the value of attribute site.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/assessment.rb', line 7 def site @site end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/assessment.rb', line 7 def title @title end |
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/sakai-cle-test-api/data_objects/assessment.rb', line 22 def create my_workspace.open_my_site_by_name @site unless @browser.title=~/#{@site}/ tests_and_quizzes unless @browser.title=~/Tests & Quizzes$/ on_page AssessmentsList do |page| page.title.set @title page.create end # Do more here eventually... end |