ruby-jmeter 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -321,7 +321,7 @@ end
321
321
 
322
322
  ## Roadmap
323
323
 
324
- This is very much a work-in-progress. Future work is being sponsored by flood.io. Get in touch with us if you'd like to be involved.
324
+ This work is being sponsored by flood.io. Get in touch with us if you'd like to be involved.
325
325
 
326
326
  ## Contributing
327
327
 
@@ -0,0 +1,78 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'ruby-jmeter'
3
+
4
+ test do
5
+
6
+ defaults domain: 'www.immi.gov.au',
7
+ protocol: 'http',
8
+ image_parser: true,
9
+ concurrentDwn: true,
10
+ concurrentPool: 4
11
+
12
+ cache
13
+
14
+ cookies
15
+
16
+ with_user_agent :iphone
17
+
18
+ header [
19
+ { name: 'Accept-Encoding', value: 'gzip,deflate,sdch' },
20
+ { name: 'Accept', value: 'text/javascript, text/html, application/xml, text/xml, */*' }
21
+ ]
22
+
23
+ threads 1, {
24
+ rampup: 1,
25
+ scheduler: true,
26
+ duration: 300,
27
+ continue_forever: true
28
+ } do
29
+
30
+ random_timer 1000, 5000
31
+
32
+ transaction 'visa_wizard' do
33
+ visit '/visawizard' do
34
+ extract xpath: "//select[@id='Q1']/option/@value", name: 'q1', tolerant: true
35
+ end
36
+ end
37
+ # ${__Random(1,${q1_matchNr},n)}
38
+ # $__V{q1_${n}}
39
+ # $__V{q1_${${__Random(1,${q1_matchNr},)}}}
40
+
41
+
42
+ debug_sampler
43
+
44
+ transaction 'visa_questions' do
45
+ # get '/ecp_new/assess/get?Q1=TRA&Q2=UK&Q3=38&Q4=TRAN&Q5=UK' do
46
+ # with_xhr
47
+ # assert contains: 'p,'
48
+ # extract regex: '(INF\d+)', name: 'answer'
49
+ # end
50
+ get '/ecp_new/assess/get',
51
+ fill_in: {
52
+ 'Q1' => '${q1_2}',
53
+ 'Q2' => 'UK',
54
+ 'Q3' => '38',
55
+ 'Q4' => 'TRAN',
56
+ 'Q5' => 'UK'
57
+ } do
58
+ with_xhr
59
+ assert contains: 'p,'
60
+ extract regex: '(INF\d+)', name: 'answer'
61
+ end
62
+ end
63
+
64
+ transaction 'visa_answer' do
65
+ get '/visawizard/inf/${answer}'
66
+ end
67
+
68
+ view_results
69
+
70
+ log filename: '/var/log/flood/custom.log', error_logging: true
71
+
72
+ end
73
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
74
+ # end.jmx
75
+ # end.flood ENV['FLOOD_API_TOKEN'], {
76
+ # region: 'ap-southeast-2',
77
+ # name: 'Demo for Immi'
78
+ # }
@@ -388,7 +388,7 @@ module RubyJmeter
388
388
  :content_type => 'application/octet-stream'
389
389
  }.merge(params)
390
390
  if response.code == 200
391
- logger.info "Flood results at: #{JSON.parse(response)["response"]["link"]}"
391
+ logger.info "Flood results at: #{JSON.parse(response)["response"]["results"]["link"]}"
392
392
  else
393
393
  logger.fatal "Sorry there was an error: #{JSON.parse(response)["error_description"]}"
394
394
  end
@@ -1,3 +1,3 @@
1
1
  module RubyJmeter
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jmeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
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-08-12 00:00:00.000000000 Z
12
+ date: 2013-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -80,6 +80,7 @@ files:
80
80
  - examples/basic_throughput_shaping_timer.rb
81
81
  - examples/basic_user_defined_variables.rb
82
82
  - examples/etsy_login_browse.rb
83
+ - examples/real_immi.gov.au_visa.rb
83
84
  - lib/ruby-jmeter.rb
84
85
  - lib/ruby-jmeter/DSL.md
85
86
  - lib/ruby-jmeter/dsl.rb
@@ -246,4 +247,7 @@ rubygems_version: 1.8.23
246
247
  signing_key:
247
248
  specification_version: 3
248
249
  summary: This is a Ruby based DSL for writing JMeter test plans
249
- test_files: []
250
+ test_files:
251
+ - spec/dsl_spec.rb
252
+ - spec/spec_helper.rb
253
+ - spec/stub.rb