diff options
Diffstat (limited to 'WordPress/src/androidTest/assets/health-check/health-check-xplat-testcases.json')
-rw-r--r-- | WordPress/src/androidTest/assets/health-check/health-check-xplat-testcases.json | 229 |
1 files changed, 229 insertions, 0 deletions
diff --git a/WordPress/src/androidTest/assets/health-check/health-check-xplat-testcases.json b/WordPress/src/androidTest/assets/health-check/health-check-xplat-testcases.json new file mode 100644 index 000000000..49cb953e8 --- /dev/null +++ b/WordPress/src/androidTest/assets/health-check/health-check-xplat-testcases.json @@ -0,0 +1,229 @@ +{ + "testcases": [ + { + "comment": "testing empty url", + "realm": "URL_CANONICALIZATION", + "setup": { + "input": { + "siteUrl": "" + }, + "output": { + "error": { + "type": "SITE_URL_CANNOT_BE_EMPTY", + "message": "Check that the site URL entered is valid" + } + } + } + }, + { + "comment": "testing whitespace url", + "realm": "URL_CANONICALIZATION", + "setup": { + "input": { + "siteUrl": " " + }, + "output": { + "error": { + "type": "SITE_URL_CANNOT_BE_EMPTY", + "message": "Check that the site URL entered is valid" + } + } + } + }, + { + "comment": "testing null url", + "realm": "URL_CANONICALIZATION", + "setup": { + "input": { + "siteUrl": null + }, + "output": { + "error": { + "type": "SITE_URL_CANNOT_BE_EMPTY", + "message": "Check that the site URL entered is valid" + } + } + } + }, + { + "comment": "testing padding whitespace", + "realm": "URL_CANONICALIZATION", + "setup": { + "input": { + "siteUrl": " \t http://wordpress.com \t " + }, + "output": { + "siteUrl": "http://wordpress.com" + } + } + }, + { + "comment": "testing xmlrpc.php missing", + "realm": "XMLPRC_DISCOVERY", + "setup": { + "input": { + "serverMock": [ + { + "request": { + "method": "GET", + "path": "/" + }, + "response": { + "statusCode": 404 + } + }, + { + "request": { + "method": "GET", + "path": "/xmlrpc.php" + }, + "response": { + "statusCode": 404 + } + }, + { + "request": { + "method": "POST", + "path": "/" + }, + "response": { + "statusCode": 404 + } + }, + { + "request": { + "method": "POST", + "path": "/xmlrpc.php" + }, + "response": { + "statusCode": 404 + } + } + ] + }, + "output": { + "error": { + "type": "XMLRPC_MISSING", + "message": "Couldn't connect to the WordPress site" + } + } + } + }, + { + "comment": "testing xmlrpc.php found", + "realm": "XMLPRC_DISCOVERY", + "setup": { + "input": { + "serverMock": [ + { + "request": { + "method": "POST", + "path": "/xmlrpc.php" + }, + "response": { + "statusCode": 200, + "body": "asset:listMethodsResponse.xml" + } + } + ] + }, + "output": { + "xmlrpcEndpoint": "http://mockserver/xmlrpc.php" + } + } + }, + { + "comment": "testing xmlrpc.php discovered after redirect", + "realm": "XMLPRC_DISCOVERY", + "setup": { + "input": { + "siteUrl": "http://mockserver/wp", + "serverMock": [ + { + "request": { + "method": "GET", + "path": "/wp" + }, + "response": { + "statusCode": 301, + "headers": { + "Location": "/wpnew/" + }, + "body": "Page has moved!" + } + }, + { + "request": { + "method": "POST", + "path": "/wp" + }, + "response": { + "statusCode": 307, + "headers": { + "Location": "/wpnew/" + }, + "body": "Page has moved! POST to new address!" + } + }, + { + "request": { + "method": "POST", + "path": "/wp/xmlrpc.php" + }, + "response": { + "statusCode": 307, + "headers": { + "Location": "/wpnew/xmlrpc.php" + }, + "body": "Page has moved! POST to new address!" + } + }, + { + "request": { + "method": "GET", + "path": "/wpnew/" + }, + "response": { + "statusCode": 200, + "body": "asset:index_with_redirect.html" + } + }, + { + "request": { + "method": "GET", + "path": "/wpnew/xmlrpc.php?rsd" + }, + "response": { + "statusCode": 200, + "body": "asset:rsd_with_redirect.xml" + } + }, + { + "request": { + "method": "GET", + "path": "/wpnew/xmlrpc.php" + }, + "response": { + "statusCode": 405, + "body": "XML-RPC server accepts POST requests only." + } + }, + { + "request": { + "method": "POST", + "path": "/wpnew/xmlrpc.php" + }, + "response": { + "statusCode": 200, + "body": "asset:listMethodsResponse.xml" + } + } + ] + }, + "output": { + "xmlrpcEndpoint": "http://mockserver/wpnew/xmlrpc.php" + } + } + } + ] +} |