Sha256: 0d1f2bc6d11f9e65f73678cfc6a13689656bcc85efcb15a13d329e08b4ead726
Contents?: true
Size: 1.49 KB
Versions: 1
Compression:
Stored size: 1.49 KB
Contents
module JmeterPerf class DSL # DSL method synonymous with the JMeter Element XPathExtractor # @see https://github.com/jlurena/jmeter_perf/wiki/1.-DSL-Documentation#xpathextractor # @param [Hash] params Parameters for the XPathExtractor element (default: `{}`). # @yield block to attach to the XPathExtractor element # @return [JmeterPerf::XPathExtractor], a subclass of JmeterPerf::DSL that can be chained with other DSL methods. def x_path_extractor(params = {}, &) node = JmeterPerf::XPathExtractor.new(params) attach_node(node, &) end end class XPathExtractor attr_accessor :doc include Helper def initialize(params = {}) testname = params.is_a?(Array) ? "XPathExtractor" : (params[:name] || "XPathExtractor") @doc = Nokogiri::XML(<<~EOS.strip_heredoc) <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="#{testname}" enabled="true"> <stringProp name="XPathExtractor.default"/> <stringProp name="XPathExtractor.refname"/> <stringProp name="XPathExtractor.xpathQuery"/> <boolProp name="XPathExtractor.validate">false</boolProp> <boolProp name="XPathExtractor.tolerant">false</boolProp> <boolProp name="XPathExtractor.namespace">false</boolProp> <stringProp name="Sample.scope">all</stringProp> </XPathExtractor> EOS update params update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jmeter_perf-0.0.7 | lib/jmeter_perf/dsl/x_path_extractor.rb |