Sha256: 8f66e526abaa9daadf025faeb0bfabec9241d8f0be708d6954deca789b59294d

Contents?: true

Size: 1.58 KB

Versions: 9

Compression:

Stored size: 1.58 KB

Contents

Given(/^I have a running auton with one defined step without parameters$/) do
  class EmptyAuton
    include StructureMapper::Hash

    def initialize
    end

    def start
      self.started = true
    end

    attribute started: Boolean
  end

  @auton_type="EmptyAuton"
  @auton_id = Celluloid::Actor[:nestene_core].create_auton(@auton_type, 'empty_auton')
end

When(/^I schedule the step$/) do
  visit '/auton/%s' % @auton_id
  click_on 'schedule_step'
  select 'start'
  click_on 'schedule'
  @step_execution_id = page.response_headers['X-AUTON-STEP-ID']
  raise 'could not find step id' unless @step_execution_id
end


Given(/^I have a running auton with one defined step with two parameters$/) do
  class EmptyAutonWithParams
    include StructureMapper::Hash

    def initialize
    end

    def start p1, p2
      self.p1 = p1
      self.p2 = p2
    end

    attribute p1: String
    attribute p2: String
  end

  @auton_type="EmptyAutonWithParams"
  @auton_id = Celluloid::Actor[:nestene_core].create_auton(@auton_type)
end

When(/^I schedule the step with parameters$/) do
  visit '/auton/%s' % @auton_id
  click_on 'schedule_step'
  select 'start'
  click_on 'schedule'
  # select 'start'
  fill_in 'parameters[0]', with: 'p1'
  fill_in 'parameters[1]', with: 'p1'
  click_on 'schedule'
  @step_execution_id = page.response_headers['X-AUTON-STEP-ID']
  raise 'could not find step id' unless @step_execution_id
end

Then(/^the executed steps should include the step with the parameters$/) do
  expect(Celluloid::Actor["storage:%s" % @auton_id].get.queue.executed.first.uuid).to eq(@step_execution_id)
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nestene-0.1.8 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.7 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.6 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.5 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.4 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.3 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.2 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.1 features/step_definitions/ui/schedule_auton_step_steps.rb
nestene-0.1.0 features/step_definitions/ui/schedule_auton_step_steps.rb