Sha256: 2bf535302b762644bcf574382091cf7bce778b153d3017ba793c64ad4bfe5291
Contents?: true
Size: 1.73 KB
Versions: 7
Compression:
Stored size: 1.73 KB
Contents
module JmeterPerf class DSL # DSL method synonymous with the JMeter Element HTTPAuthorizationManager # @param params [Hash] Parameters for the HTTPAuthorizationManager element (default: `{}`). # @yield block to attach to the HTTPAuthorizationManager element # @return [JmeterPerf::HTTPAuthorizationManager], a subclass of JmeterPerf::DSL that can be chained with other DSL methods. # @see https://github.com/jlurena/jmeter_perf/wiki/1.-DSL-Documentation#httpauthorizationmanager def http_authorization_manager(params = {}, &) node = HTTPAuthorizationManager.new(params) attach_node(node, &) end class HTTPAuthorizationManager attr_accessor :doc include JmeterPerf::Helpers::XmlDocumentUpdater def initialize(params = {}) testname = params.is_a?(Array) ? "HTTPAuthorizationManager" : (params[:name] || "HTTPAuthorizationManager") @doc = Nokogiri::XML(JmeterPerf::Helpers::String.strip_heredoc( <<~EOS <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="#{testname}" enabled="true"> <collectionProp name="AuthManager.auth_list"> <elementProp name="" elementType="Authorization"> <stringProp name="Authorization.url"/> <stringProp name="Authorization.username"/> <stringProp name="Authorization.password"/> <stringProp name="Authorization.domain"/> <stringProp name="Authorization.realm"/> </elementProp> </collectionProp> </AuthManager> 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