Sha256: f38d34768632cc1f1bbe947c827ee9f4fe8d64b68f8f4ecf849470a4caff0715

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

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

  class UserDefinedVariables
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "UserDefinedVariables" : (params[:name] || "UserDefinedVariables")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
          <collectionProp name="Arguments.arguments">
            <elementProp name=" " elementType="Argument">
              <stringProp name="Argument.name"> </stringProp>
              <stringProp name="Argument.value"> </stringProp>
              <stringProp name="Argument.metadata">=</stringProp>
              <stringProp name="Argument.desc"> </stringProp>
            </elementProp>
          </collectionProp>
          <stringProp name="TestPlan.comments"> </stringProp>
        </Arguments>
      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/user_defined_variables.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/user_defined_variables.rb