gridinit-jmeter 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'gridinit-jmeter'
3
+
4
+ test do
5
+ threads 10 do
6
+ visit 'Google Search', 'http://google.com/?hl=en&tbo=d&sclient=psy-ab&q=gridinit&oq=gridinit'#, {always_encode: true}
7
+ end
8
+ end.jmx
@@ -29,6 +29,10 @@ module Gridinit
29
29
  EOF
30
30
  parse_url(url, params) unless url.empty?
31
31
  fill_in(params) if params[:fill_in]
32
+ params[:query] && params[:query].split('&').each do |param|
33
+ name,value = param.split('=')
34
+ fill_in({ fill_in: { "#{name}" => value }, always_encode: params[:always_encode] })
35
+ end
32
36
  params.each do |name, value|
33
37
  node = @doc.children.xpath("//*[contains(@name,\"#{name.to_s}\")]")
34
38
  node.first.content = value unless node.empty?
@@ -48,6 +52,7 @@ module Gridinit
48
52
  params[:domain] ||= uri.host
49
53
  params[:port] ||= uri.port
50
54
  params[:path] ||= uri.path
55
+ params[:query] ||= uri.query
51
56
  end
52
57
  end
53
58
 
@@ -55,8 +60,8 @@ module Gridinit
55
60
  params[:fill_in].each do |name, value|
56
61
  @doc.at_xpath('//collectionProp') <<
57
62
  Nokogiri::XML(<<-EOF.strip_heredoc).children
58
- <elementProp name="username" elementType="HTTPArgument">
59
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
63
+ <elementProp name="#{name}" elementType="HTTPArgument">
64
+ <boolProp name="HTTPArgument.always_encode">#{params[:always_encode] ? 'true' : false}</boolProp>
60
65
  <stringProp name="Argument.value">#{value}</stringProp>
61
66
  <stringProp name="Argument.metadata">=</stringProp>
62
67
  <boolProp name="HTTPArgument.use_equals">true</boolProp>
@@ -1,5 +1,5 @@
1
1
  module Gridinit
2
2
  module Jmeter
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gridinit-jmeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -69,6 +69,7 @@ files:
69
69
  - examples/basic_google.rb
70
70
  - examples/basic_grid.rb
71
71
  - examples/basic_proxy.rb
72
+ - examples/basic_query_params.rb
72
73
  - examples/basic_run.rb
73
74
  - examples/basic_stdout.rb
74
75
  - examples/basic_testplan.jmx