ruby-jmeter 2.13.10 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +1 -1
  5. data/Gemfile +2 -2
  6. data/LICENSE.txt +2 -2
  7. data/README.md +4 -5
  8. data/Rakefile +3 -3
  9. data/examples/{basic_os_process_sampler.rb → OS_process_sampler.rb} +1 -1
  10. data/examples/{basic_assertion_results.rb → assertion_results.rb} +1 -3
  11. data/examples/basic_auth.rb +1 -1
  12. data/examples/{basic_browser_headers.rb → browser_headers.rb} +1 -1
  13. data/examples/{basic_composite_graph.rb → composite_graph.rb} +1 -1
  14. data/examples/{basic_gc_dummy_sampler.rb → dummy_sampler.rb} +1 -3
  15. data/examples/{basic_duration_assertion.rb → duration_assertion.rb} +1 -1
  16. data/examples/etsy_login_browse.rb +1 -4
  17. data/examples/{basic_extract.rb → extract.rb} +1 -1
  18. data/examples/{basic_foreach.rb → foreach_controller.rb} +1 -4
  19. data/examples/{basic_header.rb → header_manager.rb} +2 -3
  20. data/examples/{basic_cache.rb → http_cache_manager.rb} +1 -1
  21. data/examples/{basic_cookies.rb → http_cookie_manager.rb} +1 -1
  22. data/examples/{basic_http_request_defaults.rb → http_request_defaults.rb} +3 -2
  23. data/examples/{basic_post.rb → http_request_post.rb} +1 -5
  24. data/examples/{basic_http_request_with_files.rb → http_request_with_files.rb} +1 -1
  25. data/examples/{basic_query_params.rb → http_request_with_query_params.rb} +1 -1
  26. data/examples/{basic_gc_results.rb → jmeter_plugins_graphs.rb} +1 -2
  27. data/examples/{basic_json_path_assertion.rb → json_path_assertions.rb} +1 -1
  28. data/examples/{basic_json_path_extractor.rb → json_path_extractor.rb} +1 -3
  29. data/examples/{basic_ldap_ext.rb → ldap_sampler.rb} +1 -1
  30. data/examples/{basic_loadosophia.rb → loadosophia.rb} +1 -1
  31. data/examples/{basic_loops.rb → loop_controller.rb} +2 -2
  32. data/examples/{basic_counter.rb → loops_with_counter.rb} +2 -2
  33. data/examples/{basic_perfmon.rb → perfmon.rb} +1 -1
  34. data/examples/real_page_objects.rb +1 -1
  35. data/examples/real_user_objects_github.rb +1 -1
  36. data/examples/regular_expression_extractor.rb +11 -0
  37. data/examples/{basic_assertion.rb → response_assertion.rb} +2 -1
  38. data/examples/{basic_response_time_percentiles_graph.rb → response_time_percentiles_graph.rb} +1 -2
  39. data/examples/{basic_simple_data_writer.rb → simple_data_writer_listener.rb} +1 -1
  40. data/examples/{basic_stepping_thread_group.rb → stepping_thread_group.rb} +1 -3
  41. data/examples/{basic_test_fragment.rb → test_fragment.rb} +1 -1
  42. data/examples/{basic_think_time.rb → think_time.rb} +2 -2
  43. data/examples/{basic_thread_groups.rb → thread_groups.rb} +1 -1
  44. data/examples/{basic_throughput_controller.rb → throughput_controller.rb} +1 -1
  45. data/examples/{basic_throughput_shaping_timer.rb → throughput_shaping_timer.rb} +1 -2
  46. data/examples/{basic_ultimate_thread_group.rb → ultimate_thread_group.rb} +1 -2
  47. data/examples/{basic_user_defined_variables.rb → user_defined_variables.rb} +1 -1
  48. data/examples/{basic_preprocessor_user_parameters.rb → user_parameters.rb} +7 -7
  49. data/lib/ruby-jmeter.rb +13 -8
  50. data/lib/ruby-jmeter/DSL.md +3 -1
  51. data/lib/ruby-jmeter/dsl.rb +11 -615
  52. data/lib/ruby-jmeter/dsl/foreach_controller.rb +0 -2
  53. data/lib/ruby-jmeter/dsl/html_parameter_mask.rb +3 -3
  54. data/lib/ruby-jmeter/dsl/http_request.rb +0 -2
  55. data/lib/ruby-jmeter/dsl/http_request_defaults.rb +0 -1
  56. data/lib/ruby-jmeter/dsl/jms_publisher.rb +2 -0
  57. data/lib/ruby-jmeter/dsl/regular_expression_extractor.rb +1 -3
  58. data/lib/ruby-jmeter/dsl/response_assertion.rb +0 -1
  59. data/lib/ruby-jmeter/dsl/test_fragment.rb +1 -1
  60. data/lib/ruby-jmeter/dsl/user_parameters.rb +3 -1
  61. data/lib/ruby-jmeter/extend/assertions/response_assertion.rb +36 -0
  62. data/lib/ruby-jmeter/extend/config_elements/header_manager.rb +13 -0
  63. data/lib/ruby-jmeter/extend/config_elements/http_cache_manager.rb +11 -0
  64. data/lib/ruby-jmeter/extend/config_elements/http_cookie_manager.rb +11 -0
  65. data/lib/ruby-jmeter/extend/config_elements/http_request_defaults.rb +28 -0
  66. data/lib/ruby-jmeter/extend/config_elements/user_defined_variables.rb +13 -0
  67. data/lib/ruby-jmeter/extend/config_elements/user_parameters.rb +31 -0
  68. data/lib/ruby-jmeter/extend/controllers/foreach_controller.rb +25 -0
  69. data/lib/ruby-jmeter/extend/controllers/loop_controller.rb +11 -0
  70. data/lib/ruby-jmeter/extend/controllers/module_controller.rb +23 -0
  71. data/lib/ruby-jmeter/extend/controllers/throughput_controller.rb +15 -0
  72. data/lib/ruby-jmeter/extend/controllers/transaction_controller.rb +14 -0
  73. data/lib/ruby-jmeter/extend/misc/aliases.rb +21 -0
  74. data/lib/ruby-jmeter/extend/misc/exists.rb +13 -0
  75. data/lib/ruby-jmeter/extend/misc/flood.rb +48 -0
  76. data/lib/ruby-jmeter/extend/misc/with_helpers.rb +27 -0
  77. data/lib/ruby-jmeter/extend/plugins/jmeter_plugins.rb +115 -0
  78. data/lib/ruby-jmeter/extend/processors/extract.rb +28 -0
  79. data/lib/ruby-jmeter/extend/processors/regular_expression_extractor.rb +25 -0
  80. data/lib/ruby-jmeter/extend/samplers/http_request.rb +47 -0
  81. data/lib/ruby-jmeter/extend/samplers/soapxmlrpc_request.rb +9 -0
  82. data/lib/ruby-jmeter/extend/threads/setup_thread_group.rb +18 -0
  83. data/lib/ruby-jmeter/extend/threads/thread_group.rb +19 -0
  84. data/lib/ruby-jmeter/extend/timers/constant_throughput_timer.rb +12 -0
  85. data/lib/ruby-jmeter/extend/timers/random_timer.rb +14 -0
  86. data/lib/ruby-jmeter/helpers/helper.rb +1 -2
  87. data/lib/ruby-jmeter/idl.xml +6 -4
  88. data/lib/ruby-jmeter/version.rb +1 -1
  89. data/ruby-jmeter.gemspec +7 -7
  90. data/spec/constant_throughput_timer_spec.rb +22 -0
  91. data/spec/header_manager_spec.rb +37 -0
  92. data/spec/http_cache_manager_spec.rb +17 -0
  93. data/spec/http_cookie_manager_spec.rb +17 -0
  94. data/spec/http_request_defaults_spec.rb +47 -0
  95. data/spec/http_request_spec.rb +305 -0
  96. data/spec/jmeter_plugins_spec.rb +155 -0
  97. data/spec/json_extractor_spec.rb +19 -0
  98. data/spec/json_path_assertion_spec.rb +28 -0
  99. data/spec/logic_controller_spec.rb +148 -0
  100. data/spec/loop_controller_spec.rb +19 -0
  101. data/spec/module_controller_spec.rb +56 -0
  102. data/spec/regular_expression_extractor_spec.rb +63 -0
  103. data/spec/response_assertion_spec.rb +69 -0
  104. data/spec/setup_thread_group_spec.rb +31 -0
  105. data/spec/thread_group_spec.rb +57 -0
  106. data/spec/throughput_controller_spec.rb +24 -0
  107. data/spec/transaction_controller_spec.rb +30 -0
  108. data/spec/user_defined_variables_spec.rb +22 -0
  109. data/spec/user_parameters_spec.rb +45 -0
  110. data/spec/with_helpers_spec.rb +57 -0
  111. data/spec/xpath_extractor_spec.rb +15 -0
  112. metadata +87 -59
  113. data/examples/basic_flood.rb +0 -12
  114. data/examples/basic_flood_real.rb +0 -7
  115. data/examples/basic_flood_with_csv.rb +0 -16
  116. data/examples/basic_google.rb +0 -8
  117. data/examples/basic_har.json +0 -4252
  118. data/examples/basic_har.rb +0 -34
  119. data/examples/basic_meta_fu.rb +0 -63
  120. data/examples/basic_response_assertion.rb +0 -13
  121. data/examples/basic_run.rb +0 -12
  122. data/examples/basic_testdata.rb +0 -60
  123. data/examples/demo.csv +0 -3
  124. data/examples/real_flood_test.rb +0 -14
  125. data/examples/real_flood_test_data.rb +0 -15
  126. data/examples/real_immi.gov.au_visa.rb +0 -78
  127. data/lib/ruby-jmeter/helpers/jmeter.properties +0 -28
  128. data/spec/dsl_spec.rb +0 -1157
  129. data/spec/stub.rb +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02c9ddcb8eed598c5746a0ce221a4b7d67ada429
4
- data.tar.gz: 130cb2c1cc9a1aa55c8404b3e848f8e4780ca846
3
+ metadata.gz: c74a1b79ce925ae4f7421e7b66178cd905806d40
4
+ data.tar.gz: 72326c3b7f61cba3734a4d1d0a81476d1c9e29bb
5
5
  SHA512:
6
- metadata.gz: ae25f0bec982b43a5f672a1c92626c5f3be402f54c9604dce5d89a15d53e52a2ba8d6fa632d1b95ab9ef4718250ecd04a7acbbb810c32e979b513ed39cfce09d
7
- data.tar.gz: b42ba2c8998f9d371ea6e22751a3f6e5320102cfcc5a37ff496bc97dc6ed01d64d3ba2c1cf962b0a5bf339ca5b7b80dd34f312cf2ad96322943f6a51cfc5adf8
6
+ metadata.gz: d917316e79440554e0bb9ecfa68c448a41e88bde5352b5aa6593bca193c08ccf2f861fb80e5348087c3481dcfc6b7134636a8229473f6a9d8bc925e2286f96c8
7
+ data.tar.gz: e252f9f2b3f077d9b87cffbe9658add5fab4201ab448b63f9be3ee4e0320f3c94f6221912dc9aa56be752e13f97dbb35985b9b2a1dce070ba886381748a70cd7
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.jmx
21
21
  *.jtl
22
22
  *.bak
23
+ .byebug_history
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.3.1
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.0
3
+ - 2.3.1
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ruby-jmeter.gemspec
4
4
  gemspec
@@ -12,7 +12,7 @@ platforms :jruby do
12
12
  end
13
13
 
14
14
  group :development do
15
- gem 'pry', :require => 'pry'
15
+ gem 'byebug'
16
16
  end
17
17
 
18
18
  group :test do
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 TODO: Write your name
1
+ Copyright (c) 2016 Flood IO
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -23,7 +23,6 @@ Install it yourself as:
23
23
  To use the DSL, first let's require the gem:
24
24
 
25
25
  ```ruby
26
- require 'rubygems'
27
26
  require 'ruby-jmeter'
28
27
  ```
29
28
 
@@ -413,7 +412,7 @@ You **should never manually update** code in `lib/ruby-jmeter/dsl` as this is au
413
412
 
414
413
  ### DSL
415
414
 
416
- Much of the behaviour of the gem is defined in `lib/ruby-jmeter/dsl.rb` which is where you should be updating code. This is now a very long module and in much need of refactoring. PR's are welcomed.
415
+ Much of the behaviour of the gem is defined in `lib/ruby-jmeter/dsl.rb` which is where you should be updating code. You can extend individual DSL component behaviour in `live/ruby-jmeter/extend/**/*.rb`
417
416
 
418
417
  ### Plugins
419
418
 
@@ -434,7 +433,7 @@ Then you can run any rake / test tasks with the prefix `bundle exec`
434
433
 
435
434
  ### Tests
436
435
 
437
- If contributing please add an appropriate test. See `spec/dsl_spec.rb` for examples. Tests can be run from the command line as follows:
436
+ If contributing please add an appropriate test. See `spec/*_spec.rb` for examples. Tests can be run from the command line as follows:
438
437
 
439
438
  $ bundle exec rspec
440
439
 
@@ -449,10 +448,10 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
449
448
  $ flood/ruby-jmeter - [master●] » ruby examples/basic_assertion.rb
450
449
  W, [2015-10-17T19:31:12.021004 #33216] WARN -- : Test executing locally ...
451
450
 
452
- Note: most of the examples assume the JMeter binary is installed in `/usr/share/jmeter-2.13/bin/` however you can modify this in your example to something that suits your installation e.g.:
451
+ Note: most of the examples assume the JMeter binary is installed in `/usr/share/jmeter/bin/` however you can modify this in your example to something that suits your installation e.g.:
453
452
 
454
453
 
455
454
  ```ruby
456
455
  ...
457
- end.run(path: 'C/Program Files/JMeter-2.13/bin/', gui: true)
456
+ end.run(path: 'C/Program Files/JMeter/bin/', gui: true)
458
457
  ```
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new
5
5
 
6
- task :default => [:spec]
6
+ task default: [:spec]
@@ -21,4 +21,4 @@ test do
21
21
  os_process_sampler 'SystemSampler.command' => 'git',
22
22
  update_at_xpath: build_args.call(['push', 'origin', 'master'])
23
23
 
24
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
24
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -15,6 +15,4 @@ test do
15
15
  { '//assertions' => 'true' }
16
16
  ]
17
17
  end
18
- end.flood(ENV['FLOOD_API_TOKEN'], {
19
- name: 'Basic Assertion Results'
20
- })
18
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -8,4 +8,4 @@ test do
8
8
  visit name: 'Home Page', url: 'http://google.com/'
9
9
  end
10
10
  end
11
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -4,4 +4,4 @@ require 'ruby-jmeter'
4
4
  test do
5
5
  # Simulate user agent, accept and accept-encodings of typical browsers
6
6
  with_browser :ie9
7
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
7
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -26,4 +26,4 @@ test do
26
26
  metric: 'Overall Active Threads'
27
27
  }
28
28
  ]
29
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
29
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -5,6 +5,4 @@ test do
5
5
  threads count: 1 do
6
6
  dummy_sampler '__grid_data_api', {response_data: "ACIR0001, ACIR0002, ACIR0003, ACIR0004, ACIR0005, ACIR0006, ABS0003, MBS0001, MBS0004, MBS0005, ABS0004, ABS0005, ABS0010, ABS0011, ABS0012, ABS0013, ABS0014, ABS0016, ABS0017, ABS0018, ABS0021, ABS0022, MBS0006, MBS0009, MBS0010"}
7
7
  end
8
-
9
-
10
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
8
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -7,4 +7,4 @@ test do
7
7
  duration_assertion duration: 1000
8
8
  end
9
9
  end
10
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
10
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -58,7 +58,4 @@ test do
58
58
  end
59
59
 
60
60
  end
61
-
62
- # end.grid ARGV[1]
63
- # end.jmx
64
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
61
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -9,4 +9,4 @@ test do
9
9
  extract css: 'span#blog', name: 'blog'
10
10
  end
11
11
  end
12
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
12
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -26,7 +26,4 @@ test do
26
26
  end
27
27
  end
28
28
 
29
- # end.jmx
30
- # end.flood(ENV['FLOOD_API_TOKEN'])
31
- # end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
32
- end.run(path: '/usr/share/jmeter-2.13/bin/')
29
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -19,12 +19,11 @@ test do
19
19
  with_xhr
20
20
  end
21
21
  end
22
-
22
+
23
23
  post name: 'with_headers', ur: '/',
24
24
  fill_in: {
25
25
  js: true
26
26
  } do
27
27
  header [{ name: 'Cache-Control', value: 'no-cache'}]
28
28
  end
29
-
30
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
29
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -8,4 +8,4 @@ test do
8
8
  visit name: 'Home Page', url: 'http://google.com/'
9
9
  end
10
10
  end
11
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -8,4 +8,4 @@ test do
8
8
  visit name: 'Home Page', url: 'http://google.com/'
9
9
  end
10
10
  end
11
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -6,5 +6,6 @@ test do
6
6
  protocol: 'https',
7
7
  download_resources: true,
8
8
  use_concurrent_pool: 5,
9
- urls_must_match: 'http.+?example.com'
10
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
9
+ urls_must_match: 'http.+?example.com',
10
+ md5: true
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -2,14 +2,10 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  require 'ruby-jmeter'
3
3
 
4
4
  test do
5
-
6
5
  threads count: 1 do
7
-
8
6
  transaction name: 'Post with a Raw Body', parent: false do
9
7
  post name: 'Home Page', url: 'http://google.com',
10
8
  raw_body: '{"name":"Big Poncho","price":10,"vendor_attendance_id":24,"product_id":1}'
11
9
  end
12
-
13
10
  end
14
-
15
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -10,4 +10,4 @@ test do
10
10
  'DO_MULTIPART_POST' => true
11
11
  end
12
12
  end
13
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
13
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -5,4 +5,4 @@ test do
5
5
  threads count: 10 do
6
6
  visit name: 'Google Search', url: 'http://google.com/?hl=en&tbo=d&sclient=psy-ab&q=flood.io&oq=flood.io'
7
7
  end
8
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
8
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -19,5 +19,4 @@ test do
19
19
  response_times_over_time 'Response Times Over Time'
20
20
  response_times_percentiles 'Response Times Percentiles'
21
21
  transactions_per_second 'Transactions per Second'
22
-
23
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
22
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -7,4 +7,4 @@ test do
7
7
  assert json: '.name', value: 'ruby-jmeter'
8
8
  end
9
9
  end
10
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
10
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -7,6 +7,4 @@ test do
7
7
  extract json: '.apdex.score', name: 'apdex'
8
8
  end
9
9
  end
10
-
11
- # end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
12
- end.flood(ENV['FLOOD_API_TOKEN'])
10
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -13,4 +13,4 @@ test do
13
13
 
14
14
  end
15
15
  view_results name: 'debug'
16
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
16
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -15,4 +15,4 @@ test do
15
15
  threads count: 1 do
16
16
  visit name: 'Home Page', url: 'http://google.com/'
17
17
  end
18
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
18
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -3,8 +3,8 @@ require 'ruby-jmeter'
3
3
 
4
4
  test do
5
5
  threads count: 1 do
6
- Loop count:10 do
6
+ loops count:10 do
7
7
  visit name: 'Home Page', url: 'http://google.com/'
8
8
  end
9
9
  end
10
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
10
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -3,7 +3,7 @@ require 'ruby-jmeter'
3
3
 
4
4
  test do
5
5
  threads count: 1 do
6
- Loop count:10 do
6
+ loops count:10 do
7
7
  counter 'CounterConfig.name' => 'visit',
8
8
  'CounterConfig.start' => 1,
9
9
  'CounterConfig.incr' => 1,
@@ -12,4 +12,4 @@ test do
12
12
  visit name: 'Home Page', url: 'http://google.com/'
13
13
  end
14
14
  end
15
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
15
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -43,4 +43,4 @@ test do
43
43
  metric: 'localhost Memory memory-node'
44
44
  }
45
45
  ]
46
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
46
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -38,4 +38,4 @@ test do
38
38
  home = HomePage.new(self)
39
39
  home.visit
40
40
  end
41
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
41
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -108,5 +108,5 @@ test do
108
108
  user.view_branch '/flood-io/ruby-jmeter/tree/v2.11.8'
109
109
 
110
110
  end
111
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
111
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
112
112
 
@@ -0,0 +1,11 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'ruby-jmeter'
3
+
4
+ test do
5
+ threads count: 1 do
6
+ visit name: 'Home', url: 'https://flood.io' do
7
+ regex pattern: "content='(.+?)' name='csrf-token'", name: 'csrf-token', match_number: 1, default: '424242'
8
+ regex pattern: 'pattern', name: 'jmeter_variable_regex', variable: 'test'
9
+ end
10
+ end
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -7,7 +7,8 @@ test do
7
7
  visit name: 'Altentee', url: 'http://altentee.com/' do
8
8
  assert contains: 'We test, tune and secure your site'
9
9
  assert 'not-contains' => 'Something in frames', scope: 'children'
10
+ assert 'substring' => 'Something in frames', variable: 'test'
10
11
  end
11
12
  end
12
13
  end
13
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
14
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -3,10 +3,9 @@ require 'ruby-jmeter'
3
3
 
4
4
  test do
5
5
  threads count: 100 do
6
-
7
6
  response_times_percentiles 'Response Times Percentiles', filename: '/path/to/output', update_at_xpath: [
8
7
  { '//value/xml' => 'false' }
9
8
  ]
10
9
 
11
10
  end
12
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -8,4 +8,4 @@ test do
8
8
  # write errors to a simple data writer with the log alias
9
9
  log filename: '/var/log/flood/custom.log', error_logging: true
10
10
  end
11
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -25,7 +25,5 @@ test do
25
25
  random_timer 1000, 3000
26
26
 
27
27
  get name: 'home', url: '/'
28
-
29
28
  end
30
-
31
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
29
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -11,4 +11,4 @@ test do
11
11
  module_controller test_fragment: 'WorkBench/TestPlan/anonymous_user'
12
12
  end
13
13
 
14
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
14
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -4,7 +4,7 @@ require 'ruby-jmeter'
4
4
  test do
5
5
  threads count: 100 do
6
6
 
7
- think_time 5000,5000
7
+ think_time 5000, 5000
8
8
 
9
9
  transaction name: 'Google Search' do
10
10
  visit name: 'Home Page', url: 'http://google.com/'
@@ -12,4 +12,4 @@ test do
12
12
  end
13
13
 
14
14
  end
15
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
15
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -4,4 +4,4 @@ require 'ruby-jmeter'
4
4
  test do
5
5
  threads count: 100, rampup: 3600, loops: 10, scheduler: false do
6
6
  end
7
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
7
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -11,4 +11,4 @@ test do
11
11
  end
12
12
 
13
13
  end
14
- end.run(path: '/usr/share/jmeter-2.13/bin/', gui: true)
14
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)