jmeter-ruby 3.0.0
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.
- checksums.yaml +7 -0
- data/.gitattributes +22 -0
- data/.github/workflows/ci.yml +54 -0
- data/.gitignore +24 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/CHANGES.md +77 -0
- data/Gemfile +23 -0
- data/LICENSE.txt +21 -0
- data/README.md +434 -0
- data/Rakefile +18 -0
- data/examples/OS_process_sampler.rb +24 -0
- data/examples/assertion_results.rb +18 -0
- data/examples/basic_auth.rb +11 -0
- data/examples/browser_headers.rb +7 -0
- data/examples/composite_graph.rb +29 -0
- data/examples/constant_throughput_timer.rb +11 -0
- data/examples/csv_data_set.rb +11 -0
- data/examples/dummy_sampler.rb +9 -0
- data/examples/duration_assertion.rb +10 -0
- data/examples/etsy_login_browse.rb +61 -0
- data/examples/extract.rb +12 -0
- data/examples/foreach_controller.rb +29 -0
- data/examples/header_manager.rb +29 -0
- data/examples/http_cache_manager.rb +11 -0
- data/examples/http_cookie_manager.rb +11 -0
- data/examples/http_request_defaults.rb +11 -0
- data/examples/http_request_post.rb +11 -0
- data/examples/http_request_with_files.rb +13 -0
- data/examples/http_request_with_query_params.rb +8 -0
- data/examples/jmeter_plugins_graphs.rb +22 -0
- data/examples/json_path_assertions.rb +11 -0
- data/examples/json_path_extractor.rb +10 -0
- data/examples/json_path_postprocessor.rb +10 -0
- data/examples/jsr223_assertion.rb +13 -0
- data/examples/ldap_sampler.rb +16 -0
- data/examples/loadosophia.rb +18 -0
- data/examples/loop_controller.rb +10 -0
- data/examples/loops_with_counter.rb +15 -0
- data/examples/once_only_controller.rb +15 -0
- data/examples/perfmon.rb +46 -0
- data/examples/real_custom_methods.rb +19 -0
- data/examples/real_page_objects.rb +41 -0
- data/examples/real_redis_data_set_with_setup.rb +123 -0
- data/examples/real_user_objects_github.rb +112 -0
- data/examples/regular_expression_extractor.rb +12 -0
- data/examples/response_assertion.rb +15 -0
- data/examples/response_time_percentiles_graph.rb +11 -0
- data/examples/rsync.rb +16 -0
- data/examples/sample_transaction.rb +18 -0
- data/examples/simple_data_writer_listener.rb +11 -0
- data/examples/stepping_thread_group.rb +30 -0
- data/examples/test_fragment.rb +14 -0
- data/examples/think_time.rb +15 -0
- data/examples/thread_groups.rb +7 -0
- data/examples/throughput_controller.rb +14 -0
- data/examples/throughput_shaping_timer.rb +20 -0
- data/examples/ultimate_thread_group.rb +39 -0
- data/examples/unicode.rb +8 -0
- data/examples/user_defined_variables.rb +10 -0
- data/examples/user_parameters.rb +28 -0
- data/examples/uuid_per_iteration.rb +15 -0
- data/jmeter-ruby.gemspec +28 -0
- data/lib/jmeter-ruby/DSL.md +235 -0
- data/lib/jmeter-ruby/dsl/access_log_sampler.rb +32 -0
- data/lib/jmeter-ruby/dsl/aggregate_graph.rb +55 -0
- data/lib/jmeter-ruby/dsl/aggregate_report.rb +55 -0
- data/lib/jmeter-ruby/dsl/ajp13_sampler.rb +41 -0
- data/lib/jmeter-ruby/dsl/assertion_results.rb +55 -0
- data/lib/jmeter-ruby/dsl/beanshell_assertion.rb +28 -0
- data/lib/jmeter-ruby/dsl/beanshell_listener.rb +28 -0
- data/lib/jmeter-ruby/dsl/beanshell_postprocessor.rb +28 -0
- data/lib/jmeter-ruby/dsl/beanshell_preprocessor.rb +28 -0
- data/lib/jmeter-ruby/dsl/beanshell_sampler.rb +28 -0
- data/lib/jmeter-ruby/dsl/beanshell_timer.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_assertion.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_listener.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_postprocessor.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_preprocessor.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_sampler.rb +28 -0
- data/lib/jmeter-ruby/dsl/bsf_timer.rb +28 -0
- data/lib/jmeter-ruby/dsl/compare_assertion.rb +27 -0
- data/lib/jmeter-ruby/dsl/comparison_assertion_visualizer.rb +55 -0
- data/lib/jmeter-ruby/dsl/constant_throughput_timer.rb +26 -0
- data/lib/jmeter-ruby/dsl/constant_timer.rb +25 -0
- data/lib/jmeter-ruby/dsl/counter.rb +31 -0
- data/lib/jmeter-ruby/dsl/cssjquery_extractor.rb +31 -0
- data/lib/jmeter-ruby/dsl/csv_data_set_config.rb +33 -0
- data/lib/jmeter-ruby/dsl/debug_postprocessor.rb +28 -0
- data/lib/jmeter-ruby/dsl/debug_sampler.rb +27 -0
- data/lib/jmeter-ruby/dsl/distribution_graphalpha.rb +55 -0
- data/lib/jmeter-ruby/dsl/duration_assertion.rb +25 -0
- data/lib/jmeter-ruby/dsl/foreach_controller.rb +27 -0
- data/lib/jmeter-ruby/dsl/ftp_request.rb +34 -0
- data/lib/jmeter-ruby/dsl/ftp_request_defaults.rb +32 -0
- data/lib/jmeter-ruby/dsl/gaussian_random_timer.rb +26 -0
- data/lib/jmeter-ruby/dsl/generate_summary_results.rb +23 -0
- data/lib/jmeter-ruby/dsl/graph_results.rb +55 -0
- data/lib/jmeter-ruby/dsl/html_assertion.rb +30 -0
- data/lib/jmeter-ruby/dsl/html_link_parser.rb +23 -0
- data/lib/jmeter-ruby/dsl/html_parameter_mask.rb +32 -0
- data/lib/jmeter-ruby/dsl/http_authorization_manager.rb +33 -0
- data/lib/jmeter-ruby/dsl/http_cache_manager.rb +26 -0
- data/lib/jmeter-ruby/dsl/http_cookie_manager.rb +28 -0
- data/lib/jmeter-ruby/dsl/http_header_manager.rb +30 -0
- data/lib/jmeter-ruby/dsl/http_request.rb +41 -0
- data/lib/jmeter-ruby/dsl/http_request_defaults.rb +41 -0
- data/lib/jmeter-ruby/dsl/http_url_rewriting_modifier.rb +30 -0
- data/lib/jmeter-ruby/dsl/if_controller.rb +27 -0
- data/lib/jmeter-ruby/dsl/include_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/java_request.rb +69 -0
- data/lib/jmeter-ruby/dsl/java_request_defaults.rb +69 -0
- data/lib/jmeter-ruby/dsl/jdbc_connection_configuration.rb +37 -0
- data/lib/jmeter-ruby/dsl/jdbc_postprocessor.rb +33 -0
- data/lib/jmeter-ruby/dsl/jdbc_preprocessor.rb +33 -0
- data/lib/jmeter-ruby/dsl/jdbc_request.rb +33 -0
- data/lib/jmeter-ruby/dsl/jms_pointtopoint.rb +41 -0
- data/lib/jmeter-ruby/dsl/jms_publisher.rb +43 -0
- data/lib/jmeter-ruby/dsl/jms_subscriber.rb +35 -0
- data/lib/jmeter-ruby/dsl/json_path_postprocessor.rb +27 -0
- data/lib/jmeter-ruby/dsl/jsr223_assertion.rb +29 -0
- data/lib/jmeter-ruby/dsl/jsr223_listener.rb +29 -0
- data/lib/jmeter-ruby/dsl/jsr223_postprocessor.rb +29 -0
- data/lib/jmeter-ruby/dsl/jsr223_preprocessor.rb +29 -0
- data/lib/jmeter-ruby/dsl/jsr223_sampler.rb +29 -0
- data/lib/jmeter-ruby/dsl/jsr223_timer.rb +29 -0
- data/lib/jmeter-ruby/dsl/junit_request.rb +37 -0
- data/lib/jmeter-ruby/dsl/keystore_configuration.rb +28 -0
- data/lib/jmeter-ruby/dsl/ldap_extended_request.rb +42 -0
- data/lib/jmeter-ruby/dsl/ldap_extended_request_defaults.rb +42 -0
- data/lib/jmeter-ruby/dsl/ldap_request.rb +35 -0
- data/lib/jmeter-ruby/dsl/ldap_request_defaults.rb +39 -0
- data/lib/jmeter-ruby/dsl/login_config_element.rb +26 -0
- data/lib/jmeter-ruby/dsl/loop_controller.rb +26 -0
- data/lib/jmeter-ruby/dsl/mail_reader_sampler.rb +37 -0
- data/lib/jmeter-ruby/dsl/mailer_visualizer.rb +64 -0
- data/lib/jmeter-ruby/dsl/md5hex_assertion.rb +25 -0
- data/lib/jmeter-ruby/dsl/module_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/monitor_results.rb +55 -0
- data/lib/jmeter-ruby/dsl/once_only_controller.rb +23 -0
- data/lib/jmeter-ruby/dsl/os_process_sampler.rb +34 -0
- data/lib/jmeter-ruby/dsl/poisson_random_timer.rb +26 -0
- data/lib/jmeter-ruby/dsl/random_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/random_order_controller.rb +23 -0
- data/lib/jmeter-ruby/dsl/random_variable.rb +30 -0
- data/lib/jmeter-ruby/dsl/recording_controller.rb +23 -0
- data/lib/jmeter-ruby/dsl/regex_user_parameters.rb +27 -0
- data/lib/jmeter-ruby/dsl/regular_expression_extractor.rb +32 -0
- data/lib/jmeter-ruby/dsl/response_assertion.rb +31 -0
- data/lib/jmeter-ruby/dsl/response_time_graph.rb +55 -0
- data/lib/jmeter-ruby/dsl/result_status_action_handler.rb +25 -0
- data/lib/jmeter-ruby/dsl/runtime_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/save_responses_to_a_file.rb +29 -0
- data/lib/jmeter-ruby/dsl/setup_thread_group.rb +36 -0
- data/lib/jmeter-ruby/dsl/simple_config_element.rb +23 -0
- data/lib/jmeter-ruby/dsl/simple_controller.rb +23 -0
- data/lib/jmeter-ruby/dsl/simple_data_writer.rb +55 -0
- data/lib/jmeter-ruby/dsl/smime_assertion.rb +35 -0
- data/lib/jmeter-ruby/dsl/smtp_sampler.rb +51 -0
- data/lib/jmeter-ruby/dsl/soapxmlrpc_request.rb +33 -0
- data/lib/jmeter-ruby/dsl/spline_visualizer.rb +55 -0
- data/lib/jmeter-ruby/dsl/summary_report.rb +55 -0
- data/lib/jmeter-ruby/dsl/switch_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/synchronizing_timer.rb +26 -0
- data/lib/jmeter-ruby/dsl/tcp_sampler.rb +33 -0
- data/lib/jmeter-ruby/dsl/tcp_sampler_config.rb +31 -0
- data/lib/jmeter-ruby/dsl/test_action.rb +27 -0
- data/lib/jmeter-ruby/dsl/test_fragment.rb +23 -0
- data/lib/jmeter-ruby/dsl/test_plan.rb +31 -0
- data/lib/jmeter-ruby/dsl/thread_group.rb +37 -0
- data/lib/jmeter-ruby/dsl/throughput_controller.rb +32 -0
- data/lib/jmeter-ruby/dsl/transaction_controller.rb +26 -0
- data/lib/jmeter-ruby/dsl/uniform_random_timer.rb +26 -0
- data/lib/jmeter-ruby/dsl/user_defined_variables.rb +33 -0
- data/lib/jmeter-ruby/dsl/user_parameters.rb +30 -0
- data/lib/jmeter-ruby/dsl/view_results_in_table.rb +55 -0
- data/lib/jmeter-ruby/dsl/view_results_tree.rb +55 -0
- data/lib/jmeter-ruby/dsl/while_controller.rb +25 -0
- data/lib/jmeter-ruby/dsl/xml_assertion.rb +23 -0
- data/lib/jmeter-ruby/dsl/xml_schema_assertion.rb +25 -0
- data/lib/jmeter-ruby/dsl/xpath_assertion.rb +31 -0
- data/lib/jmeter-ruby/dsl/xpath_extractor.rb +31 -0
- data/lib/jmeter-ruby/dsl.rb +102 -0
- data/lib/jmeter-ruby/extend/assertions/response_assertion.rb +36 -0
- data/lib/jmeter-ruby/extend/config_elements/header_manager.rb +13 -0
- data/lib/jmeter-ruby/extend/config_elements/http_cache_manager.rb +12 -0
- data/lib/jmeter-ruby/extend/config_elements/http_cookie_manager.rb +36 -0
- data/lib/jmeter-ruby/extend/config_elements/http_request_defaults.rb +39 -0
- data/lib/jmeter-ruby/extend/config_elements/user_defined_variables.rb +13 -0
- data/lib/jmeter-ruby/extend/config_elements/user_parameters.rb +31 -0
- data/lib/jmeter-ruby/extend/controllers/foreach_controller.rb +27 -0
- data/lib/jmeter-ruby/extend/controllers/loop_controller.rb +11 -0
- data/lib/jmeter-ruby/extend/controllers/module_controller.rb +23 -0
- data/lib/jmeter-ruby/extend/controllers/throughput_controller.rb +15 -0
- data/lib/jmeter-ruby/extend/controllers/transaction_controller.rb +14 -0
- data/lib/jmeter-ruby/extend/misc/aliases.rb +21 -0
- data/lib/jmeter-ruby/extend/misc/exists.rb +13 -0
- data/lib/jmeter-ruby/extend/misc/rsync.rb +24 -0
- data/lib/jmeter-ruby/extend/misc/uuid.rb +12 -0
- data/lib/jmeter-ruby/extend/misc/with_helpers.rb +27 -0
- data/lib/jmeter-ruby/extend/plugins/jmeter_plugins.rb +120 -0
- data/lib/jmeter-ruby/extend/processors/extract.rb +28 -0
- data/lib/jmeter-ruby/extend/processors/regular_expression_extractor.rb +25 -0
- data/lib/jmeter-ruby/extend/samplers/http_request.rb +58 -0
- data/lib/jmeter-ruby/extend/samplers/jms_pointtopoint.rb +26 -0
- data/lib/jmeter-ruby/extend/samplers/soapxmlrpc_request.rb +9 -0
- data/lib/jmeter-ruby/extend/threads/setup_thread_group.rb +18 -0
- data/lib/jmeter-ruby/extend/threads/thread_group.rb +19 -0
- data/lib/jmeter-ruby/extend/timers/constant_throughput_timer.rb +11 -0
- data/lib/jmeter-ruby/extend/timers/random_timer.rb +14 -0
- data/lib/jmeter-ruby/helpers/fallback_content_proxy.rb +54 -0
- data/lib/jmeter-ruby/helpers/helper.rb +75 -0
- data/lib/jmeter-ruby/helpers/logger-colors.rb +48 -0
- data/lib/jmeter-ruby/helpers/parser.rb +135 -0
- data/lib/jmeter-ruby/helpers/strip-heredoc.rb +5 -0
- data/lib/jmeter-ruby/helpers/user-agents.rb +27 -0
- data/lib/jmeter-ruby/idl.rb +70 -0
- data/lib/jmeter-ruby/idl.xml +1488 -0
- data/lib/jmeter-ruby/plugins/active_threads_over_time.rb +57 -0
- data/lib/jmeter-ruby/plugins/composite_graph.rb +71 -0
- data/lib/jmeter-ruby/plugins/console_status_logger.rb +15 -0
- data/lib/jmeter-ruby/plugins/dummy_sampler.rb +26 -0
- data/lib/jmeter-ruby/plugins/jmx_collector.rb +73 -0
- data/lib/jmeter-ruby/plugins/json_path_assertion.rb +19 -0
- data/lib/jmeter-ruby/plugins/json_path_extractor.rb +20 -0
- data/lib/jmeter-ruby/plugins/latencies_over_time.rb +49 -0
- data/lib/jmeter-ruby/plugins/loadosophia_uploader.rb +63 -0
- data/lib/jmeter-ruby/plugins/perfmon_collector.rb +80 -0
- data/lib/jmeter-ruby/plugins/redis_data_set.rb +39 -0
- data/lib/jmeter-ruby/plugins/response_codes_per_second.rb +49 -0
- data/lib/jmeter-ruby/plugins/response_times_distribution.rb +49 -0
- data/lib/jmeter-ruby/plugins/response_times_over_time.rb +50 -0
- data/lib/jmeter-ruby/plugins/response_times_percentiles.rb +51 -0
- data/lib/jmeter-ruby/plugins/stepping_thread_group.rb +30 -0
- data/lib/jmeter-ruby/plugins/transactions_per_second.rb +50 -0
- data/lib/jmeter-ruby/plugins/ultimate_thread_group.rb +23 -0
- data/lib/jmeter-ruby/plugins/variable_throughput_timer.rb +27 -0
- data/lib/jmeter-ruby/version.rb +12 -0
- data/lib/jmeter-ruby.rb +27 -0
- data/mise.toml +2 -0
- data/script/release +162 -0
- data/spec/constant_throughput_timer_spec.rb +20 -0
- data/spec/csv_data_set_config_spec.rb +33 -0
- data/spec/header_manager_spec.rb +37 -0
- data/spec/http_cache_manager_spec.rb +29 -0
- data/spec/http_cookie_manager_spec.rb +169 -0
- data/spec/http_request_defaults_spec.rb +57 -0
- data/spec/http_request_spec.rb +305 -0
- data/spec/jmeter_plugins_spec.rb +245 -0
- data/spec/json_extractor_spec.rb +19 -0
- data/spec/json_path_assertion_spec.rb +28 -0
- data/spec/logic_controller_spec.rb +148 -0
- data/spec/loop_controller_spec.rb +19 -0
- data/spec/module_controller_spec.rb +56 -0
- data/spec/regular_expression_extractor_spec.rb +63 -0
- data/spec/response_assertion_spec.rb +69 -0
- data/spec/setup_thread_group_spec.rb +31 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/thread_group_spec.rb +57 -0
- data/spec/throughput_controller_spec.rb +24 -0
- data/spec/transaction_controller_spec.rb +30 -0
- data/spec/user_defined_variables_spec.rb +22 -0
- data/spec/user_parameters_spec.rb +45 -0
- data/spec/with_helpers_spec.rb +57 -0
- data/spec/xpath_extractor_spec.rb +15 -0
- metadata +360 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'stepping thread group' do
|
4
|
+
let(:doc) do
|
5
|
+
test do
|
6
|
+
stepping_thread_group on_sample_error: 'startnextloop', total_threads: 100, initial_delay: 1, start_threads: 2, add_threads: 3, start_every: 4, stop_threads: 5, stop_every: 6, flight_time: 7, rampup: 8
|
7
|
+
end.to_doc
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:fragment) { doc.search("//kg.apc.jmeter.threads.SteppingThreadGroup").first }
|
11
|
+
it 'should match on on_sample_error' do
|
12
|
+
expect(fragment.search(".//stringProp[@name='ThreadGroup.on_sample_error']").text).to eq 'startnextloop'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should match on total_threads' do
|
16
|
+
expect(fragment.search(".//stringProp[@name='ThreadGroup.num_threads']").text).to eq '100'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should match on initial_delay' do
|
20
|
+
expect(fragment.search(".//stringProp[@name='Threads initial delay']").text).to eq '1'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should match on start_threads' do
|
24
|
+
expect(fragment.search(".//stringProp[@name='Start users count']").text).to eq '2'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should match on add_threads' do
|
28
|
+
expect(fragment.search(".//stringProp[@name='Start users count burst']").text).to eq '3'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should match on start_every' do
|
32
|
+
expect(fragment.search(".//stringProp[@name='Start users period']").text).to eq '4'
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should match on stop_threads' do
|
36
|
+
expect(fragment.search(".//stringProp[@name='Stop users count']").text).to eq '5'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should match on stop_every' do
|
40
|
+
expect(fragment.search(".//stringProp[@name='Stop users period']").text).to eq '6'
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should match on flight_time' do
|
44
|
+
expect(fragment.search(".//stringProp[@name='flighttime']").text).to eq '7'
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should match on rampup' do
|
48
|
+
expect(fragment.search(".//stringProp[@name='rampUp']").text).to eq '8'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'dummy sampler' do
|
53
|
+
let(:doc) do
|
54
|
+
test do
|
55
|
+
threads do
|
56
|
+
dummy_sampler name: 'dummy sampler name', response_data: 'Some response data'
|
57
|
+
end
|
58
|
+
end.to_doc
|
59
|
+
end
|
60
|
+
|
61
|
+
let(:fragment) { doc.search("//kg.apc.jmeter.samplers.DummySampler").first }
|
62
|
+
|
63
|
+
it 'should match on name' do
|
64
|
+
expect(fragment.attributes['testname'].value).to eq 'dummy sampler name'
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'should match on response data' do
|
68
|
+
expect(fragment.search("//stringProp[@name='RESPONSE_DATA']").text).to eq 'Some response data'
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe 'perfmon collector' do
|
73
|
+
let(:doc) do
|
74
|
+
test do
|
75
|
+
threads do
|
76
|
+
perfmon_collector name: 'perfmon collector name',
|
77
|
+
nodes:
|
78
|
+
[
|
79
|
+
{server: '1.1.1.1', port: 4444, metric: 'CPU', parameters: ''},
|
80
|
+
{server: '2.2.2.2', port: 4444, metric: 'CPU', parameters: ''}
|
81
|
+
],
|
82
|
+
filename: 'perf.jtl',
|
83
|
+
xml: false
|
84
|
+
end
|
85
|
+
end.to_doc
|
86
|
+
end
|
87
|
+
|
88
|
+
let(:fragment) { doc.search("//kg.apc.jmeter.perfmon.PerfMonCollector").first }
|
89
|
+
let(:metric_connections) { fragment.search("//collectionProp[@name='metricConnections']").first }
|
90
|
+
|
91
|
+
it 'should match on name' do
|
92
|
+
expect(fragment.attributes['testname'].value).to eq 'perfmon collector name'
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should match on xml flag' do
|
96
|
+
expect(fragment.search(".//xml").first.text).to eq 'false'
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should match on first server ip' do
|
100
|
+
expect(metric_connections.search("//stringProp[@name='']").first.text).to eq '1.1.1.1'
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe 'redis data set' do
|
105
|
+
describe 'random keep' do
|
106
|
+
let(:doc) do
|
107
|
+
test do
|
108
|
+
threads do
|
109
|
+
redis_data_set name: 'redis data set name',
|
110
|
+
host: 'the_host',
|
111
|
+
port: 1234
|
112
|
+
|
113
|
+
end
|
114
|
+
end.to_doc
|
115
|
+
end
|
116
|
+
|
117
|
+
let(:fragment) { doc.search("//kg.apc.jmeter.config.redis.RedisDataSet").first }
|
118
|
+
|
119
|
+
it 'should have a name' do
|
120
|
+
expect(fragment.attributes['testname'].value).to eq 'redis data set name'
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'should be configured for random keep' do
|
124
|
+
expect(fragment.search("//intProp[@name='getMode']").text).to eq '1'
|
125
|
+
end
|
126
|
+
|
127
|
+
it 'should point to the host' do
|
128
|
+
expect(fragment.search("//stringProp[@name='host']").text).to eq 'the_host'
|
129
|
+
end
|
130
|
+
|
131
|
+
it 'should configure a port' do
|
132
|
+
expect(fragment.search("//stringProp[@name='port']").text).to eq '1234'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe 'random remove' do
|
137
|
+
let(:doc) do
|
138
|
+
test do
|
139
|
+
threads do
|
140
|
+
redis_data_set remove: true
|
141
|
+
end
|
142
|
+
end.to_doc
|
143
|
+
end
|
144
|
+
|
145
|
+
let(:fragment) { doc.search("//kg.apc.jmeter.config.redis.RedisDataSet").first }
|
146
|
+
|
147
|
+
it 'should have a default name' do
|
148
|
+
expect(fragment.attributes['testname'].value).to eq 'Redis Data Set Config'
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'should be configured for random remove' do
|
152
|
+
expect(fragment.search("//intProp[@name='getMode']").text).to eq '0'
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe 'jmx collector' do
|
158
|
+
|
159
|
+
describe 'passing all optionals' do
|
160
|
+
let(:doc) do
|
161
|
+
test do
|
162
|
+
jmx_collector(
|
163
|
+
name: 'some jmx collector name',
|
164
|
+
host: 'localhost',
|
165
|
+
port: 12345,
|
166
|
+
object_name: 'java.lang:type=Memory',
|
167
|
+
attribute_name: 'HeapMemoryUsage',
|
168
|
+
attribute_key: 'committed',
|
169
|
+
jtl: 'path/to/some/dir/file.jtl'
|
170
|
+
)
|
171
|
+
end.to_doc
|
172
|
+
end
|
173
|
+
|
174
|
+
let(:fragment) {
|
175
|
+
doc.search('//kg.apc.jmeter.jmxmon.JMXMonCollector').first }
|
176
|
+
|
177
|
+
it 'should have a name' do
|
178
|
+
expect(fragment.attributes['testname'].value).to eq 'some jmx collector name'
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'should point to the service endpoint' do
|
182
|
+
expect(fragment.search("//stringProp[@name='service_endpoint']").text).to eq 'service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi'
|
183
|
+
end
|
184
|
+
|
185
|
+
it 'should use the object name' do
|
186
|
+
expect(fragment.search("//stringProp[@name='object_name']").text).to eq 'java.lang:type=Memory'
|
187
|
+
end
|
188
|
+
|
189
|
+
it 'should use the attribute name' do
|
190
|
+
expect(fragment.search("//stringProp[@name='attribute_name']").text).to eq 'HeapMemoryUsage'
|
191
|
+
end
|
192
|
+
|
193
|
+
it 'should use the attribute key' do
|
194
|
+
expect(fragment.search("//stringProp[@name='attribute_key']").text).to eq 'committed'
|
195
|
+
end
|
196
|
+
|
197
|
+
it 'should use the jtl path' do
|
198
|
+
expect(fragment.search("//stringProp[@name='filename']").text).to eq 'path/to/some/dir/file.jtl'
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
describe 'passing no optionals' do
|
204
|
+
let(:doc) do
|
205
|
+
test do
|
206
|
+
jmx_collector(
|
207
|
+
host: '127.0.0.1',
|
208
|
+
port: 54321,
|
209
|
+
object_name: 'java.lang:type=Threading',
|
210
|
+
attribute_name: 'ThreadCount',
|
211
|
+
)
|
212
|
+
end.to_doc
|
213
|
+
end
|
214
|
+
|
215
|
+
let(:fragment) {
|
216
|
+
doc.search('//kg.apc.jmeter.jmxmon.JMXMonCollector').first }
|
217
|
+
|
218
|
+
it 'should have a default name' do
|
219
|
+
expect(fragment.attributes['testname'].value).to eq 'JMX Collector'
|
220
|
+
end
|
221
|
+
|
222
|
+
it 'should point to the service endpoint' do
|
223
|
+
expect(fragment.search("//stringProp[@name='service_endpoint']").text).to eq 'service:jmx:rmi:///jndi/rmi://127.0.0.1:54321/jmxrmi'
|
224
|
+
end
|
225
|
+
|
226
|
+
it 'should use the object name' do
|
227
|
+
expect(fragment.search("//stringProp[@name='object_name']").text).to eq 'java.lang:type=Threading'
|
228
|
+
end
|
229
|
+
|
230
|
+
it 'should use the attribute name' do
|
231
|
+
expect(fragment.search("//stringProp[@name='attribute_name']").text).to eq 'ThreadCount'
|
232
|
+
end
|
233
|
+
|
234
|
+
it 'should use an empty attribute key' do
|
235
|
+
expect(fragment.search("//stringProp[@name='attribute_key']").text).to eq ''
|
236
|
+
end
|
237
|
+
|
238
|
+
it 'should use an empty jtl path' do
|
239
|
+
expect(fragment.search("//stringProp[@name='filename']").text).to eq ''
|
240
|
+
end
|
241
|
+
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'json extract' do
|
4
|
+
let(:doc) do
|
5
|
+
test do
|
6
|
+
extract json: '.test.path', name: 'my_json'
|
7
|
+
end.to_doc
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:fragment) { doc.search("//com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor").first }
|
11
|
+
|
12
|
+
it 'should match on json path' do
|
13
|
+
expect(fragment.search(".//stringProp[@name='JSONPATH']").text).to eq '.test.path'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should match on json var' do
|
17
|
+
expect(fragment.search(".//stringProp[@name='VAR']").text).to eq 'my_json'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'assertions' do
|
4
|
+
describe 'json assertion' do
|
5
|
+
let(:doc) do
|
6
|
+
test do
|
7
|
+
visit '/' do
|
8
|
+
assert json: '.key', value: 'value'
|
9
|
+
end
|
10
|
+
end.to_doc
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:fragment) { doc.search('//com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion').first }
|
14
|
+
|
15
|
+
it 'should match on expected value' do
|
16
|
+
expect(fragment.search(".//stringProp[@name='EXPECTED_VALUE']").text).to eq "value"
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should match on json path' do
|
20
|
+
expect(fragment.search(".//stringProp[@name='JSON_PATH']").text).to eq ".key"
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should have json validation by default' do
|
24
|
+
expect(fragment.search(".//boolProp[@name='JSONVALIDATION']").text).to eq "true"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'disabled elements' do
|
4
|
+
let(:doc) do
|
5
|
+
test do
|
6
|
+
header name: 'Accept', value: '*', enabled: false
|
7
|
+
end.to_doc
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:fragment) { doc.search('//HeaderManager') }
|
11
|
+
|
12
|
+
it 'should be disabled' do
|
13
|
+
expect(fragment.first.attributes['enabled'].value).to eq 'false'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'If' do
|
18
|
+
let(:doc) do
|
19
|
+
test do
|
20
|
+
threads do
|
21
|
+
If condition: '2>1' do
|
22
|
+
visit url: "/"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end.to_doc
|
26
|
+
end
|
27
|
+
|
28
|
+
let(:fragment) { doc.search("//IfController").first }
|
29
|
+
|
30
|
+
it 'should match on If' do
|
31
|
+
expect(fragment.search(".//stringProp[@name='IfController.condition']").text).to eq '2>1'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'exists' do
|
36
|
+
let(:doc) do
|
37
|
+
test do
|
38
|
+
threads do
|
39
|
+
exists 'apple' do
|
40
|
+
visit url: "/"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end.to_doc
|
44
|
+
end
|
45
|
+
|
46
|
+
let(:fragment) { doc.search("//IfController").first }
|
47
|
+
|
48
|
+
it 'should match on exists' do
|
49
|
+
expect(fragment.search(".//stringProp[@name='IfController.condition']").text).to eq '"${apple}" != "\${apple}"'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'While' do
|
54
|
+
let(:doc) do
|
55
|
+
test do
|
56
|
+
threads do
|
57
|
+
While condition: 'true' do
|
58
|
+
visit url: "/"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end.to_doc
|
62
|
+
end
|
63
|
+
|
64
|
+
let(:fragment) { doc.search('//WhileController').first }
|
65
|
+
|
66
|
+
it 'should match on While' do
|
67
|
+
expect(fragment.search(".//stringProp[@name='WhileController.condition']").text).to eq 'true'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe 'Counter' do
|
72
|
+
let(:doc) do
|
73
|
+
test do
|
74
|
+
threads do
|
75
|
+
visit url: "/" do
|
76
|
+
counter start: 1, per_user: true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end.to_doc
|
80
|
+
end
|
81
|
+
|
82
|
+
let(:fragment) { doc.search('//CounterConfig').first }
|
83
|
+
|
84
|
+
it 'should match on 5 Loops' do
|
85
|
+
expect(fragment.search(".//boolProp[@name='CounterConfig.per_user']").text).to eq 'true'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe 'Switch' do
|
90
|
+
let(:doc) do
|
91
|
+
test do
|
92
|
+
threads do
|
93
|
+
Switch value: 'cat' do
|
94
|
+
visit url: "/"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end.to_doc
|
98
|
+
end
|
99
|
+
|
100
|
+
let(:fragment) { doc.search('//SwitchController').first }
|
101
|
+
|
102
|
+
it 'should match on Switch' do
|
103
|
+
expect(fragment.search(".//stringProp[@name='SwitchController.value']").text).to eq 'cat'
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe 'Nested controllers' do
|
108
|
+
let(:doc) do
|
109
|
+
test do
|
110
|
+
Simple name: 'node1.1' do
|
111
|
+
Simple name: 'node2.1'
|
112
|
+
Simple name: 'node2.2' do
|
113
|
+
Simple name: 'node3.1'
|
114
|
+
end
|
115
|
+
Simple name: 'node2.3'
|
116
|
+
end
|
117
|
+
Simple name: 'node1.2'
|
118
|
+
end.to_doc
|
119
|
+
end
|
120
|
+
|
121
|
+
let(:node1_1) { doc.search("//GenericController[@testname='node1.1']").first }
|
122
|
+
let(:node1_2) { doc.search("//GenericController[@testname='node1.2']").first }
|
123
|
+
|
124
|
+
let(:node2_1) { doc.search("//GenericController[@testname='node2.1']").first }
|
125
|
+
let(:node2_2) { doc.search("//GenericController[@testname='node2.2']").first }
|
126
|
+
let(:node2_3) { doc.search("//GenericController[@testname='node2.3']").first }
|
127
|
+
|
128
|
+
let(:node3_1) { doc.search("//GenericController[@testname='node3.1']").first }
|
129
|
+
|
130
|
+
it 'nodes should have hashTree as its parent' do
|
131
|
+
[node1_1, node1_2, node2_1, node2_2, node2_3, node3_1].each do |node|
|
132
|
+
expect(node.parent.name).to eq 'hashTree'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe 'node3_1' do
|
137
|
+
it 'parent parent should be node2_2' do
|
138
|
+
expect(node3_1.parent).to eq node2_2.next
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe 'node1_2' do
|
143
|
+
it 'previous non hashTree sibling is node1_1' do
|
144
|
+
expect(node1_2.previous.previous).to eq node1_1
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'loop' do
|
4
|
+
let(:doc) do
|
5
|
+
test do
|
6
|
+
threads do
|
7
|
+
loops count: 5 do
|
8
|
+
visit url: "/"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end.to_doc
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:fragment) { doc.search('//LoopController').first }
|
15
|
+
|
16
|
+
it 'should match on Loops' do
|
17
|
+
expect(fragment.search(".//stringProp[@name='LoopController.loops']").text).to eq '5'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'module controllers' do
|
4
|
+
let(:doc) do
|
5
|
+
test name: 'tests' do
|
6
|
+
threads 1, name: 'threads' do
|
7
|
+
Simple name: 'controller_to_call'
|
8
|
+
end
|
9
|
+
threads 1 do
|
10
|
+
module_controller name: 'modules', node_path: [
|
11
|
+
'WorkBench',
|
12
|
+
'tests',
|
13
|
+
'threads',
|
14
|
+
'controller_to_call'
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end.to_doc
|
18
|
+
end
|
19
|
+
|
20
|
+
let(:simple_controller) { doc.search("//GenericController").first }
|
21
|
+
let(:test_module) { doc.search("//ModuleController").first }
|
22
|
+
let(:nodes) { test_module.search(".//stringProp") }
|
23
|
+
|
24
|
+
it 'should have a node path' do
|
25
|
+
expect(nodes.length).to eq 4
|
26
|
+
expect(nodes[0].text).to eq 'WorkBench'
|
27
|
+
expect(nodes[1].text).to eq 'tests'
|
28
|
+
expect(nodes[2].text).to eq 'threads'
|
29
|
+
expect(nodes[3].text).to eq 'controller_to_call'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'module controllers with test fragment' do
|
34
|
+
let(:doc) do
|
35
|
+
test do
|
36
|
+
test_fragment name: 'some_test_fragment', enabled: 'false' do
|
37
|
+
get name: 'Home Page', url: 'http://google.com'
|
38
|
+
end
|
39
|
+
|
40
|
+
threads count: 1 do
|
41
|
+
module_controller test_fragment: 'WorkBench/TestPlan/some_test_fragment'
|
42
|
+
end
|
43
|
+
end.to_doc
|
44
|
+
end
|
45
|
+
|
46
|
+
let(:simple_controller) { doc.search("//GenericController").first }
|
47
|
+
let(:test_module) { doc.search("//ModuleController").first }
|
48
|
+
let(:nodes) { test_module.search(".//stringProp") }
|
49
|
+
|
50
|
+
it 'should have a node path specified by test fragment' do
|
51
|
+
expect(nodes.length).to eq 3
|
52
|
+
expect(nodes[0].text).to eq 'WorkBench'
|
53
|
+
expect(nodes[1].text).to eq 'TestPlan'
|
54
|
+
expect(nodes[2].text).to eq 'some_test_fragment'
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'regular_expression_extractor' do
|
4
|
+
describe 'standard scope' do
|
5
|
+
let(:doc) do
|
6
|
+
test do
|
7
|
+
regex pattern: 'pattern', name: 'my_variable', match_number: 1, default: '424242'
|
8
|
+
end.to_doc
|
9
|
+
end
|
10
|
+
|
11
|
+
let(:fragment) { doc.search('//RegexExtractor').first }
|
12
|
+
|
13
|
+
it 'matches on refname' do
|
14
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.refname']").text).to eq 'my_variable'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'matches on regex' do
|
18
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.regex']").text).to eq 'pattern'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'matches on template' do
|
22
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.template']").text).to eq '$1$'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'matches on match_number' do
|
26
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.match_number']").text).to eq '1'
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'matches on default' do
|
30
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.default']").text).to eq '424242'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'matches on scope' do
|
34
|
+
expect(fragment.search(".//stringProp[@name='Sample.scope']").text).to eq 'all'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'variable scope' do
|
39
|
+
let(:doc) do
|
40
|
+
test do
|
41
|
+
regex pattern: 'pattern', name: 'my_variable', variable: 'test_variable'
|
42
|
+
end.to_doc
|
43
|
+
end
|
44
|
+
|
45
|
+
let(:fragment) { doc.search('//RegexExtractor').first }
|
46
|
+
|
47
|
+
it 'matches on refname' do
|
48
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.refname']").text).to eq 'my_variable'
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'matches on regex' do
|
52
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.regex']").text).to eq 'pattern'
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'matches on template' do
|
56
|
+
expect(fragment.search(".//stringProp[@name='RegexExtractor.template']").text).to eq '$1$'
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'matches on scope' do
|
60
|
+
expect(fragment.search(".//stringProp[@name='Sample.scope']").text).to eq 'variable'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'response assertion' do
|
4
|
+
describe 'standard scope' do
|
5
|
+
let(:doc) do
|
6
|
+
test do
|
7
|
+
assert contains: 'We test, tune and secure your site'
|
8
|
+
end.to_doc
|
9
|
+
end
|
10
|
+
|
11
|
+
let(:fragment) { doc.search('//ResponseAssertion').first }
|
12
|
+
|
13
|
+
it 'matches on refname' do
|
14
|
+
expect(fragment.search(".//stringProp[@name='0']").text).to eq 'We test, tune and secure your site'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'matches on test_type' do
|
18
|
+
expect(fragment.search(".//intProp[@name='Assertion.test_type']").text).to eq '2'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'matches on scope' do
|
22
|
+
expect(fragment.search(".//stringProp[@name='Assertion.scope']").text).to eq 'all'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'custom scope' do
|
27
|
+
let(:doc) do
|
28
|
+
test do
|
29
|
+
assert 'not-contains' => 'Something in frames', scope: 'children'
|
30
|
+
end.to_doc
|
31
|
+
end
|
32
|
+
|
33
|
+
let(:fragment) { doc.search('//ResponseAssertion').first }
|
34
|
+
|
35
|
+
it 'matches on refname' do
|
36
|
+
expect(fragment.search(".//stringProp[@name='0']").text).to eq 'Something in frames'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'matches on test_type' do
|
40
|
+
expect(fragment.search(".//intProp[@name='Assertion.test_type']").text).to eq '6'
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'matches on scope' do
|
44
|
+
expect(fragment.search(".//stringProp[@name='Assertion.scope']").text).to eq 'children'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe 'variable scope' do
|
49
|
+
let(:doc) do
|
50
|
+
test do
|
51
|
+
assert 'substring' => 'Something in frames', scope: 'children', variable: 'test'
|
52
|
+
end.to_doc
|
53
|
+
end
|
54
|
+
|
55
|
+
let(:fragment) { doc.search('//ResponseAssertion').first }
|
56
|
+
|
57
|
+
it 'matches on refname' do
|
58
|
+
expect(fragment.search(".//stringProp[@name='0']").text).to eq 'Something in frames'
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'matches on test_type' do
|
62
|
+
expect(fragment.search(".//intProp[@name='Assertion.test_type']").text).to eq '16'
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'matches on scope' do
|
66
|
+
expect(fragment.search(".//stringProp[@name='Assertion.scope']").text).to eq 'variable'
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'setup thread groups' do
|
4
|
+
let(:doc) do
|
5
|
+
test do
|
6
|
+
setup_thread_group count: 101, continue_forever: true, duration: 69
|
7
|
+
end.to_doc
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:fragment) { doc.search("//SetupThreadGroup").first }
|
11
|
+
|
12
|
+
it 'should match on num_threads' do
|
13
|
+
expect(fragment.search(".//stringProp[@name='ThreadGroup.num_threads']").text).to eq '101'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should match on scheduler' do
|
17
|
+
expect(fragment.search(".//boolProp[@name='ThreadGroup.scheduler']").text).to eq 'true'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should match on continue_forever' do
|
21
|
+
expect(fragment.search(".//boolProp[@name='LoopController.continue_forever']").text).to eq 'true'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should match on loops' do
|
25
|
+
expect(fragment.search(".//stringProp[@name='LoopController.loops']").text).to eq '-1'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should match on duration' do
|
29
|
+
expect(fragment.search(".//stringProp[@name='ThreadGroup.duration']").text).to eq '69'
|
30
|
+
end
|
31
|
+
end
|