Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not ErrorResponse format XML response at method named 'tl.getTestPlanByName' #7

Open
4 tasks done
Tracked by #7
netzulo opened this issue Dec 25, 2017 · 0 comments
Open
4 tasks done
Tracked by #7

Comments

@netzulo
Copy link

netzulo commented Dec 25, 2017

When use empty params it's not showing any message, maybe must use Error Format defined when param name not provided

im using docker container on public node down this domain : http://qalab.tk:86

i created a collection for postman with tests and results , import from here http://myjson.com/lok7j

Tests included

  • call to method named 'tl.getTestPlanByName' , with all params with ok values
  • call to method named 'tl.getTestPlanByName' , with all params with KO testprojectname emtpy
  • call to method named 'tl.getTestPlanByName' , with all params with KO testplanname emtpy
  • call to method named 'tl.getTestPlanByName' , with all params with KO values emtpy
{
  "info": {
    "name": "Testlink XMLRPC",
    "_postman_id": "2397db0b-ff54-1935-dc38-dcf54cd2624b",
    "description": "",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "testplanbyname_BUG_GITHUB",
      "description": "",
      "item": [
        {
          "name": "tl.getTestPlanByName test: names ok",
          "event": [
            {
              "listen": "test",
              "script": {
                "id": "ae26ba17-03d9-4d0b-8013-916e9e901b4a",
                "type": "text/javascript",
                "exec": [
                  "tests[\"Status code is 200\"] = responseCode.code === 200;",
                  "tests[\"XML response contains testlink XML ERROR format\"] = function() {",
                  "    var res_json = xml2Json(responseBody);",
                  "    var data = res_json.methodResponse.params.param.value.array.data;",
                  "    var member;",
                  "    try{",
                  "        member = data.value.struct.member;",
                  "        if(typeof(member[0].value.int) !== 'number') return true;",
                  "    }",
                  "    catch(e){ }",
                  "    return true;",
                  "}();"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\"?>\n    <methodCall>\n        <methodName>tl.getTestPlanByName</methodName>\n        <params>\n            <param>\n                <value>\n                    <struct>\n                        <member>\n                            <name>devKey</name>\n                            <value>\n                                <string>{{dev_key}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testprojectname</name>\n                            <value>\n                                <string>{{test_project_name}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testplanname</name>\n                            <value>\n                                <string>{{test_plan_name}}</string>\n                            </value>\n                        </member>\n                    </struct>\n                </value>\n            </param>\n        </params>\n    </methodCall>\n<?xml version='1.0'>"
            },
            "url": {
              "raw": "{{url}}/",
              "host": [
                "{{url}}"
              ],
              "path": [
                ""
              ]
            },
            "description": null
          },
          "response": [

          ]
        },
        {
          "name": "tl.getTestPlanByName test: emtpy tproject name",
          "event": [
            {
              "listen": "test",
              "script": {
                "id": "c7f18b12-47b1-4e15-8586-a5650258e898",
                "type": "text/javascript",
                "exec": [
                  "tests[\"Status code is 200\"] = responseCode.code === 200;",
                  "tests[\"XML response contains testlink XML ERROR format\"] = function() {",
                  "    var res_json = xml2Json(responseBody);",
                  "    var data = res_json.methodResponse.params.param.value.array.data;",
                  "    var member;",
                  "    try{",
                  "        member = data.value.struct.member;",
                  "        if(typeof(member[0].value.int) !== 'number') return false;",
                  "    }",
                  "    catch(e){ return false; }",
                  "    return true;",
                  "}();"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\"?>\n    <methodCall>\n        <methodName>tl.getTestPlanByName</methodName>\n        <params>\n            <param>\n                <value>\n                    <struct>\n                        <member>\n                            <name>devKey</name>\n                            <value>\n                                <string>{{dev_key}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testprojectname</name>\n                            <value>\n                                <string></string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testplanname</name>\n                            <value>\n                                <string>{{test_plan_name}}</string>\n                            </value>\n                        </member>\n                    </struct>\n                </value>\n            </param>\n        </params>\n    </methodCall>\n<?xml version='1.0'>"
            },
            "url": {
              "raw": "{{url}}/",
              "host": [
                "{{url}}"
              ],
              "path": [
                ""
              ]
            },
            "description": null
          },
          "response": [

          ]
        },
        {
          "name": "tl.getTestPlanByName test: emtpy tplan name",
          "event": [
            {
              "listen": "test",
              "script": {
                "id": "09ff8fc4-ba29-402e-af9f-5e02dcb153da",
                "type": "text/javascript",
                "exec": [
                  "tests[\"Status code is 200\"] = responseCode.code === 200;",
                  "tests[\"XML response contains testlink XML ERROR format\"] = function() {",
                  "    var res_json = xml2Json(responseBody);",
                  "    var data = res_json.methodResponse.params.param.value.array.data;",
                  "    var member;",
                  "    try{",
                  "        member = data.value.struct.member;",
                  "        if(typeof(member[0].value.int) !== 'number') return false;",
                  "    }",
                  "    catch(e){ return false; }",
                  "    return true;",
                  "}();"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\"?>\n    <methodCall>\n        <methodName>tl.getTestPlanByName</methodName>\n        <params>\n            <param>\n                <value>\n                    <struct>\n                        <member>\n                            <name>devKey</name>\n                            <value>\n                                <string>{{dev_key}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testprojectname</name>\n                            <value>\n                                <string>{{test_project_name}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testplanname</name>\n                            <value>\n                                <string></string>\n                            </value>\n                        </member>\n                    </struct>\n                </value>\n            </param>\n        </params>\n    </methodCall>\n<?xml version='1.0'>"
            },
            "url": {
              "raw": "{{url}}/",
              "host": [
                "{{url}}"
              ],
              "path": [
                ""
              ]
            },
            "description": null
          },
          "response": [

          ]
        },
        {
          "name": "tl.getTestPlanByName test: emtpy names",
          "event": [
            {
              "listen": "test",
              "script": {
                "id": "2bf85fdc-3066-4948-a79f-7d16fe638c93",
                "type": "text/javascript",
                "exec": [
                  "tests[\"Status code is 200\"] = responseCode.code === 200;",
                  "tests[\"XML response contains testlink XML ERROR format\"] = function() {",
                  "    var res_json = xml2Json(responseBody);",
                  "    var data = res_json.methodResponse.params.param.value.array.data;",
                  "    var member;",
                  "    try{",
                  "        member = data.value.struct.member;",
                  "        if(typeof(member[0].value.int) !== 'number') return false;",
                  "    }",
                  "    catch(e){ return false; }",
                  "    return true;",
                  "}();"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\"?>\n    <methodCall>\n        <methodName>tl.getTestPlanByName</methodName>\n        <params>\n            <param>\n                <value>\n                    <struct>\n                        <member>\n                            <name>devKey</name>\n                            <value>\n                                <string>{{dev_key}}</string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testprojectname</name>\n                            <value>\n                                <string></string>\n                            </value>\n                        </member>\n                        <member>\n                            <name>testplanname</name>\n                            <value>\n                                <string></string>\n                            </value>\n                        </member>\n                    </struct>\n                </value>\n            </param>\n        </params>\n    </methodCall>\n<?xml version='1.0'>"
            },
            "url": {
              "raw": "{{url}}/",
              "host": [
                "{{url}}"
              ],
              "path": [
                ""
              ]
            },
            "description": null
          },
          "response": [

          ]
        }
      ]
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant