Class: PerformanceTester::Runner::Context

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/performance_tester/runner.rb

Overview

Provides an execution context for scenarios

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, hosts) ⇒ Context

Returns a new instance of Context.



110
111
112
113
# File 'lib/performance_tester/runner.rb', line 110

def initialize(params, hosts)
  @params = params
  @hosts = hosts
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



108
109
110
# File 'lib/performance_tester/runner.rb', line 108

def error
  @error
end

#hostsObject (readonly)

Returns the value of attribute hosts.



108
109
110
# File 'lib/performance_tester/runner.rb', line 108

def hosts
  @hosts
end

#paramsObject (readonly)

Returns the value of attribute params.



108
109
110
# File 'lib/performance_tester/runner.rb', line 108

def params
  @params
end

Instance Method Details

#execute(scenario) ⇒ Object



115
116
117
118
119
# File 'lib/performance_tester/runner.rb', line 115

def execute(scenario)
  instance_eval(&scenario)
rescue => error
  @error = error
end

#network_trafficObject



121
122
123
# File 'lib/performance_tester/runner.rb', line 121

def network_traffic
  page.driver.network_traffic
end