ruby-jmeter 2.11.7 → 2.11.8
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 +4 -4
- data/examples/real_page_objects.rb +27 -0
- data/lib/ruby-jmeter/dsl.rb +1 -1
- data/lib/ruby-jmeter/version.rb +1 -1
- data/spec/dsl_spec.rb +15 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99deb58961a1b46d676136d9acd3d37ec93e2787
|
4
|
+
data.tar.gz: e961ced2509fc856c894c3df5f73e2e0a0511751
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a20e071d86ba0491e3d0c38f4c5e451bbebc61a7ce1c8b07e0c79a8380ba13de60ae4a2e1b301aa47e5b8baab49ca9a81a31f8ad0b0bfd2b55839cea96311ed
|
7
|
+
data.tar.gz: a215cbc73afe7dcf55de35697b16363f7addb6754c6051792402dc643573717f249195e286f847fa273e1c4e21c1ae5c536d3adc4faf3f297102db8acfa5dde8
|
@@ -0,0 +1,27 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
require 'ruby-jmeter'
|
3
|
+
|
4
|
+
# Define your page objects
|
5
|
+
class HomePage
|
6
|
+
def initialize(dsl)
|
7
|
+
@dsl = dsl
|
8
|
+
end
|
9
|
+
|
10
|
+
def visit
|
11
|
+
get name: 'home', url: '/'
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def method_missing method, *args, &block
|
17
|
+
@dsl.__send__ method, *args, &block
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
test do
|
22
|
+
threads count: 1 do
|
23
|
+
# then re-use your page objects in your test plan
|
24
|
+
home = HomePage.new(self)
|
25
|
+
home.visit
|
26
|
+
end
|
27
|
+
end.run(path: '/usr/share/jmeter-2.11/bin/', gui: true)
|
data/lib/ruby-jmeter/dsl.rb
CHANGED
@@ -192,7 +192,7 @@ module RubyJmeter
|
|
192
192
|
def transaction_controller(*args, &block)
|
193
193
|
params = args.shift || {}
|
194
194
|
params = { name: params }.merge(args.shift || {}) if params.class == String
|
195
|
-
params[:parent]
|
195
|
+
params[:parent] = params[:parent] || false
|
196
196
|
params[:includeTimers] = params[:include_timers] || false
|
197
197
|
node = RubyJmeter::TransactionController.new(params)
|
198
198
|
attach_node(node, &block)
|
data/lib/ruby-jmeter/version.rb
CHANGED
data/spec/dsl_spec.rb
CHANGED
@@ -211,19 +211,28 @@ describe "DSL" do
|
|
211
211
|
let(:doc) do
|
212
212
|
test do
|
213
213
|
threads do
|
214
|
-
transaction name: "TC_01", parent:
|
214
|
+
transaction name: "TC_01", parent: false, include_timers: true
|
215
|
+
transaction name: "TC_02", parent: true, include_timers: false
|
215
216
|
end
|
216
217
|
end.to_doc
|
217
218
|
end
|
218
219
|
|
219
|
-
let(:fragment) { doc.search("//TransactionController")
|
220
|
+
let(:fragment) { doc.search("//TransactionController") }
|
220
221
|
|
221
|
-
it 'should match on parent' do
|
222
|
-
fragment.search(".//boolProp[@name='TransactionController.parent']").text.should == '
|
222
|
+
it 'should match on parent when false' do
|
223
|
+
fragment.first.search(".//boolProp[@name='TransactionController.parent']").text.should == 'false'
|
223
224
|
end
|
224
225
|
|
225
|
-
it 'should match on includeTimers' do
|
226
|
-
fragment.search(".//boolProp[@name='TransactionController.includeTimers']").text.should == 'true'
|
226
|
+
it 'should match on includeTimers when true' do
|
227
|
+
fragment.first.search(".//boolProp[@name='TransactionController.includeTimers']").text.should == 'true'
|
228
|
+
end
|
229
|
+
|
230
|
+
it 'should match on parent when true' do
|
231
|
+
fragment.last.search(".//boolProp[@name='TransactionController.parent']").text.should == 'true'
|
232
|
+
end
|
233
|
+
|
234
|
+
it 'should match on includeTimers when false' do
|
235
|
+
fragment.last.search(".//boolProp[@name='TransactionController.includeTimers']").text.should == 'false'
|
227
236
|
end
|
228
237
|
end
|
229
238
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-jmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Koopmans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- examples/etsy_login_browse.rb
|
88
88
|
- examples/real_flood_test_data.rb
|
89
89
|
- examples/real_immi.gov.au_visa.rb
|
90
|
+
- examples/real_page_objects.rb
|
90
91
|
- lib/ruby-jmeter.rb
|
91
92
|
- lib/ruby-jmeter/DSL.md
|
92
93
|
- lib/ruby-jmeter/dsl.rb
|