Sha256: a32a96720b88f560ae06d9ebfb94845c94d187ed7889e7c3ee8fed75deeaa7db

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

module JmeterPerf
  class DSL
    def test_action(params = {}, &)
      node = JmeterPerf::TestAction.new(params)
      attach_node(node, &)
    end
  end

  class TestAction
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "TestAction" : (params[:name] || "TestAction")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <TestAction guiclass="TestActionGui" testclass="TestAction" testname="#{testname}" enabled="true">
          <intProp name="ActionProcessor.action">1</intProp>
          <intProp name="ActionProcessor.target">0</intProp>
          <stringProp name="ActionProcessor.duration"/>
        </TestAction>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/test_action.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/test_action.rb