@@ -249,33 +249,18 @@ import org.apache.commons.io.FileUtils;
249
249
<boolProp name =" TransactionController.includeTimers" >false</boolProp >
250
250
</TransactionController >
251
251
<hashTree >
252
- <HTTPSamplerProxy guiclass =" HttpTestSampleGui" testclass =" HTTPSamplerProxy" testname =" 100 /servicedesk/customer/user/login" enabled = " true " >
253
- <stringProp name =" HTTPSampler.path" >${application.postfix}/servicedesk/customer/user/ login</stringProp >
252
+ <HTTPSamplerProxy guiclass =" HttpTestSampleGui" testclass =" HTTPSamplerProxy" testname =" 100 /servicedesk/customer/user/login" >
253
+ <stringProp name =" HTTPSampler.path" >${application.postfix}/login.jsp </stringProp >
254
254
<boolProp name =" HTTPSampler.follow_redirects" >true</boolProp >
255
- <stringProp name =" HTTPSampler.method" >POST </stringProp >
255
+ <stringProp name =" HTTPSampler.method" >GET </stringProp >
256
256
<boolProp name =" HTTPSampler.use_keepalive" >true</boolProp >
257
257
<boolProp name =" HTTPSampler.postBodyRaw" >false</boolProp >
258
258
<elementProp name =" HTTPsampler.Arguments" elementType =" Arguments" guiclass =" HTTPArgumentsPanel" testclass =" Arguments" testname =" User Defined Variables" >
259
- <collectionProp name =" Arguments.arguments" >
260
- <elementProp name =" os_password" elementType =" HTTPArgument" >
261
- <boolProp name =" HTTPArgument.always_encode" >true</boolProp >
262
- <stringProp name =" Argument.name" >os_password</stringProp >
263
- <stringProp name =" Argument.value" >${password}</stringProp >
264
- <stringProp name =" Argument.metadata" >=</stringProp >
265
- <boolProp name =" HTTPArgument.use_equals" >true</boolProp >
266
- </elementProp >
267
- <elementProp name =" os_username" elementType =" HTTPArgument" >
268
- <boolProp name =" HTTPArgument.always_encode" >true</boolProp >
269
- <stringProp name =" Argument.name" >os_username</stringProp >
270
- <stringProp name =" Argument.value" >${username}</stringProp >
271
- <stringProp name =" Argument.metadata" >=</stringProp >
272
- <boolProp name =" HTTPArgument.use_equals" >true</boolProp >
273
- </elementProp >
274
- </collectionProp >
259
+ <collectionProp name =" Arguments.arguments" />
275
260
</elementProp >
276
261
</HTTPSamplerProxy >
277
262
<hashTree >
278
- <HeaderManager guiclass =" HeaderPanel" testclass =" HeaderManager" testname =" HTTP Header manager" >
263
+ <HeaderManager guiclass =" HeaderPanel" testclass =" HeaderManager" testname =" HTTP Header manager" enabled = " true " >
279
264
<collectionProp name =" HeaderManager.headers" >
280
265
<elementProp name =" Accept" elementType =" Header" >
281
266
<stringProp name =" Header.name" >Accept</stringProp >
@@ -296,6 +281,147 @@ import org.apache.commons.io.FileUtils;
296
281
</collectionProp >
297
282
</HeaderManager >
298
283
<hashTree />
284
+ <RegexExtractor guiclass =" RegexExtractorGui" testclass =" RegexExtractor" testname =" legacy login form check" enabled =" true" >
285
+ <stringProp name =" RegexExtractor.useHeaders" >false</stringProp >
286
+ <stringProp name =" RegexExtractor.refname" >legacy_form</stringProp >
287
+ <stringProp name =" RegexExtractor.regex" >login-form-remember-me</stringProp >
288
+ <stringProp name =" RegexExtractor.template" >$1$</stringProp >
289
+ <stringProp name =" RegexExtractor.default" >NOT_FOUND</stringProp >
290
+ <stringProp name =" RegexExtractor.match_number" >1</stringProp >
291
+ <stringProp name =" Sample.scope" >all</stringProp >
292
+ <stringProp name =" Scope.variable" ></stringProp >
293
+ <boolProp name =" RegexExtractor.default_empty_value" >false</boolProp >
294
+ </RegexExtractor >
295
+ <hashTree />
296
+ <JSR223PostProcessor guiclass =" TestBeanGUI" testclass =" JSR223PostProcessor" testname =" set legacy form type" enabled =" true" >
297
+ <stringProp name =" scriptLanguage" >groovy</stringProp >
298
+ <stringProp name =" parameters" ></stringProp >
299
+ <stringProp name =" filename" ></stringProp >
300
+ <stringProp name =" cacheKey" >true</stringProp >
301
+ <stringProp name =" script" >String loginform = vars.get(" legacy_form" );
302
+
303
+ if (" NOT_FOUND" .equals(loginform)) {
304
+ vars.put(" legacy_login_form" , " false" );
305
+ log.info(" 2sv flow detected" );
306
+ } else {
307
+ vars.put(" legacy_login_form" , " true" );
308
+ log.info(" Legacy login flow detected" );
309
+ }
310
+ </stringProp >
311
+ </JSR223PostProcessor >
312
+ <hashTree />
313
+ <JSR223PostProcessor guiclass =" TestBeanGUI" testclass =" JSR223PostProcessor" testname =" Logger" enabled =" true" >
314
+ <stringProp name =" scriptLanguage" >groovy</stringProp >
315
+ <stringProp name =" parameters" ></stringProp >
316
+ <stringProp name =" filename" ></stringProp >
317
+ <stringProp name =" cacheKey" >true</stringProp >
318
+ <stringProp name =" script" >log.info(" Legacy login flow: ${legacy_login_form}" )
319
+ </stringProp >
320
+ </JSR223PostProcessor >
321
+ <hashTree />
322
+ </hashTree >
323
+ <IfController guiclass =" IfControllerPanel" testclass =" IfController" testname =" If legacy login flow" enabled =" true" >
324
+ <stringProp name =" IfController.condition" >${__groovy(vars.get(" legacy_login_form" ) == ' true' )}</stringProp >
325
+ <boolProp name =" IfController.evaluateAll" >false</boolProp >
326
+ <boolProp name =" IfController.useExpression" >true</boolProp >
327
+ </IfController >
328
+ <hashTree >
329
+ <HTTPSamplerProxy guiclass =" HttpTestSampleGui" testclass =" HTTPSamplerProxy" testname =" 100 /servicedesk/customer/user/login" enabled =" true" >
330
+ <stringProp name =" HTTPSampler.path" >${application.postfix}/servicedesk/customer/user/login</stringProp >
331
+ <boolProp name =" HTTPSampler.follow_redirects" >true</boolProp >
332
+ <stringProp name =" HTTPSampler.method" >POST</stringProp >
333
+ <boolProp name =" HTTPSampler.use_keepalive" >true</boolProp >
334
+ <boolProp name =" HTTPSampler.postBodyRaw" >false</boolProp >
335
+ <elementProp name =" HTTPsampler.Arguments" elementType =" Arguments" guiclass =" HTTPArgumentsPanel" testclass =" Arguments" testname =" User Defined Variables" >
336
+ <collectionProp name =" Arguments.arguments" >
337
+ <elementProp name =" os_password" elementType =" HTTPArgument" >
338
+ <boolProp name =" HTTPArgument.always_encode" >true</boolProp >
339
+ <stringProp name =" Argument.name" >os_password</stringProp >
340
+ <stringProp name =" Argument.value" >${password}</stringProp >
341
+ <stringProp name =" Argument.metadata" >=</stringProp >
342
+ <boolProp name =" HTTPArgument.use_equals" >true</boolProp >
343
+ </elementProp >
344
+ <elementProp name =" os_username" elementType =" HTTPArgument" >
345
+ <boolProp name =" HTTPArgument.always_encode" >true</boolProp >
346
+ <stringProp name =" Argument.name" >os_username</stringProp >
347
+ <stringProp name =" Argument.value" >${username}</stringProp >
348
+ <stringProp name =" Argument.metadata" >=</stringProp >
349
+ <boolProp name =" HTTPArgument.use_equals" >true</boolProp >
350
+ </elementProp >
351
+ </collectionProp >
352
+ </elementProp >
353
+ </HTTPSamplerProxy >
354
+ <hashTree >
355
+ <HeaderManager guiclass =" HeaderPanel" testclass =" HeaderManager" testname =" HTTP Header manager" enabled =" true" >
356
+ <collectionProp name =" HeaderManager.headers" >
357
+ <elementProp name =" Accept" elementType =" Header" >
358
+ <stringProp name =" Header.name" >Accept</stringProp >
359
+ <stringProp name =" Header.value" >*/*</stringProp >
360
+ </elementProp >
361
+ <elementProp name =" X-Requested-With" elementType =" Header" >
362
+ <stringProp name =" Header.name" >X-Requested-With</stringProp >
363
+ <stringProp name =" Header.value" >XMLHttpRequest</stringProp >
364
+ </elementProp >
365
+ <elementProp name =" Content-Type" elementType =" Header" >
366
+ <stringProp name =" Header.name" >Content-Type</stringProp >
367
+ <stringProp name =" Header.value" >application/x-www-form-urlencoded</stringProp >
368
+ </elementProp >
369
+ <elementProp name =" " elementType =" Header" >
370
+ <stringProp name =" Header.name" >X-Atlassian-Token</stringProp >
371
+ <stringProp name =" Header.value" >no-check</stringProp >
372
+ </elementProp >
373
+ </collectionProp >
374
+ </HeaderManager >
375
+ <hashTree />
376
+ </hashTree >
377
+ </hashTree >
378
+ <IfController guiclass =" IfControllerPanel" testclass =" IfController" testname =" if 2sv login flow" enabled =" true" >
379
+ <stringProp name =" IfController.condition" >${__groovy(vars.get(" legacy_login_form" ) == ' false' )}</stringProp >
380
+ <boolProp name =" IfController.evaluateAll" >false</boolProp >
381
+ <boolProp name =" IfController.useExpression" >true</boolProp >
382
+ </IfController >
383
+ <hashTree >
384
+ <HTTPSamplerProxy guiclass =" HttpTestSampleGui" testclass =" HTTPSamplerProxy" testname =" 15 /rest/tsv/1.0/authenticate" enabled =" true" >
385
+ <stringProp name =" TestPlan.comments" >2sv login flow</stringProp >
386
+ <stringProp name =" HTTPSampler.path" >${application.postfix}/rest/tsv/1.0/authenticate</stringProp >
387
+ <stringProp name =" HTTPSampler.method" >POST</stringProp >
388
+ <boolProp name =" HTTPSampler.use_keepalive" >true</boolProp >
389
+ <boolProp name =" HTTPSampler.postBodyRaw" >true</boolProp >
390
+ <elementProp name =" HTTPsampler.Arguments" elementType =" Arguments" >
391
+ <collectionProp name =" Arguments.arguments" >
392
+ <elementProp name =" " elementType =" HTTPArgument" >
393
+ <boolProp name =" HTTPArgument.always_encode" >false</boolProp >
394
+ <stringProp name =" Argument.value" >{" username" : " ${username}" ,
395
+ " password" : " ${password}" ,
396
+ " rememberMe" : " True" ,
397
+ " targetUrl" : ""
398
+ }</stringProp >
399
+ <stringProp name =" Argument.metadata" >=</stringProp >
400
+ </elementProp >
401
+ </collectionProp >
402
+ </elementProp >
403
+ </HTTPSamplerProxy >
404
+ <hashTree >
405
+ <HeaderManager guiclass =" HeaderPanel" testclass =" HeaderManager" testname =" HTTP Header Manager" enabled =" true" >
406
+ <collectionProp name =" HeaderManager.headers" >
407
+ <elementProp name =" Content-Type" elementType =" Header" >
408
+ <stringProp name =" Header.name" >Content-Type</stringProp >
409
+ <stringProp name =" Header.value" >application/json</stringProp >
410
+ </elementProp >
411
+ </collectionProp >
412
+ </HeaderManager >
413
+ <hashTree />
414
+ <ResponseAssertion guiclass =" AssertionGui" testclass =" ResponseAssertion" testname =" Response Assertion" enabled =" true" >
415
+ <collectionProp name =" Asserion.test_strings" >
416
+ <stringProp name =" 49586" >200</stringProp >
417
+ </collectionProp >
418
+ <stringProp name =" Assertion.custom_message" ></stringProp >
419
+ <stringProp name =" Assertion.test_field" >Assertion.response_code</stringProp >
420
+ <boolProp name =" Assertion.assume_success" >false</boolProp >
421
+ <intProp name =" Assertion.test_type" >2</intProp >
422
+ </ResponseAssertion >
423
+ <hashTree />
424
+ </hashTree >
299
425
</hashTree >
300
426
<HTTPSamplerProxy guiclass =" HttpTestSampleGui" testclass =" HTTPSamplerProxy" testname =" 105 /servicedesk/customer/portals" enabled =" true" >
301
427
<stringProp name =" HTTPSampler.path" >${application.postfix}/servicedesk/customer/portals</stringProp >
0 commit comments