Skip to content

Commit 4299950

Browse files
committed
ACPT-97: Create new Jmeter scenario for new Import REST api endpoint
1 parent 3afe76a commit 4299950

File tree

1 file changed

+174
-8
lines changed

1 file changed

+174
-8
lines changed

setup/performance-toolkit/benchmark.jmx

Lines changed: 174 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@
269269
<stringProp name="Argument.value">${__P(apiBasePercentage,0)}</stringProp>
270270
<stringProp name="Argument.metadata">=</stringProp>
271271
</elementProp>
272+
<elementProp name="apiImportProductsPercentage" elementType="Argument">
273+
<stringProp name="Argument.name">apiImportProductsPercentage</stringProp>
274+
<stringProp name="Argument.value">${__P(apiImportProductsPercentage,0)}</stringProp>
275+
<stringProp name="Argument.metadata">=</stringProp>
276+
</elementProp>
272277
<elementProp name="apiOrderInvoiceShipmentSync" elementType="Argument">
273278
<stringProp name="Argument.name">apiOrderInvoiceShipmentSync</stringProp>
274279
<stringProp name="Argument.value">${__P(apiOrderInvoiceShipmentSync,0)}</stringProp>
@@ -61806,31 +61811,31 @@ if (totalCount == null) {
6180661811
<hashTree/>
6180761812
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true">
6180861813
<stringProp name="VAR">attribute_code_1</stringProp>
61809-
<stringProp name="JSONPATH">$.data.products.filters[1].request_var</stringProp>
61814+
<stringProp name="JSONPATH">$.data.products.aggregations[1].attribute_code</stringProp>
6181061815
<stringProp name="DEFAULT"/>
6181161816
<stringProp name="VARIABLE"/>
6181261817
<stringProp name="SUBJECT">BODY</stringProp>
6181361818
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6181461819
<hashTree/>
6181561820
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true">
6181661821
<stringProp name="VAR">attribute_value_1</stringProp>
61817-
<stringProp name="JSONPATH">$.data.products.filters[1].filter_items[0].value_string</stringProp>
61822+
<stringProp name="JSONPATH">$.data.products.aggregations[1].options[0].value</stringProp>
6181861823
<stringProp name="DEFAULT"/>
6181961824
<stringProp name="VARIABLE"/>
6182061825
<stringProp name="SUBJECT">BODY</stringProp>
6182161826
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6182261827
<hashTree/>
6182361828
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true">
6182461829
<stringProp name="VAR">attribute_code_2</stringProp>
61825-
<stringProp name="JSONPATH">$.data.products.filters[2].request_var</stringProp>
61830+
<stringProp name="JSONPATH">$.data.products.aggregations[2].attribute_code</stringProp>
6182661831
<stringProp name="DEFAULT"/>
6182761832
<stringProp name="VARIABLE"/>
6182861833
<stringProp name="SUBJECT">BODY</stringProp>
6182961834
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6183061835
<hashTree/>
6183161836
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true">
6183261837
<stringProp name="VAR">attribute_value_2</stringProp>
61833-
<stringProp name="JSONPATH">$.data.products.filters[2].filter_items[0].value_string</stringProp>
61838+
<stringProp name="JSONPATH">$.data.products.aggregations[2].options[0].value</stringProp>
6183461839
<stringProp name="DEFAULT"/>
6183561840
<stringProp name="VARIABLE"/>
6183661841
<stringProp name="SUBJECT">BODY</stringProp>
@@ -62072,31 +62077,31 @@ if (totalCount == null) {
6207262077
<hashTree/>
6207362078
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true">
6207462079
<stringProp name="VAR">attribute_code_1</stringProp>
62075-
<stringProp name="JSONPATH">$.data.products.filters[1].request_var</stringProp>
62080+
<stringProp name="JSONPATH">$.data.products.aggregations[1].attribute_code</stringProp>
6207662081
<stringProp name="DEFAULT"/>
6207762082
<stringProp name="VARIABLE"/>
6207862083
<stringProp name="SUBJECT">BODY</stringProp>
6207962084
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6208062085
<hashTree/>
6208162086
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true">
6208262087
<stringProp name="VAR">attribute_value_1</stringProp>
62083-
<stringProp name="JSONPATH">$.data.products.filters[1].filter_items[0].value_string</stringProp>
62088+
<stringProp name="JSONPATH">$.data.products.aggregations[1].options[0].value</stringProp>
6208462089
<stringProp name="DEFAULT"/>
6208562090
<stringProp name="VARIABLE"/>
6208662091
<stringProp name="SUBJECT">BODY</stringProp>
6208762092
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6208862093
<hashTree/>
6208962094
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true">
6209062095
<stringProp name="VAR">attribute_code_2</stringProp>
62091-
<stringProp name="JSONPATH">$.data.products.filters[2].request_var</stringProp>
62096+
<stringProp name="JSONPATH">$.data.products.aggregations[2].attribute_code</stringProp>
6209262097
<stringProp name="DEFAULT"/>
6209362098
<stringProp name="VARIABLE"/>
6209462099
<stringProp name="SUBJECT">BODY</stringProp>
6209562100
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
6209662101
<hashTree/>
6209762102
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true">
6209862103
<stringProp name="VAR">attribute_value_2</stringProp>
62099-
<stringProp name="JSONPATH">$.data.products.filters[2].filter_items[0].value_string</stringProp>
62104+
<stringProp name="JSONPATH">$.data.products.aggregations[2].options[0].value</stringProp>
6210062105
<stringProp name="DEFAULT"/>
6210162106
<stringProp name="VARIABLE"/>
6210262107
<stringProp name="SUBJECT">BODY</stringProp>
@@ -110806,6 +110811,7 @@ vars.put("adminImportFilePath", filepath); </stringProp>
110806110811
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
110807110812
<collectionProp name="Asserion.test_strings">
110808110813
<stringProp name="37280142">File is valid! To start import process</stringProp>
110814+
<stringProp name="1779643498">Checked rows: 1000, checked entities: 1000</stringProp>
110809110815
</collectionProp>
110810110816
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
110811110817
<boolProp name="Assertion.assume_success">false</boolProp>
@@ -111328,6 +111334,7 @@ vars.put("adminImportFilePath", filepath); </stringProp>
111328111334
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
111329111335
<collectionProp name="Asserion.test_strings">
111330111336
<stringProp name="37280142">File is valid! To start import process</stringProp>
111337+
<stringProp name="1779643498">Checked rows: 1000, checked entities: 1000</stringProp>
111331111338
</collectionProp>
111332111339
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
111333111340
<boolProp name="Assertion.assume_success">false</boolProp>
@@ -111471,6 +111478,165 @@ vars.put("adminImportFilePath", filepath); </stringProp>
111471111478
</hashTree>
111472111479

111473111480

111481+
<ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Import Products" enabled="true">
111482+
<intProp name="ThroughputController.style">1</intProp>
111483+
<boolProp name="ThroughputController.perThread">false</boolProp>
111484+
<intProp name="ThroughputController.maxThroughput">1</intProp>
111485+
<stringProp name="ThroughputController.percentThroughput">${apiImportProductsPercentage}</stringProp>
111486+
<stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController>
111487+
<hashTree>
111488+
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true">
111489+
<stringProp name="script">
111490+
var tmpLabel = vars.get("testLabel")
111491+
if (tmpLabel) {
111492+
var testLabel = " (" + tmpLabel + ")"
111493+
if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') {
111494+
if (sampler.getName().indexOf(testLabel) == -1) {
111495+
sampler.setName(sampler.getName() + testLabel);
111496+
}
111497+
} else if (sampler.getName().indexOf("SetUp - ") == -1) {
111498+
sampler.setName("SetUp - " + sampler.getName());
111499+
}
111500+
} else {
111501+
testLabel = ""
111502+
}
111503+
111504+
111505+
</stringProp>
111506+
<stringProp name="scriptLanguage">javascript</stringProp>
111507+
<stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor>
111508+
<hashTree/>
111509+
<BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true">
111510+
<stringProp name="BeanShellSampler.query">
111511+
vars.put("testLabel", "API Import Products");
111512+
</stringProp>
111513+
<boolProp name="BeanShellSampler.resetInterpreter">true</boolProp>
111514+
</BeanShellSampler>
111515+
<hashTree/>
111516+
111517+
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
111518+
<collectionProp name="HeaderManager.headers">
111519+
<elementProp name="" elementType="Header">
111520+
<stringProp name="Header.name">Content-Type</stringProp>
111521+
<stringProp name="Header.value">application/json</stringProp>
111522+
</elementProp>
111523+
<elementProp name="" elementType="Header">
111524+
<stringProp name="Header.name">Accept</stringProp>
111525+
<stringProp name="Header.value">*/*</stringProp>
111526+
</elementProp>
111527+
</collectionProp>
111528+
<stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager>
111529+
<hashTree/>
111530+
111531+
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true">
111532+
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
111533+
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
111534+
<collectionProp name="Arguments.arguments">
111535+
<elementProp name="" elementType="HTTPArgument">
111536+
<boolProp name="HTTPArgument.always_encode">false</boolProp>
111537+
<stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp>
111538+
<stringProp name="Argument.metadata">=</stringProp>
111539+
</elementProp>
111540+
</collectionProp>
111541+
</elementProp>
111542+
<stringProp name="HTTPSampler.domain"/>
111543+
<stringProp name="HTTPSampler.port"/>
111544+
<stringProp name="HTTPSampler.connect_timeout">60000</stringProp>
111545+
<stringProp name="HTTPSampler.response_timeout">200000</stringProp>
111546+
<stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp>
111547+
<stringProp name="HTTPSampler.contentEncoding"/>
111548+
<stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp>
111549+
<stringProp name="HTTPSampler.method">POST</stringProp>
111550+
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
111551+
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
111552+
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
111553+
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
111554+
<boolProp name="HTTPSampler.monitor">false</boolProp>
111555+
<stringProp name="HTTPSampler.embedded_url_re"/>
111556+
<stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy>
111557+
<hashTree>
111558+
<com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true">
111559+
<stringProp name="VAR">admin_token</stringProp>
111560+
<stringProp name="JSONPATH">$</stringProp>
111561+
<stringProp name="DEFAULT"/>
111562+
<stringProp name="VARIABLE"/>
111563+
<stringProp name="SUBJECT">BODY</stringProp>
111564+
</com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor>
111565+
<hashTree/>
111566+
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true">
111567+
<collectionProp name="Asserion.test_strings">
111568+
<stringProp name="484395188">^.{10,}$</stringProp>
111569+
</collectionProp>
111570+
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
111571+
<boolProp name="Assertion.assume_success">false</boolProp>
111572+
<intProp name="Assertion.test_type">1</intProp>
111573+
<stringProp name="Assertion.scope">variable</stringProp>
111574+
<stringProp name="Scope.variable">admin_token</stringProp>
111575+
</ResponseAssertion>
111576+
<hashTree/>
111577+
</hashTree>
111578+
111579+
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
111580+
<collectionProp name="HeaderManager.headers">
111581+
<elementProp name="" elementType="Header">
111582+
<stringProp name="Header.name">Authorization</stringProp>
111583+
<stringProp name="Header.value">Bearer ${admin_token}</stringProp>
111584+
</elementProp>
111585+
</collectionProp>
111586+
<stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager>
111587+
<hashTree/>
111588+
111589+
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Import Products File To Base64" enabled="true">
111590+
<stringProp name="scriptLanguage">groovy</stringProp>
111591+
<stringProp name="parameters"/>
111592+
<stringProp name="filename"/>
111593+
<stringProp name="cacheKey">true</stringProp>
111594+
<stringProp name="script">def fileAsBase64 = new File("${files_folder}${adminImportProductFilePath}").bytes.encodeBase64().toString()
111595+
vars.put("importProductsFileToBase64", fileAsBase64)</stringProp>
111596+
<stringProp name="TestPlan.comments">tool/fragments/ce/api/import_products_file_to_base64.jmx</stringProp></JSR223Sampler>
111597+
<hashTree/>
111598+
111599+
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API Import Products" enabled="true">
111600+
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
111601+
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
111602+
<collectionProp name="Arguments.arguments">
111603+
<elementProp name="" elementType="HTTPArgument">
111604+
<boolProp name="HTTPArgument.always_encode">false</boolProp>
111605+
<stringProp name="Argument.value">{"source":{"entity":"catalog_product", "behavior":"append","validationStrategy": "validation-stop-on-errors", "allowedErrorCount":"10","csvData":"${importProductsFileToBase64}"}}</stringProp>
111606+
<stringProp name="Argument.metadata">=</stringProp>
111607+
</elementProp>
111608+
</collectionProp>
111609+
</elementProp>
111610+
<stringProp name="HTTPSampler.domain"/>
111611+
<stringProp name="HTTPSampler.port"/>
111612+
<stringProp name="HTTPSampler.connect_timeout">60000</stringProp>
111613+
<stringProp name="HTTPSampler.response_timeout">200000</stringProp>
111614+
<stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp>
111615+
<stringProp name="HTTPSampler.contentEncoding"/>
111616+
<stringProp name="HTTPSampler.path">${base_path}/rest/default/V1/import/csv</stringProp>
111617+
<stringProp name="HTTPSampler.method">POST</stringProp>
111618+
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
111619+
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
111620+
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
111621+
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
111622+
<boolProp name="HTTPSampler.monitor">false</boolProp>
111623+
<stringProp name="HTTPSampler.embedded_url_re"/>
111624+
<stringProp name="TestPlan.comments">tool/fragments/ce/api/import_products.jmx</stringProp>
111625+
</HTTPSamplerProxy>
111626+
<hashTree>
111627+
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true">
111628+
<collectionProp name="Asserion.test_strings">
111629+
<stringProp name="-1968591688">Entities Processed\: 1000\"\]</stringProp>
111630+
</collectionProp>
111631+
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
111632+
<boolProp name="Assertion.assume_success">false</boolProp>
111633+
<intProp name="Assertion.test_type">2</intProp>
111634+
</ResponseAssertion>
111635+
<hashTree/>
111636+
</hashTree>
111637+
</hashTree>
111638+
111639+
111474111640
<ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API" enabled="true">
111475111641
<intProp name="ThroughputController.style">1</intProp>
111476111642
<boolProp name="ThroughputController.perThread">false</boolProp>

0 commit comments

Comments
 (0)