Commit 131d140f authored by Ivar Meikas's avatar Ivar Meikas
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request teis/api-tests!2
parents 4d10b665 fb00e8ad
postman_tests:
stage: test
image:
name: postman/newman
entrypoint: [""]
script:
# - npm install -g newman-reporter-html
# - newman run resources/postmanExample/TeIS_example.postman_collection.json -e resources/postmanExample/TEST_example.postman_environment.json --reporters cli,html,junit --reporter-html-export report.html --reporter-junit-export report.xml
- newman run resources/postmanExample/TeIS_example.postman_collection.json -e resources/postmanExample/TEST_example.postman_environment.json --reporters cli,junit --reporter-junit-export report.xml
artifacts:
when: always
# paths:
# - report.html
reports:
junit: report.xml
\ No newline at end of file
{
"id": "7d9ce86f-f17f-43b7-9515-732de6481a08",
"name": "LOCAL",
"values": [
{
"key": "url",
"value": "http://10.0.74.60:8099",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-03-27T10:18:38.505Z",
"_postman_exported_using": "Postman/7.0.6"
}
\ No newline at end of file
{
"info": {
"_postman_id": "ff16346d-6645-4988-9f9b-fe893e596315",
"name": "TeIS example",
"description": "Postman collection example for service-template and api-gateway-template.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Insert certificate with error",
"event": [
{
"listen": "test",
"script": {
"id": "e8a465ae-82af-4a26-9161-2408a0dd9118",
"exec": [
"var data = JSON.parse(responseBody);",
"tests[\"Status code is 500\"] = responseCode.code === 500;",
"tests[\"Completed status is error\"] = data.status === \"error\";"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"company\": \"Test3\",\r\n \"certifiedPersons\": [\r\n \"a\",\r\n \"b\"\r\n ]\r\n}"
},
"url": {
"raw": "{{url}}/certification/insert",
"host": [
"{{url}}"
],
"path": [
"certification",
"insert"
]
}
},
"response": []
},
{
"name": "Insert certificate (Test0)",
"event": [
{
"listen": "test",
"script": {
"id": "94cef645-59d9-4603-9d86-1c7690fdb407",
"exec": [
"var data = JSON.parse(responseBody);\r",
"\r",
"tests[\"Status code is 200\"] = responseCode.code === 200;\r",
"tests[\"Completed status is returned\"] = data.status === \"completed\";"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"certifiedPersons\": [\r\n \"person1\", \"person2\"\r\n ],\r\n \"company\": \"Test0\",\r\n \"requestMetaDTO\": {\r\n \"organizationId\": \"123456\",\r\n \"privileges\": [\r\n \"priv1\", \"priv2\"\r\n ],\r\n \"requestId\": \"55555555\",\r\n \"sessionId\": \"66666666\",\r\n \"userId\": \"7\"\r\n }\r\n}"
},
"url": {
"raw": "{{url}}/certification/insert",
"host": [
"{{url}}"
],
"path": [
"certification",
"insert"
]
}
},
"response": []
},
{
"name": "Insert certificate (Test1)",
"event": [
{
"listen": "test",
"script": {
"id": "6a718f7b-1664-4e44-80f6-8bf1bccfdd60",
"exec": [
"var data = JSON.parse(responseBody);\r",
"\r",
"tests[\"Status code is 200\"] = responseCode.code === 200;\r",
"tests[\"Completed status is returned\"] = data.status === \"completed\";\r",
"tests[\"Response time is more than 1500ms\"] = pm.response.responseTime > 1500;"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"company\": \"Test1\",\r\n \"certifiedPersons\": [\r\n \"a\",\r\n \"b\"\r\n ]\r\n}"
},
"url": {
"raw": "{{url}}/certification/insert",
"host": [
"{{url}}"
],
"path": [
"certification",
"insert"
]
}
},
"response": []
},
{
"name": "Insert certificate (Test2)",
"event": [
{
"listen": "test",
"script": {
"id": "9c61d5d5-e6f0-4740-aa2e-e5279dd8a6fb",
"exec": [
"var data = JSON.parse(responseBody);\r",
"\r",
"tests[\"Status code is 202\"] = responseCode.code === 202;\r",
"tests[\"Completed status is returned\"] = data.status === \"pending\";"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"company\": \"Test2\",\r\n \"certifiedPersons\": [\r\n \"a\",\r\n \"b\"\r\n ]\r\n}"
},
"url": {
"raw": "{{url}}/certification/insert",
"host": [
"{{url}}"
],
"path": [
"certification",
"insert"
]
}
},
"response": []
},
{
"name": "Get all added certificates",
"event": [
{
"listen": "test",
"script": {
"id": "10b5f801-412c-476e-ab00-9b3078af22cd",
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {},
"url": {
"raw": "{{url}}/certification",
"host": [
"{{url}}"
],
"path": [
"certification"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "144a217e-7953-48e0-b75a-ccd3e8533142",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "d8ac75a0-e6f2-430a-89e4-74535ab214a3",
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
\ No newline at end of file
Markdown is supported
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