Sha256: 0136f4ae7a1fb7b5ab7b02f8177df8848368967ab3b46ba7b7053bc3f1b09163
Contents?: true
Size: 1.62 KB
Versions: 7
Compression:
Stored size: 1.62 KB
Contents
module JmeterPerf class DSL # DSL method synonymous with the JMeter Element ResponseAssertion # @param params [Hash] Parameters for the ResponseAssertion element (default: `{}`). # @yield block to attach to the ResponseAssertion element # @return [JmeterPerf::ResponseAssertion], a subclass of JmeterPerf::DSL that can be chained with other DSL methods. # @see https://github.com/jlurena/jmeter_perf/wiki/1.-DSL-Documentation#responseassertion def response_assertion(params = {}, &) node = ResponseAssertion.new(params) attach_node(node, &) end class ResponseAssertion attr_accessor :doc include JmeterPerf::Helpers::XmlDocumentUpdater def initialize(params = {}) testname = params.is_a?(Array) ? "ResponseAssertion" : (params[:name] || "ResponseAssertion") @doc = Nokogiri::XML(JmeterPerf::Helpers::String.strip_heredoc( <<~EOS <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="#{testname}" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="0"/> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">16</intProp> <stringProp name="Assertion.scope">all</stringProp> </ResponseAssertion> 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