Class: ProposalLogObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, Navigation, StringFactory
Defined in:
lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Navigation

#doc_search, #fill_out, #fill_out_item, #on_document?, #on_page?, #open_document, #window_cleanup

Methods included from Utilities

#get, #make_role, #make_user, #random_percentage, #set, #snake_case

Constructor Details

#initialize(browser, opts = {}) ⇒ ProposalLogObject

Returns a new instance of ProposalLogObject.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 11

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

  defaults = {
      log_type:               'Permanent',
      proposal_type:          '::random::',
      sponsor_id:             '::random::',
      title:                  random_alphanums,
      lead_unit:              '000001',
  }
  set_options(defaults.merge(opts))
end

Instance Attribute Details

#lead_unitObject

Returns the value of attribute lead_unit.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def lead_unit
  @lead_unit
end

#log_statusObject

Returns the value of attribute log_status.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def log_status
  @log_status
end

#log_typeObject

Returns the value of attribute log_type.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def log_type
  @log_type
end

#numberObject

Returns the value of attribute number.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def number
  @number
end

#principal_investigatorObject

Returns the value of attribute principal_investigator.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def principal_investigator
  @principal_investigator
end

#proposal_typeObject

Returns the value of attribute proposal_type.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def proposal_type
  @proposal_type
end

Returns the value of attribute sponsor_id.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def sponsor_id
  @sponsor_id
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 8

def title
  @title
end

Instance Method Details

#createObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/kuality-coeus/data_objects/proposal_log/proposal_log.rb', line 24

def create
  visit(CentralAdmin).create_proposal_log
  set_principal_investigator
  on ProposalLog do |create|
    create.expand_all
    @number=create.proposal_number.strip
    @log_status=create.proposal_log_status.strip
    create.description.set random_alphanums
    create.proposal_log_type.pick! @log_type
    fill_out create, :proposal_type, :title, :lead_unit
  end
  set_sponsor_code
  on(ProposalLog).blanket_approve
end