Skip to content

Commit

Permalink
new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doctorixx committed Mar 27, 2024
1 parent 296a2e0 commit b754d0f
Showing 1 changed file with 176 additions and 1 deletion.
177 changes: 176 additions & 1 deletion tests/autotests.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,181 @@
"_collection_link": "https://martian-astronaut-975194.postman.co/workspace/Codebattles~ac8c92c5-94b1-4349-a4b4-70c488f6046d/collection/24756275-867823eb-4831-40e5-9af1-f3f1ff1da5d1?action=share&source=collection_link&creator=24756275"
},
"item": [
{
"name": "-1 Teacher Prepare",
"item": [
{
"name": "Login Copy",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"login\": \"admin\",\r\n \"password\": \"admin\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:2500/api/teacher/auth",
"protocol": "http",
"host": [
"localhost"
],
"port": "2500",
"path": [
"api",
"teacher",
"auth"
]
}
},
"response": []
},
{
"name": "Create champ Copy",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"aboba\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}/api/teacher/champs",
"host": [
"{{url}}"
],
"path": [
"api",
"teacher",
"champs"
]
}
},
"response": []
},
{
"name": "Assign problem Copy",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"problem\": \"A\",\r\n \"problem_id\": \"1\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}/api/teacher/champs/:id",
"host": [
"{{url}}"
],
"path": [
"api",
"teacher",
"champs",
":id"
],
"variable": [
{
"key": "id",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "Add users Copy",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"users\": \"admin\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}/api/teacher/champs/:id/add_users",
"host": [
"{{url}}"
],
"path": [
"api",
"teacher",
"champs",
":id",
"add_users"
],
"variable": [
{
"key": "id",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "Get users Copy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const jsonData = pm.response.json();\r",
"pm.environment.set(\"GEN_user_login\", jsonData[0].login);\r",
"pm.environment.set(\"GEN_user_password\", jsonData[0].password);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{url}}/api/teacher/champs/:id/users",
"host": [
"{{url}}"
],
"path": [
"api",
"teacher",
"champs",
":id",
"users"
],
"variable": [
{
"key": "id",
"value": "1"
}
]
}
},
"response": []
}
]
},
{
"name": "0. Login",
"item": [
Expand Down Expand Up @@ -269,7 +444,7 @@
" console.log(last_send)\r",
"\r",
" pm.expect(last_send.program_checked).to.eql(true);\r",
" pm.expect(last_send.score).to.eql(100);\r",
" pm.expect(last_send.score).to.eql(0);\r",
"});"
],
"type": "text/javascript",
Expand Down

0 comments on commit b754d0f

Please sign in to comment.