@@ -42802,71 +42802,6 @@ vars.putObject("category", categories[number]);
42802
42802
<stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler>
42803
42803
<hashTree/>
42804
42804
42805
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_id" enabled="true">
42806
- <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
42807
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
42808
- <collectionProp name="Arguments.arguments">
42809
- <elementProp name="" elementType="HTTPArgument">
42810
- <boolProp name="HTTPArgument.always_encode">false</boolProp>
42811
- <stringProp name="Argument.value">
42812
- {"query":"query categoryList($id: Int!) {\n category(id: $id) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}","variables":{"id":${category_id}},"operationName":"categoryList"}
42813
- </stringProp>
42814
- <stringProp name="Argument.metadata">=</stringProp>
42815
- </elementProp>
42816
- </collectionProp>
42817
- </elementProp>
42818
- <stringProp name="HTTPSampler.domain"/>
42819
- <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp>
42820
- <stringProp name="HTTPSampler.connect_timeout">60000</stringProp>
42821
- <stringProp name="HTTPSampler.response_timeout">200000</stringProp>
42822
- <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp>
42823
- <stringProp name="HTTPSampler.contentEncoding"/>
42824
- <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp>
42825
- <stringProp name="HTTPSampler.method">POST</stringProp>
42826
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
42827
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
42828
- <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
42829
- <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
42830
- <boolProp name="HTTPSampler.monitor">false</boolProp>
42831
- <stringProp name="HTTPSampler.embedded_url_re"/>
42832
- <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/get_category_list_by_category_id.jmx</stringProp></HTTPSamplerProxy>
42833
- <hashTree>
42834
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true">
42835
- <stringProp name="scriptLanguage">javascript</stringProp>
42836
- <stringProp name="parameters"/>
42837
- <stringProp name="filename"/>
42838
- <stringProp name="cacheKey"/>
42839
- <stringProp name="script">var category = vars.getObject("category");
42840
- var response = JSON.parse(prev.getResponseDataAsString());
42841
-
42842
- assertCategoryId(category, response);
42843
- assertCategoryChildren(category, response);
42844
-
42845
- function assertCategoryId(category, response) {
42846
- if (response.data == undefined || response.data.category == undefined || response.data.category.id != category.id) {
42847
- AssertionResult.setFailureMessage("Cannot find category with id \"" + category.id + "\"");
42848
- AssertionResult.setFailure(true);
42849
- }
42850
- }
42851
-
42852
- function assertCategoryChildren(category, response) {
42853
- foundCategory = response.data && response.data.category ? response.data.category : null;
42854
- if (foundCategory) {
42855
- var childrenFound = foundCategory.children.map(function (c) {return parseInt(c.id)});
42856
- var children = category.children.map(function (c) {return parseInt(c)});
42857
- if (JSON.stringify(children.sort()) != JSON.stringify(childrenFound.sort())) {
42858
- AssertionResult.setFailureMessage("Cannot math children categories \"" + JSON.stringify(children) + "\" for to found one: \"" + JSON.stringify(childrenFound) + "\"");
42859
- AssertionResult.setFailure(true);
42860
- }
42861
- }
42862
-
42863
- }
42864
-
42865
- </stringProp>
42866
- </JSR223Assertion>
42867
- <hashTree/>
42868
- </hashTree>
42869
-
42870
42805
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true">
42871
42806
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
42872
42807
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
0 commit comments