Class: EventObject
- Inherits:
-
Object
- Object
- EventObject
- Includes:
- PageHelper, Utilities, Workflows
- Defined in:
- lib/sakai-cle-test-api/data_objects/event.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#duration_hours ⇒ Object
Returns the value of attribute duration_hours.
-
#duration_minutes ⇒ Object
Returns the value of attribute duration_minutes.
-
#end_hour ⇒ Object
Returns the value of attribute end_hour.
-
#end_meridian ⇒ Object
Returns the value of attribute end_meridian.
-
#end_minute ⇒ Object
Returns the value of attribute end_minute.
-
#link ⇒ Object
Returns the value of attribute link.
-
#message ⇒ Object
Returns the value of attribute message.
-
#month ⇒ Object
Returns the value of attribute month.
-
#site ⇒ Object
Returns the value of attribute site.
-
#start_hour ⇒ Object
Returns the value of attribute start_hour.
-
#start_meridian ⇒ Object
Returns the value of attribute start_meridian.
-
#start_minute ⇒ Object
Returns the value of attribute start_minute.
-
#title ⇒ Object
Returns the value of attribute title.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ EventObject
constructor
A new instance of EventObject.
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 = {}) ⇒ EventObject
Returns a new instance of EventObject.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 11 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :month=>in_15_minutes[:month_str], :day=>in_15_minutes[:day], :year=>in_15_minutes[:year], :start_hour=>in_15_minutes[:hour], :start_minute=>in_15_minutes[:minute], :start_meridian=>in_15_minutes[:meridian], :duration_hours=>nil, :duration_minutes=>nil, :end_hour=>nil, :end_minute=>nil, :end_meridian=>nil, :message=>random_multiline(400,20, :alpha), :site=>"placeholder" } = defaults.merge(opts) @title=[:title] @month=[:month] @day=[:day] @year=[:year] @start_hour=[:start_hour] @start_minute=[:start_minute] @start_meridian=[:start_meridian] @duration_hours=[:duration_hours] @duration_minutes=[:duration_minutes] @end_hour=[:end_hour] @end_minute=[:end_minute] @end_meridian=[:end_meridian] @message=[:message] @site=[:site] end |
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def day @day end |
#duration_hours ⇒ Object
Returns the value of attribute duration_hours.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def duration_hours @duration_hours end |
#duration_minutes ⇒ Object
Returns the value of attribute duration_minutes.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def duration_minutes @duration_minutes end |
#end_hour ⇒ Object
Returns the value of attribute end_hour.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def end_hour @end_hour end |
#end_meridian ⇒ Object
Returns the value of attribute end_meridian.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def end_meridian @end_meridian end |
#end_minute ⇒ Object
Returns the value of attribute end_minute.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def end_minute @end_minute end |
#link ⇒ Object
Returns the value of attribute link.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def link @link end |
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def @message end |
#month ⇒ Object
Returns the value of attribute month.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def month @month end |
#site ⇒ Object
Returns the value of attribute site.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def site @site end |
#start_hour ⇒ Object
Returns the value of attribute start_hour.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def start_hour @start_hour end |
#start_meridian ⇒ Object
Returns the value of attribute start_meridian.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def start_meridian @start_meridian end |
#start_minute ⇒ Object
Returns the value of attribute start_minute.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def start_minute @start_minute end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def title @title end |
#year ⇒ Object
Returns the value of attribute year.
7 8 9 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 7 def year @year end |
Instance Method Details
#create ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/sakai-cle-test-api/data_objects/event.rb', line 49 def create open_my_site_by_name @site unless @browser.title=~/#{@site}/ calendar unless @browser.title=~/Calendar$/ on Calendar do |cal| cal.add end on AddEditEvent do |add_event| add_event..set @message add_event.title.set @title add_event.month.select @month add_event.day.select @day add_event.year.select @year add_event.start_hour.select @start_hour add_event.start_minute.select @start_minute add_event.start_meridian.select @start_meridian if @end_hour == nil && @duration_hours == nil @duration_hours = add_event.hours.value @duration_minutes = add_event.minutes.value @end_hour = add_event.end_hour.value @end_minute = add_event.end_minute.value @end_meridian = add_event.end_meridian.value elsif @end_hour == nil add_event.hours.select @duration_hours add_event.minutes.select @duration_minutes @end_hour = add_event.end_hour.value @end_minute = add_event.end_minute.value @end_meridian = add_event.end_meridian.value elsif @duration_hours == nil else end add_event.save_event end on Calendar do |cal| @link = cal.event_href @title end end |