gridinit-jmeter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/examples/basic_assertion.rb +1 -1
- data/examples/basic_auth.rb +1 -1
- data/examples/basic_cache.rb +1 -1
- data/examples/basic_cookies.rb +1 -1
- data/examples/basic_gc_results.rb +1 -1
- data/examples/basic_grid.rb +2 -2
- data/examples/basic_post.rb +2 -2
- data/examples/basic_proxy.rb +1 -1
- data/examples/basic_results.rb +1 -1
- data/examples/basic_run.rb +4 -4
- data/examples/basic_testplan.rb +5 -5
- data/examples/etsy_login_browse.rb +10 -10
- data/examples/jbhifi_now_search.rb +17 -17
- data/lib/gridinit-jmeter/dsl.rb +3 -3
- data/lib/gridinit-jmeter/samplers/http_sampler.rb +1 -1
- data/lib/gridinit-jmeter/version.rb +1 -1
- metadata +2 -2
data/Gemfile
CHANGED
data/examples/basic_assertion.rb
CHANGED
@@ -6,7 +6,7 @@ test do
|
|
6
6
|
transaction 'Assertions' do
|
7
7
|
visit 'Altentee', 'http://altentee.com/' do
|
8
8
|
assert "contains", "We test, tune and secure your site"
|
9
|
-
assert "not-contains", "Something in frames", {scope
|
9
|
+
assert "not-contains", "Something in frames", {:scope => 'all'}
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/examples/basic_auth.rb
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
require 'gridinit-jmeter'
|
3
3
|
|
4
4
|
test do
|
5
|
-
auth url
|
5
|
+
auth :url => '/', :username => 'tim', :password => 'secret', :domain => 'altentee.com'
|
6
6
|
threads 1 do
|
7
7
|
transaction 'Google Search' do
|
8
8
|
visit 'Home Page', 'http://google.com/'
|
data/examples/basic_cache.rb
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
require 'gridinit-jmeter'
|
3
3
|
|
4
4
|
test do
|
5
|
-
cache clear_each_iteration
|
5
|
+
cache :clear_each_iteration => true
|
6
6
|
threads 1 do
|
7
7
|
transaction 'Google Search' do
|
8
8
|
visit 'Home Page', 'http://google.com/'
|
data/examples/basic_cookies.rb
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
require 'gridinit-jmeter'
|
3
3
|
|
4
4
|
test do
|
5
|
-
cookies clear_each_iteration
|
5
|
+
cookies :clear_each_iteration => false
|
6
6
|
threads 1 do
|
7
7
|
transaction 'Google Search' do
|
8
8
|
visit 'Home Page', 'http://google.com/'
|
data/examples/basic_grid.rb
CHANGED
@@ -3,9 +3,9 @@ require 'gridinit-jmeter'
|
|
3
3
|
|
4
4
|
test do
|
5
5
|
think_time 100
|
6
|
-
threads 100, {ramp_time
|
6
|
+
threads 100, {:ramp_time => 10, :loops => 10} do
|
7
7
|
transaction 'Home Page' do
|
8
8
|
visit 'Altentee', 'http://127.0.0.1:9200/'
|
9
9
|
end
|
10
10
|
end
|
11
|
-
end.grid('4dy-zJLEIgpYkKe6p6JhSQ', {endpoint
|
11
|
+
end.grid('4dy-zJLEIgpYkKe6p6JhSQ', {:endpoint => '127.0.0.1:3000', :region => 'ap_southeast_1'})
|
data/examples/basic_post.rb
CHANGED
@@ -5,9 +5,9 @@ test do
|
|
5
5
|
|
6
6
|
threads 1 do
|
7
7
|
|
8
|
-
transaction 'Post with a Raw Body', {parent
|
8
|
+
transaction 'Post with a Raw Body', {:parent => true} do
|
9
9
|
post 'Home Page', 'http://google.com', {
|
10
|
-
raw_body
|
10
|
+
:raw_body => '{"name":"Big Poncho","price":10,"vendor_attendance_id":24,"product_id":1}'
|
11
11
|
}
|
12
12
|
end
|
13
13
|
|
data/examples/basic_proxy.rb
CHANGED
data/examples/basic_results.rb
CHANGED
data/examples/basic_run.rb
CHANGED
@@ -6,7 +6,7 @@ test do
|
|
6
6
|
visit 'Google Search', 'http://google.com'
|
7
7
|
end
|
8
8
|
end.run(
|
9
|
-
path
|
10
|
-
file
|
11
|
-
log
|
12
|
-
jtl
|
9
|
+
:path => '',
|
10
|
+
:file => 'jmeter.jmx',
|
11
|
+
:log => 'jmeter.log',
|
12
|
+
:jtl => 'results.jtl')
|
data/examples/basic_testplan.rb
CHANGED
@@ -6,14 +6,14 @@ endpoint = 'localhost:3000'
|
|
6
6
|
|
7
7
|
test do
|
8
8
|
|
9
|
-
cache clear_each_iteration
|
9
|
+
cache :clear_each_iteration => true
|
10
10
|
cookies
|
11
11
|
|
12
12
|
threads 100 do
|
13
13
|
|
14
14
|
random_timer 3000, 3000
|
15
15
|
|
16
|
-
transaction 'First Visit', {parent
|
16
|
+
transaction 'First Visit', {:parent => true} do
|
17
17
|
visit 'Home Page', "#{base_url}/" do
|
18
18
|
extract 'csrf-token', "content='(.+?)' name='csrf-token'"
|
19
19
|
end
|
@@ -21,9 +21,9 @@ test do
|
|
21
21
|
|
22
22
|
transaction 'Login' do
|
23
23
|
submit 'Submit Form', "#{base_url}/login", {
|
24
|
-
fill_in
|
25
|
-
username
|
26
|
-
password
|
24
|
+
:fill_in => {
|
25
|
+
:username => 'tim',
|
26
|
+
:password => 'password',
|
27
27
|
'csrf-token' => '${csrf-token}'
|
28
28
|
}
|
29
29
|
}
|
@@ -3,13 +3,13 @@ require 'gridinit-jmeter'
|
|
3
3
|
|
4
4
|
test do
|
5
5
|
|
6
|
-
defaults domain
|
6
|
+
defaults :domain => 'www.etsy.com'
|
7
7
|
|
8
|
-
cache clear_each_iteration
|
8
|
+
cache :clear_each_iteration => true
|
9
9
|
|
10
10
|
cookies
|
11
11
|
|
12
|
-
threads 1, {loops
|
12
|
+
threads 1, {:loops => 10} do
|
13
13
|
|
14
14
|
random_timer 1000, 3000
|
15
15
|
|
@@ -22,13 +22,13 @@ test do
|
|
22
22
|
once do
|
23
23
|
transaction '02_etsy_signin' do
|
24
24
|
submit 'signin', 'https://www.etsy.com/signin', {
|
25
|
-
fill_in
|
26
|
-
username
|
27
|
-
password
|
28
|
-
persistent
|
29
|
-
from_page
|
30
|
-
from_action
|
31
|
-
from_overlay
|
25
|
+
:fill_in => {
|
26
|
+
:username => 'tim.koops@gmail.com',
|
27
|
+
:password => ARGV[0],
|
28
|
+
:persistent => 1,
|
29
|
+
:from_page => 'http://www.etsy.com/',
|
30
|
+
:from_action => '',
|
31
|
+
:from_overlay => 1
|
32
32
|
}
|
33
33
|
} do
|
34
34
|
assert 'contains', 'Tim'
|
@@ -5,12 +5,12 @@ require 'open-uri'
|
|
5
5
|
test do
|
6
6
|
|
7
7
|
defaults(
|
8
|
-
domain
|
9
|
-
protocol
|
10
|
-
image_parser
|
11
|
-
concurrentDwn
|
12
|
-
embedded_url_re
|
13
|
-
concurrentPool
|
8
|
+
:domain => 'now.jbhifi.com.au',
|
9
|
+
:protocol => 'https',
|
10
|
+
:image_parser => true,
|
11
|
+
:concurrentDwn => true,
|
12
|
+
:embedded_url_re => '.+?now.((?!\$\{).)*$',
|
13
|
+
:concurrentPool => 4
|
14
14
|
)
|
15
15
|
|
16
16
|
header(
|
@@ -18,20 +18,20 @@ test do
|
|
18
18
|
'Accept' => '*/*'
|
19
19
|
)
|
20
20
|
|
21
|
-
cache clear_each_iteration
|
21
|
+
cache :clear_each_iteration => true
|
22
22
|
|
23
23
|
cookies
|
24
24
|
|
25
|
-
threads 3, {loops
|
25
|
+
threads 3, {:loops => 3} do
|
26
26
|
|
27
27
|
random_timer 1000, 1500
|
28
28
|
|
29
29
|
transaction 'jbhifi_home' do
|
30
30
|
visit 'home', '/'
|
31
31
|
visit 'choose', '/music/Home/Choose/?_=${__time(,)}', {
|
32
|
-
follow_redirects
|
33
|
-
image_parser
|
34
|
-
embedded_url_re
|
32
|
+
:follow_redirects => false,
|
33
|
+
:image_parser => true,
|
34
|
+
:embedded_url_re => 'none',
|
35
35
|
} do
|
36
36
|
header('X-Requested-With' => 'XMLHttpRequest')
|
37
37
|
assert 'contains', 'WELCOME TO JB HI-FI NOW'
|
@@ -55,7 +55,7 @@ test do
|
|
55
55
|
|
56
56
|
transaction'jbhifi_search' do
|
57
57
|
post 'search', '/music/Search/Search', {
|
58
|
-
fill_in
|
58
|
+
:fill_in => {
|
59
59
|
'searchType' => 'KW',
|
60
60
|
'keyword' => 'deadmau5',
|
61
61
|
'numRecords' => 25
|
@@ -63,22 +63,22 @@ test do
|
|
63
63
|
} do
|
64
64
|
header('X-Requested-With' => 'XMLHttpRequest')
|
65
65
|
extract 'id', '"c":"(.+?)"', {
|
66
|
-
match_number
|
67
|
-
template
|
66
|
+
:match_number => 0,
|
67
|
+
:template => '$1$'
|
68
68
|
}
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
72
|
transaction'jbhifi_add_to_playlist' do
|
73
73
|
post 'playlist', '/music/Playlist/AddPreview/', {
|
74
|
-
fill_in
|
74
|
+
:fill_in => {
|
75
75
|
'id' => '${id}'
|
76
76
|
}
|
77
77
|
} do
|
78
78
|
header('X-Requested-With' => 'XMLHttpRequest')
|
79
79
|
extract 'mp3', '"mp3":"(.+?)"', {
|
80
|
-
match_number
|
81
|
-
template
|
80
|
+
:match_number => 0,
|
81
|
+
:template => '$1$'
|
82
82
|
}
|
83
83
|
end
|
84
84
|
end
|
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -31,9 +31,9 @@ module Gridinit
|
|
31
31
|
@root.at_xpath("//jmeterTestPlan/hashTree") << node.doc.children << hash_tree
|
32
32
|
|
33
33
|
variables(
|
34
|
-
name
|
35
|
-
value
|
36
|
-
comments
|
34
|
+
:name => 'testguid',
|
35
|
+
:value => '${__P(testguid,${__time(,)})}',
|
36
|
+
:comments => 'The testguid variable is mandatory when running on the Grid.') {}
|
37
37
|
end
|
38
38
|
|
39
39
|
def variables(params={}, &block)
|
@@ -34,7 +34,7 @@ module Gridinit
|
|
34
34
|
raw_body(params) if params[:raw_body]
|
35
35
|
params[:params] && params[:params].split('&').each do |param|
|
36
36
|
name,value = param.split('=')
|
37
|
-
fill_in({ fill_in
|
37
|
+
fill_in({ :fill_in => { "#{name}" => value }, :always_encode => params[:always_encode] })
|
38
38
|
end
|
39
39
|
update params
|
40
40
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|