Commit c464b219 authored by Siebers, Michael's avatar Siebers, Michael
Browse files

rename system tests

GitLab identifies tests only by the Postman
test name. The reqest name is ignored. Tests
 with duplicate names are discarded! Thus
tests with the same name in different
Requests or in different data iterations are
ignored. Thus, test names now include the
Request name and the iteration.
parent 39af4ffc
......@@ -13,12 +13,12 @@
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"Response is JSON object\", function() {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Response is JSON object\", function() {",
" pm.response.to.be.withBody;",
" pm.response.to.be.json;",
"",
......@@ -55,13 +55,13 @@
"listen": "test",
"script": {
"exec": [
"pm.test(\"Case: Ok\", function () {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Case: Ok\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"var jsonData;",
"",
"pm.test(\"Response JSON schema valid\", function() {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Response JSON schema valid\", function() {",
" pm.response.to.be.withBody;",
" pm.response.to.be.json;",
"",
......@@ -72,7 +72,7 @@
" pm.expect(tv4.validate(jsonData, schema)).to.be.true;",
"});",
"",
"pm.test(\"Received and removed all\", function () {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Received and removed all\", function () {",
" expected_count = pm.iterationData.get(\"item_count\")",
"",
" pm.expect(jsonData.received).to.eql(expected_count);",
......@@ -127,13 +127,13 @@
"listen": "test",
"script": {
"exec": [
"pm.test(\"Case: Ok\", function () {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Case: Ok\", function () {",
" pm.expect(pm.response.code).to.eql(200);",
"});",
"",
"var jsonData;",
"",
"pm.test(\"Response JSON schema valid\", function() {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Response JSON schema valid\", function() {",
" pm.response.to.be.withBody;",
" pm.response.to.be.json;",
"",
......@@ -144,7 +144,7 @@
" pm.expect(tv4.validate(jsonData, schema)).to.be.true;",
"});",
"",
"pm.test(\"Received all, removed none\", function () {",
"pm.test(pm.variables.get(\"test_prefix\") + \"Received all, removed none\", function () {",
" expected_count = pm.iterationData.get(\"item_count\")",
"",
" pm.expect(jsonData.received).to.eql(expected_count);",
......@@ -193,6 +193,27 @@
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"pm.variables.set(\"test_prefix\", pm.info.requestName + \" [\" + (pm.info.iteration + 1).toString() ",
" + '/' + pm.info.iterationCount.toString() + ']: ');"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "expected_json_schema",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment