Class: MessageObject

Inherits:
Object
  • Object
show all
Includes:
PageHelper, Utilities, Workflows
Defined in:
lib/sakai-cle-test-api/data_objects/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = {}) ⇒ MessageObject

Returns a new instance of MessageObject.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 9

def initialize(browser, opts={})
  @browser = browser

  defaults = {
    :subject=>random_alphanums,
    :recipients=>["All Participants"]
  }
  options = defaults.merge(opts)

  @subject=options[:subject]
  @recipients=options[:recipients]
  @site=options[:site]
  @message=options[:message]
  @label=options[:label]
  raise "You need to specify a site for your web content" if @site==nil
end

Instance Attribute Details

#labelObject

Returns the value of attribute label.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def label
  @label
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def message
  @message
end

#recipientsObject

Returns the value of attribute recipients.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def recipients
  @recipients
end

#send_ccObject

Returns the value of attribute send_cc.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def send_cc
  @send_cc
end

#siteObject

Returns the value of attribute site.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def site
  @site
end

#subjectObject

Returns the value of attribute subject.



7
8
9
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 7

def subject
  @subject
end

Instance Method Details

#createObject Also known as: compose



26
27
28
29
# File 'lib/sakai-cle-test-api/data_objects/message.rb', line 26

def create
  open_my_site_by_name @site unless @browser.title=~/#{@site}/
  messages unless @browser.title=~/Messages$/
end