Sha256: 73c8cdbc71d73934a10c7930da588bd46c59d5752d019d34d25ab78103fed6b3
Contents?: true
Size: 1.2 KB
Versions: 7
Compression:
Stored size: 1.2 KB
Contents
module JmeterPerf class DSL # DSL method synonymous with the JMeter Element OnceOnlyController # @param params [Hash] Parameters for the OnceOnlyController element (default: `{}`). # @yield block to attach to the OnceOnlyController element # @return [JmeterPerf::OnceOnlyController], a subclass of JmeterPerf::DSL that can be chained with other DSL methods. # @see https://github.com/jlurena/jmeter_perf/wiki/1.-DSL-Documentation#onceonlycontroller def once_only_controller(params = {}, &) node = OnceOnlyController.new(params) attach_node(node, &) end class OnceOnlyController attr_accessor :doc include JmeterPerf::Helpers::XmlDocumentUpdater def initialize(params = {}) testname = params.is_a?(Array) ? "OnceOnlyController" : (params[:name] || "OnceOnlyController") @doc = Nokogiri::XML(JmeterPerf::Helpers::String.strip_heredoc( <<~EOS <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="#{testname}" enabled="true"/> EOS )) update params update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems