diff --git a/allure_results/04320148-ef84-4233-9b40-c86817fbc912-result.json b/allure_results/04320148-ef84-4233-9b40-c86817fbc912-result.json new file mode 100644 index 0000000..98dc67e --- /dev/null +++ b/allure_results/04320148-ef84-4233-9b40-c86817fbc912-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать пользователя, который уже зарегистрирован", "status": "passed", "description": "Повторная регистрация возвращает 403.", "start": 1784106551431, "stop": 1784106552718, "uuid": "e0db52c6-38f7-451b-8cdc-6856e71feef9", "historyId": "f508ece13c00a5bd24c49105634b126e", "testCaseId": "f508ece13c00a5bd24c49105634b126e", "fullName": "tests.test_create_user.TestUserCreate#test_create_duplicate_user", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_user"}, {"name": "subSuite", "value": "TestUserCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_user.py", "TestUserCreate"]} \ No newline at end of file diff --git a/allure_results/053c3690-0d2d-4256-8326-951478c086d1-result.json b/allure_results/053c3690-0d2d-4256-8326-951478c086d1-result.json new file mode 100644 index 0000000..3c04e57 --- /dev/null +++ b/allure_results/053c3690-0d2d-4256-8326-951478c086d1-result.json @@ -0,0 +1 @@ +{"name": "Нельзя логиниться с неверным логином и паролем", "status": "passed", "description": "При неверных данных API возвращает 401.", "start": 1784106562545, "stop": 1784106562807, "uuid": "3b92fde3-4f5d-44d9-84a0-954ed79de537", "historyId": "7bfbf04d5dfedc031b086281d82bc79f", "testCaseId": "7bfbf04d5dfedc031b086281d82bc79f", "fullName": "tests.test_login_user.TestUserLogin#test_login_wrong_credentials", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_login_user"}, {"name": "subSuite", "value": "TestUserLogin"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_login_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_login_user.py", "TestUserLogin"]} \ No newline at end of file diff --git a/allure_results/05a8219b-a308-414f-b96f-e61af117e877-container.json b/allure_results/05a8219b-a308-414f-b96f-e61af117e877-container.json new file mode 100644 index 0000000..62434d0 --- /dev/null +++ b/allure_results/05a8219b-a308-414f-b96f-e61af117e877-container.json @@ -0,0 +1 @@ +{"uuid": "a338e4da-529c-4edf-847b-9468a20ee32d", "children": ["19f9650b-c90b-4df9-800e-481e4098c735"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106554328, "stop": 1784106554680}], "start": 1784106554328, "stop": 1784106554680}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTNhOTg0MjcwMDAxYmViNTg2OSIsImlhdCI6MTc4NDEwNjU1NCwiZXhwIjoxNzg0MTA3NzU0fQ.7Azajw2YBI9sfJFz-UWx6lzpb5X6hgWknDpaugr0hSs'"}], "start": 1784106559725, "stop": 1784106560676}], "start": 1784106559725, "stop": 1784106560677}], "start": 1784106559725, "stop": 1784106560677}, {"name": "user::", "start": 1784106560677}], "start": 1784106554328, "stop": 1784106560677} \ No newline at end of file diff --git a/allure_results/0d4ecddc-8b29-441f-b1ad-040e8426a66f-result.json b/allure_results/0d4ecddc-8b29-441f-b1ad-040e8426a66f-result.json new file mode 100644 index 0000000..21d0432 --- /dev/null +++ b/allure_results/0d4ecddc-8b29-441f-b1ad-040e8426a66f-result.json @@ -0,0 +1 @@ +{"name": "Авторизованный пользователь может изменить name", "status": "passed", "description": "PATCH /api/auth/user с Authorization обновляет name.", "start": 1784106566178, "stop": 1784106566354, "uuid": "6da840ac-ec7b-4fcf-8bf9-9d017e6eb753", "historyId": "0249a32cd9b3180fee6616db5942ba52", "testCaseId": "0249a32cd9b3180fee6616db5942ba52", "fullName": "tests.test_update_user.TestUserUpdate#test_update_name_with_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/2c60d520-ac65-4048-a7a8-58159a77c8d9-result.json b/allure_results/2c60d520-ac65-4048-a7a8-58159a77c8d9-result.json new file mode 100644 index 0000000..aff43ea --- /dev/null +++ b/allure_results/2c60d520-ac65-4048-a7a8-58159a77c8d9-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать пользователя без обязательного поля", "status": "passed", "description": "Без одного из обязательных полей API возвращает 403.", "parameters": [{"name": "field", "value": "'name'"}], "start": 1784106554110, "stop": 1784106554327, "uuid": "1b89f6a6-4383-4c7d-9a39-03cc307162d1", "historyId": "65cba0768efc9f1d9dfdc4411bd19618", "testCaseId": "760c4fc160ff7bbf1f57d1dc85647cda", "fullName": "tests.test_create_user.TestUserCreate#test_create_user_missing_required_field", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_user"}, {"name": "subSuite", "value": "TestUserCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_user.py", "TestUserCreate"]} \ No newline at end of file diff --git a/allure_results/359f90cd-3ba9-41c2-ab8e-ad80137d22f4-container.json b/allure_results/359f90cd-3ba9-41c2-ab8e-ad80137d22f4-container.json new file mode 100644 index 0000000..16963c4 --- /dev/null +++ b/allure_results/359f90cd-3ba9-41c2-ab8e-ad80137d22f4-container.json @@ -0,0 +1 @@ +{"uuid": "54c86e4e-891c-471a-8877-c735649b72a7", "children": ["4fabd89c-8375-4527-995a-0f77728ef8bf"], "befores": [{"name": "ingredients", "status": "passed", "start": 1784106543393, "stop": 1784106543587}], "afters": [{"name": "ingredients::", "start": 1784106547405}], "start": 1784106543393, "stop": 1784106547405} \ No newline at end of file diff --git a/allure_results/46368d13-5592-4c11-8ce3-750bb573e479-result.json b/allure_results/46368d13-5592-4c11-8ce3-750bb573e479-result.json new file mode 100644 index 0000000..e115487 --- /dev/null +++ b/allure_results/46368d13-5592-4c11-8ce3-750bb573e479-result.json @@ -0,0 +1 @@ +{"name": "Можно создать заказ без авторизации с ингредиентами", "status": "passed", "description": "Без Authorization с ингредиентами API возвращает 200.", "start": 1784106548492, "stop": 1784106548752, "uuid": "7e3cbf51-548a-4204-84dc-27a7d587271d", "historyId": "d46802c82495110c5613d76a99ad4955", "testCaseId": "d46802c82495110c5613d76a99ad4955", "fullName": "tests.test_create_order.TestOrderCreate#test_create_order_without_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_order"}, {"name": "subSuite", "value": "TestOrderCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_order"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_order.py", "TestOrderCreate"]} \ No newline at end of file diff --git a/allure_results/4ae64d46-f8d9-4fcb-9854-80c938ef1ade-container.json b/allure_results/4ae64d46-f8d9-4fcb-9854-80c938ef1ade-container.json new file mode 100644 index 0000000..33f1241 --- /dev/null +++ b/allure_results/4ae64d46-f8d9-4fcb-9854-80c938ef1ade-container.json @@ -0,0 +1 @@ +{"uuid": "989a024b-5e51-471a-9d94-20430db9ce3d", "children": ["e0db52c6-38f7-451b-8cdc-6856e71feef9"], "befores": [{"name": "duplicate_user_payload", "status": "passed", "steps": [{"name": "Регистрируем пользователя для теста", "status": "passed", "start": 1784106551082, "stop": 1784106551431}], "start": 1784106551082, "stop": 1784106551431}], "afters": [{"name": "duplicate_user_payload::", "start": 1784106552718}], "start": 1784106551082, "stop": 1784106552718} \ No newline at end of file diff --git a/allure_results/51067ee3-a12f-4f9e-8c79-0ba6933b412b-result.json b/allure_results/51067ee3-a12f-4f9e-8c79-0ba6933b412b-result.json new file mode 100644 index 0000000..2a9a2a4 --- /dev/null +++ b/allure_results/51067ee3-a12f-4f9e-8c79-0ba6933b412b-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать заказ с неверным хешем ингредиентов", "status": "passed", "description": "Невалидный id ингредиента возвращает 400.", "start": 1784106549598, "stop": 1784106549803, "uuid": "08075a38-a331-4509-b2d4-76ce33f45d2b", "historyId": "cb7e0e3ce5c0c1c5fe99dd61e13a540a", "testCaseId": "cb7e0e3ce5c0c1c5fe99dd61e13a540a", "fullName": "tests.test_create_order.TestOrderCreate#test_create_order_with_invalid_ingredient_hash", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_order"}, {"name": "subSuite", "value": "TestOrderCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_order"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_order.py", "TestOrderCreate"]} \ No newline at end of file diff --git a/allure_results/52330e87-7994-43b5-a061-e710cea474ea-container.json b/allure_results/52330e87-7994-43b5-a061-e710cea474ea-container.json new file mode 100644 index 0000000..db04074 --- /dev/null +++ b/allure_results/52330e87-7994-43b5-a061-e710cea474ea-container.json @@ -0,0 +1 @@ +{"uuid": "1e479a08-6f09-49f3-be3f-da1fee69c1c4", "children": ["19f9650b-c90b-4df9-800e-481e4098c735"], "befores": [{"name": "user_with_order", "status": "passed", "steps": [{"name": "Создаём заказ для пользователя", "status": "passed", "start": 1784106554990, "stop": 1784106558785}], "start": 1784106554990, "stop": 1784106558785}], "afters": [{"name": "user_with_order::", "start": 1784106559725}], "start": 1784106554990, "stop": 1784106559725} \ No newline at end of file diff --git a/allure_results/524e7856-d455-4269-942b-b5e33e561c74-result.json b/allure_results/524e7856-d455-4269-942b-b5e33e561c74-result.json new file mode 100644 index 0000000..2e00c63 --- /dev/null +++ b/allure_results/524e7856-d455-4269-942b-b5e33e561c74-result.json @@ -0,0 +1 @@ +{"name": "Авторизованный пользователь может изменить password", "status": "passed", "description": "PATCH /api/auth/user с Authorization обновляет password.", "start": 1784106564721, "stop": 1784106565014, "uuid": "8f8845f1-b72f-4634-9617-18ef117391a0", "historyId": "899c5c3648c5c1dc3cd3c3ada02028cc", "testCaseId": "899c5c3648c5c1dc3cd3c3ada02028cc", "fullName": "tests.test_update_user.TestUserUpdate#test_update_password_with_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/561b20bd-3fe5-43e9-beea-4b4b3e686578-container.json b/allure_results/561b20bd-3fe5-43e9-beea-4b4b3e686578-container.json new file mode 100644 index 0000000..c1e9ba1 --- /dev/null +++ b/allure_results/561b20bd-3fe5-43e9-beea-4b4b3e686578-container.json @@ -0,0 +1 @@ +{"uuid": "7c4606a3-74f2-496b-abc7-f7006e40c03e", "children": ["b98fba4d-e0f6-4978-ac25-213f9a8cd3ca"], "befores": [{"name": "user_payload", "status": "passed", "start": 1784106549803, "stop": 1784106549803}], "afters": [{"name": "user_payload::", "start": 1784106551081}], "start": 1784106549803, "stop": 1784106551081} \ No newline at end of file diff --git a/allure_results/562252d3-b79e-4d48-acf9-e678443b724e-result.json b/allure_results/562252d3-b79e-4d48-acf9-e678443b724e-result.json new file mode 100644 index 0000000..6dbfdc5 --- /dev/null +++ b/allure_results/562252d3-b79e-4d48-acf9-e678443b724e-result.json @@ -0,0 +1 @@ +{"name": "Можно создать уникального пользователя", "status": "passed", "description": "При валидных данных API возвращает 200, success=true, user и токены.", "start": 1784106549804, "stop": 1784106550159, "uuid": "b98fba4d-e0f6-4978-ac25-213f9a8cd3ca", "historyId": "f4cf9aede4dd6f9884861e03133d4922", "testCaseId": "f4cf9aede4dd6f9884861e03133d4922", "fullName": "tests.test_create_user.TestUserCreate#test_create_user_success", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_user"}, {"name": "subSuite", "value": "TestUserCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_user.py", "TestUserCreate"]} \ No newline at end of file diff --git a/allure_results/56b62b72-ab0c-4ed0-b8eb-aaeda671b361-result.json b/allure_results/56b62b72-ab0c-4ed0-b8eb-aaeda671b361-result.json new file mode 100644 index 0000000..19178de --- /dev/null +++ b/allure_results/56b62b72-ab0c-4ed0-b8eb-aaeda671b361-result.json @@ -0,0 +1 @@ +{"name": "Можно создать заказ с авторизацией и ингредиентами", "status": "passed", "description": "Авторизованный пользователь с ингредиентами получает 200.", "start": 1784106543588, "stop": 1784106547405, "uuid": "4fabd89c-8375-4527-995a-0f77728ef8bf", "historyId": "8454f38110301d0bb3ddafb0bf5b19e8", "testCaseId": "8454f38110301d0bb3ddafb0bf5b19e8", "fullName": "tests.test_create_order.TestOrderCreate#test_create_order_with_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_order"}, {"name": "subSuite", "value": "TestOrderCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_order"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_order.py", "TestOrderCreate"]} \ No newline at end of file diff --git a/allure_results/58561298-c751-4f82-9c41-d33bc32a77f4-result.json b/allure_results/58561298-c751-4f82-9c41-d33bc32a77f4-result.json new file mode 100644 index 0000000..8af5724 --- /dev/null +++ b/allure_results/58561298-c751-4f82-9c41-d33bc32a77f4-result.json @@ -0,0 +1 @@ +{"name": "Авторизованный пользователь может получить свои заказы", "status": "passed", "description": "GET /api/orders с Authorization возвращает 200 и список orders.", "start": 1784106558785, "stop": 1784106559725, "uuid": "19f9650b-c90b-4df9-800e-481e4098c735", "historyId": "2b1c22863a8df4b33c273dd4bc6714f7", "testCaseId": "2b1c22863a8df4b33c273dd4bc6714f7", "fullName": "tests.test_get_user_orders.TestUserOrders#test_get_orders_authorized", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_get_user_orders"}, {"name": "subSuite", "value": "TestUserOrders"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_get_user_orders"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_get_user_orders.py", "TestUserOrders"]} \ No newline at end of file diff --git a/allure_results/5915aee2-1eaa-4ed2-bd34-a91ef02505b7-result.json b/allure_results/5915aee2-1eaa-4ed2-bd34-a91ef02505b7-result.json new file mode 100644 index 0000000..b57cd53 --- /dev/null +++ b/allure_results/5915aee2-1eaa-4ed2-bd34-a91ef02505b7-result.json @@ -0,0 +1 @@ +{"name": "Неавторизованный пользователь не может получить заказы", "status": "passed", "description": "GET /api/orders без Authorization возвращает 401.", "start": 1784106560678, "stop": 1784106560908, "uuid": "3ebc9335-22a8-4e73-9df8-2dca96261a67", "historyId": "544e8f896dcf06247ae88fbe17b421c9", "testCaseId": "544e8f896dcf06247ae88fbe17b421c9", "fullName": "tests.test_get_user_orders.TestUserOrders#test_get_orders_unauthorized", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_get_user_orders"}, {"name": "subSuite", "value": "TestUserOrders"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_get_user_orders"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_get_user_orders.py", "TestUserOrders"]} \ No newline at end of file diff --git a/allure_results/62509796-5275-470a-96b5-2d10bdbb3588-container.json b/allure_results/62509796-5275-470a-96b5-2d10bdbb3588-container.json new file mode 100644 index 0000000..c77e1e7 --- /dev/null +++ b/allure_results/62509796-5275-470a-96b5-2d10bdbb3588-container.json @@ -0,0 +1 @@ +{"uuid": "1ac4985b-c94f-4529-be59-b5cf40262ad3", "children": ["7e3cbf51-548a-4204-84dc-27a7d587271d"], "befores": [{"name": "ingredients", "status": "passed", "start": 1784106548286, "stop": 1784106548491}], "afters": [{"name": "ingredients::", "start": 1784106548752}], "start": 1784106548286, "stop": 1784106548752} \ No newline at end of file diff --git a/allure_results/68d0ac3a-4a35-4f71-a1cb-1651f8f03c08-container.json b/allure_results/68d0ac3a-4a35-4f71-a1cb-1651f8f03c08-container.json new file mode 100644 index 0000000..f63e2f8 --- /dev/null +++ b/allure_results/68d0ac3a-4a35-4f71-a1cb-1651f8f03c08-container.json @@ -0,0 +1 @@ +{"uuid": "d8089d8b-4832-4dd6-b02d-616fbd21d9ae", "children": ["de04bd76-1d22-4cd0-b546-4ef380d1b5cd"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106562808, "stop": 1784106563196}], "start": 1784106562808, "stop": 1784106563196}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTQzOTg0MjcwMDAxYmViNTg2ZiIsImlhdCI6MTc4NDEwNjU2MywiZXhwIjoxNzg0MTA3NzYzfQ.xoxAI5E1e_teW6j-kombSRgUXAr0IN20Qxo0-CmkBek'"}], "start": 1784106563436, "stop": 1784106564373}], "start": 1784106563436, "stop": 1784106564374}], "start": 1784106563436, "stop": 1784106564374}, {"name": "user::", "start": 1784106564374}], "start": 1784106562808, "stop": 1784106564374} \ No newline at end of file diff --git a/allure_results/69e2fca2-c9ae-4de9-88de-1780551fe76b-container.json b/allure_results/69e2fca2-c9ae-4de9-88de-1780551fe76b-container.json new file mode 100644 index 0000000..5cfaa65 --- /dev/null +++ b/allure_results/69e2fca2-c9ae-4de9-88de-1780551fe76b-container.json @@ -0,0 +1 @@ +{"uuid": "c3e8a30e-81aa-43ab-90b1-1193f80e2bc9", "befores": [{"name": "field", "status": "passed", "start": 1784106553604, "stop": 1784106553604}], "afters": [{"name": "field::", "start": 1784106553858}], "start": 1784106553604, "stop": 1784106553858} \ No newline at end of file diff --git a/allure_results/6ca49008-3633-48e5-a565-3d40f88d129e-container.json b/allure_results/6ca49008-3633-48e5-a565-3d40f88d129e-container.json new file mode 100644 index 0000000..bee5d9a --- /dev/null +++ b/allure_results/6ca49008-3633-48e5-a565-3d40f88d129e-container.json @@ -0,0 +1 @@ +{"uuid": "a74d23b9-7c82-4ce7-9e02-ca230df91d52", "children": ["e0db52c6-38f7-451b-8cdc-6856e71feef9"], "befores": [{"name": "user_cleanup", "status": "passed", "start": 1784106551082, "stop": 1784106551082}], "afters": [{"name": "user_cleanup::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTM3OTg0MjcwMDAxYmViNTg2NyIsImlhdCI6MTc4NDEwNjU1MSwiZXhwIjoxNzg0MTA3NzUxfQ.FOmD5Avn6YYNW2qg_exyMjJ8h_lWZUng4DkmcmpqDas'"}], "start": 1784106552719, "stop": 1784106553603}], "start": 1784106552719, "stop": 1784106553603}], "start": 1784106552719, "stop": 1784106553603}, {"name": "user_cleanup::", "start": 1784106553603}], "start": 1784106551082, "stop": 1784106553603} \ No newline at end of file diff --git a/allure_results/6d6e3d16-0610-46af-b728-3a261bc3ad82-container.json b/allure_results/6d6e3d16-0610-46af-b728-3a261bc3ad82-container.json new file mode 100644 index 0000000..391c4e0 --- /dev/null +++ b/allure_results/6d6e3d16-0610-46af-b728-3a261bc3ad82-container.json @@ -0,0 +1 @@ +{"uuid": "ec5dc308-8c1f-4747-bfc7-6b632cb1a513", "befores": [{"name": "field", "status": "passed", "start": 1784106554109, "stop": 1784106554109}], "afters": [{"name": "field::", "start": 1784106554328}], "start": 1784106554109, "stop": 1784106554328} \ No newline at end of file diff --git a/allure_results/aa18ba33-978e-400f-93f4-a751dad49114-result.json b/allure_results/aa18ba33-978e-400f-93f4-a751dad49114-result.json new file mode 100644 index 0000000..2763e12 --- /dev/null +++ b/allure_results/aa18ba33-978e-400f-93f4-a751dad49114-result.json @@ -0,0 +1 @@ +{"name": "Неавторизованный пользователь не может изменить email", "status": "passed", "description": "PATCH без Authorization возвращает 401.", "start": 1784106567202, "stop": 1784106567374, "uuid": "11e29e45-ff59-441b-9b7d-f20dc047c8e5", "historyId": "0627abf80ff3c865b07a825da78097d5", "testCaseId": "0627abf80ff3c865b07a825da78097d5", "fullName": "tests.test_update_user.TestUserUpdate#test_update_email_without_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/bb11b404-ba1c-4b27-a036-caa22a314afe-container.json b/allure_results/bb11b404-ba1c-4b27-a036-caa22a314afe-container.json new file mode 100644 index 0000000..7ad4cc3 --- /dev/null +++ b/allure_results/bb11b404-ba1c-4b27-a036-caa22a314afe-container.json @@ -0,0 +1 @@ +{"uuid": "4aa68b5c-3d0d-45d7-95fe-5a83a35e2d50", "children": ["6da840ac-ec7b-4fcf-8bf9-9d017e6eb753"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106565857, "stop": 1784106566177}], "start": 1784106565857, "stop": 1784106566177}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTQ2OTg0MjcwMDAxYmViNTg3MyIsImlhdCI6MTc4NDEwNjU2NiwiZXhwIjoxNzg0MTA3NzY2fQ.UXJi-bJqoG1wlIpTdCE1hTdvYFiyUTkKz1h8PZHp3iE'"}], "start": 1784106566355, "stop": 1784106567201}], "start": 1784106566355, "stop": 1784106567201}], "start": 1784106566355, "stop": 1784106567201}, {"name": "user::", "start": 1784106567201}], "start": 1784106565857, "stop": 1784106567201} \ No newline at end of file diff --git a/allure_results/bf22117e-44eb-4c5c-b7be-0e3c634019b6-container.json b/allure_results/bf22117e-44eb-4c5c-b7be-0e3c634019b6-container.json new file mode 100644 index 0000000..882afb2 --- /dev/null +++ b/allure_results/bf22117e-44eb-4c5c-b7be-0e3c634019b6-container.json @@ -0,0 +1 @@ +{"uuid": "519d9a3c-dcd9-4e1a-ad4d-a3a47dea1ef6", "children": ["19f9650b-c90b-4df9-800e-481e4098c735"], "befores": [{"name": "ingredients", "status": "passed", "start": 1784106554681, "stop": 1784106554990}], "afters": [{"name": "ingredients::", "start": 1784106559725}], "start": 1784106554681, "stop": 1784106559725} \ No newline at end of file diff --git a/allure_results/c0d76cd4-a4fd-4279-a277-f6d89db89b69-container.json b/allure_results/c0d76cd4-a4fd-4279-a277-f6d89db89b69-container.json new file mode 100644 index 0000000..436ad0b --- /dev/null +++ b/allure_results/c0d76cd4-a4fd-4279-a277-f6d89db89b69-container.json @@ -0,0 +1 @@ +{"uuid": "0a76d8d2-07fb-482c-a19d-5100190354f9", "befores": [{"name": "field", "status": "passed", "start": 1784106553859, "stop": 1784106553859}], "afters": [{"name": "field::", "start": 1784106554109}], "start": 1784106553859, "stop": 1784106554109} \ No newline at end of file diff --git a/allure_results/d176deb6-fe24-4d68-8ef2-5ed402e2aeae-result.json b/allure_results/d176deb6-fe24-4d68-8ef2-5ed402e2aeae-result.json new file mode 100644 index 0000000..e1a4f00 --- /dev/null +++ b/allure_results/d176deb6-fe24-4d68-8ef2-5ed402e2aeae-result.json @@ -0,0 +1 @@ +{"name": "Неавторизованный пользователь не может изменить password", "status": "passed", "description": "PATCH без Authorization возвращает 401.", "start": 1784106567375, "stop": 1784106567551, "uuid": "e8f9091c-a86c-4799-94c9-dc5d99ccd831", "historyId": "84a66f37040f45e306a5a267c912eb2d", "testCaseId": "84a66f37040f45e306a5a267c912eb2d", "fullName": "tests.test_update_user.TestUserUpdate#test_update_password_without_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/d9895ffa-e0c0-46ec-ad9e-1dcfec21b770-result.json b/allure_results/d9895ffa-e0c0-46ec-ad9e-1dcfec21b770-result.json new file mode 100644 index 0000000..9e2bef8 --- /dev/null +++ b/allure_results/d9895ffa-e0c0-46ec-ad9e-1dcfec21b770-result.json @@ -0,0 +1 @@ +{"name": "Неавторизованный пользователь не может изменить name", "status": "passed", "description": "PATCH без Authorization возвращает 401.", "start": 1784106567552, "stop": 1784106567738, "uuid": "6ef0be13-388f-40ce-8ecf-fcbc68121b57", "historyId": "5cfeeac9c3920acdde1c5539db60afed", "testCaseId": "5cfeeac9c3920acdde1c5539db60afed", "fullName": "tests.test_update_user.TestUserUpdate#test_update_name_without_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/e2bad0c0-efe8-4a9d-8a3a-6a29a086edd6-container.json b/allure_results/e2bad0c0-efe8-4a9d-8a3a-6a29a086edd6-container.json new file mode 100644 index 0000000..cc77a98 --- /dev/null +++ b/allure_results/e2bad0c0-efe8-4a9d-8a3a-6a29a086edd6-container.json @@ -0,0 +1 @@ +{"uuid": "172277f5-259f-4248-9760-403a451bde30", "children": ["b98fba4d-e0f6-4978-ac25-213f9a8cd3ca"], "befores": [{"name": "user_cleanup", "status": "passed", "start": 1784106549803, "stop": 1784106549804}], "afters": [{"name": "user_cleanup::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTM2OTg0MjcwMDAxYmViNTg2NSIsImlhdCI6MTc4NDEwNjU1MCwiZXhwIjoxNzg0MTA3NzUwfQ.M0fYYXWh2WgZ-1eUXDEsTLZXb92mMT4bkJA5DZoLII4'"}], "start": 1784106550160, "stop": 1784106551080}], "start": 1784106550160, "stop": 1784106551080}], "start": 1784106550160, "stop": 1784106551081}, {"name": "user_cleanup::", "start": 1784106551081}], "start": 1784106549803, "stop": 1784106551081} \ No newline at end of file diff --git a/allure_results/e80d273f-8688-4bb5-99bb-521fd43696ab-container.json b/allure_results/e80d273f-8688-4bb5-99bb-521fd43696ab-container.json new file mode 100644 index 0000000..c8b494a --- /dev/null +++ b/allure_results/e80d273f-8688-4bb5-99bb-521fd43696ab-container.json @@ -0,0 +1 @@ +{"uuid": "acf79d9c-39d5-4c2e-b257-84be0a212754", "children": ["8f8845f1-b72f-4634-9617-18ef117391a0"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106564375, "stop": 1784106564720}], "start": 1784106564375, "stop": 1784106564720}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTQ0OTg0MjcwMDAxYmViNTg3MSIsImlhdCI6MTc4NDEwNjU2NCwiZXhwIjoxNzg0MTA3NzY0fQ.477Yf88BwSdapzgQT2zfaYWuPwZtWeag8z8ocZpxiug'"}], "start": 1784106565015, "stop": 1784106565856}], "start": 1784106565015, "stop": 1784106565856}], "start": 1784106565015, "stop": 1784106565856}, {"name": "user::", "start": 1784106565856}], "start": 1784106564375, "stop": 1784106565856} \ No newline at end of file diff --git a/allure_results/ed8ef675-a23f-44f1-9a88-11f7d4f10eaa-result.json b/allure_results/ed8ef675-a23f-44f1-9a88-11f7d4f10eaa-result.json new file mode 100644 index 0000000..81fed02 --- /dev/null +++ b/allure_results/ed8ef675-a23f-44f1-9a88-11f7d4f10eaa-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать пользователя без обязательного поля", "status": "passed", "description": "Без одного из обязательных полей API возвращает 403.", "parameters": [{"name": "field", "value": "'email'"}], "start": 1784106553605, "stop": 1784106553858, "uuid": "80f47cdb-e15e-4d5f-a9a1-68edc5ec9359", "historyId": "2b590fac94897a48fa600272bf08bdff", "testCaseId": "760c4fc160ff7bbf1f57d1dc85647cda", "fullName": "tests.test_create_user.TestUserCreate#test_create_user_missing_required_field", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_user"}, {"name": "subSuite", "value": "TestUserCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_user.py", "TestUserCreate"]} \ No newline at end of file diff --git a/allure_results/ef0b84ed-788c-49c5-b6f2-fc2ed313ce48-container.json b/allure_results/ef0b84ed-788c-49c5-b6f2-fc2ed313ce48-container.json new file mode 100644 index 0000000..f8d191b --- /dev/null +++ b/allure_results/ef0b84ed-788c-49c5-b6f2-fc2ed313ce48-container.json @@ -0,0 +1 @@ +{"uuid": "7738b799-21e4-4b59-9b9a-3e5471e67f5b", "children": ["4fabd89c-8375-4527-995a-0f77728ef8bf"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106543064, "stop": 1784106543392}], "start": 1784106543064, "stop": 1784106543392}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTJmOTg0MjcwMDAxYmViNTg2MiIsImlhdCI6MTc4NDEwNjU0MywiZXhwIjoxNzg0MTA3NzQzfQ.lRsR0TeyZXhTm7MEum5t7Ptw7tHo6e2ntox-8NxHgaA'"}], "start": 1784106547406, "stop": 1784106548284}], "start": 1784106547406, "stop": 1784106548285}], "start": 1784106547406, "stop": 1784106548285}, {"name": "user::", "start": 1784106548285}], "start": 1784106543064, "stop": 1784106548285} \ No newline at end of file diff --git a/allure_results/f4b629a3-eabd-4a91-905a-5fbfd6ded550-result.json b/allure_results/f4b629a3-eabd-4a91-905a-5fbfd6ded550-result.json new file mode 100644 index 0000000..7a8a92a --- /dev/null +++ b/allure_results/f4b629a3-eabd-4a91-905a-5fbfd6ded550-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать пользователя без обязательного поля", "status": "passed", "description": "Без одного из обязательных полей API возвращает 403.", "parameters": [{"name": "field", "value": "'password'"}], "start": 1784106553859, "stop": 1784106554108, "uuid": "1e4c95d1-f082-48de-84d0-621d5f9a84c1", "historyId": "6ed7262aa3c5ec7c555e98c74acad9a9", "testCaseId": "760c4fc160ff7bbf1f57d1dc85647cda", "fullName": "tests.test_create_user.TestUserCreate#test_create_user_missing_required_field", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_user"}, {"name": "subSuite", "value": "TestUserCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_user.py", "TestUserCreate"]} \ No newline at end of file diff --git a/allure_results/f4f3c7e3-74ca-4e99-9c81-a24db626e557-container.json b/allure_results/f4f3c7e3-74ca-4e99-9c81-a24db626e557-container.json new file mode 100644 index 0000000..c8718c5 --- /dev/null +++ b/allure_results/f4f3c7e3-74ca-4e99-9c81-a24db626e557-container.json @@ -0,0 +1 @@ +{"uuid": "f30fe835-2244-45a8-b229-b32d6fa6f179", "children": ["15413434-9b5d-411f-a54a-96ea9de1b348"], "befores": [{"name": "user", "status": "passed", "steps": [{"name": "Создаём пользователя для теста", "status": "passed", "start": 1784106560909, "stop": 1784106561256}], "start": 1784106560909, "stop": 1784106561256}], "afters": [{"name": "user::1", "status": "passed", "steps": [{"name": "Удаляем пользователя после теста", "status": "passed", "steps": [{"name": "Удаляем пользователя", "status": "passed", "parameters": [{"name": "access_token", "value": "'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhNTc0ZTQxOTg0MjcwMDAxYmViNTg2YyIsImlhdCI6MTc4NDEwNjU2MSwiZXhwIjoxNzg0MTA3NzYxfQ.-N1GtNdjqXMxOHqhtEt2fGb4vfepcI7ZLRj5ORTY9nY'"}], "start": 1784106561633, "stop": 1784106562544}], "start": 1784106561633, "stop": 1784106562544}], "start": 1784106561633, "stop": 1784106562544}, {"name": "user::", "start": 1784106562544}], "start": 1784106560909, "stop": 1784106562544} \ No newline at end of file diff --git a/allure_results/f5b0f0e0-44da-4c51-833f-129128e7afd8-result.json b/allure_results/f5b0f0e0-44da-4c51-833f-129128e7afd8-result.json new file mode 100644 index 0000000..63c9ad5 --- /dev/null +++ b/allure_results/f5b0f0e0-44da-4c51-833f-129128e7afd8-result.json @@ -0,0 +1 @@ +{"name": "Авторизованный пользователь может изменить email", "status": "passed", "description": "PATCH /api/auth/user с Authorization обновляет email.", "start": 1784106563197, "stop": 1784106563435, "uuid": "de04bd76-1d22-4cd0-b546-4ef380d1b5cd", "historyId": "0c3b8f2c093511e9ed1117d4cb9dd587", "testCaseId": "0c3b8f2c093511e9ed1117d4cb9dd587", "fullName": "tests.test_update_user.TestUserUpdate#test_update_email_with_authorization", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_update_user"}, {"name": "subSuite", "value": "TestUserUpdate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_update_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_update_user.py", "TestUserUpdate"]} \ No newline at end of file diff --git a/allure_results/f6644375-cbac-4fd6-9eb4-f90298718b45-result.json b/allure_results/f6644375-cbac-4fd6-9eb4-f90298718b45-result.json new file mode 100644 index 0000000..ac5e232 --- /dev/null +++ b/allure_results/f6644375-cbac-4fd6-9eb4-f90298718b45-result.json @@ -0,0 +1 @@ +{"name": "Можно логиниться под существующим пользователем", "status": "passed", "description": "При корректных email и password API возвращает 200, user и токены.", "start": 1784106561256, "stop": 1784106561632, "uuid": "15413434-9b5d-411f-a54a-96ea9de1b348", "historyId": "d9d5f76705b86c685b319bdcda284360", "testCaseId": "d9d5f76705b86c685b319bdcda284360", "fullName": "tests.test_login_user.TestUserLogin#test_login_user_success", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_login_user"}, {"name": "subSuite", "value": "TestUserLogin"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_login_user"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_login_user.py", "TestUserLogin"]} \ No newline at end of file diff --git a/allure_results/f677485d-6d85-489e-a82f-f59eebede6d3-result.json b/allure_results/f677485d-6d85-489e-a82f-f59eebede6d3-result.json new file mode 100644 index 0000000..8bc2f04 --- /dev/null +++ b/allure_results/f677485d-6d85-489e-a82f-f59eebede6d3-result.json @@ -0,0 +1 @@ +{"name": "Нельзя создать заказ без ингредиентов", "status": "passed", "description": "Пустое тело возвращает 400.", "start": 1784106548753, "stop": 1784106549597, "uuid": "dc819ea8-fb20-4f5c-b992-13272f163ace", "historyId": "6d139eb21673da942ec89cb9d2d15b4d", "testCaseId": "6d139eb21673da942ec89cb9d2d15b4d", "fullName": "tests.test_create_order.TestOrderCreate#test_create_order_without_ingredients", "labels": [{"name": "parentSuite", "value": "tests"}, {"name": "suite", "value": "test_create_order"}, {"name": "subSuite", "value": "TestOrderCreate"}, {"name": "host", "value": "System-Eltex"}, {"name": "thread", "value": "814558-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.test_create_order"}], "links": [{"type": "link", "url": "https://stellarburgers.education-services.ru", "name": "Stellar Burgers"}], "titlePath": ["tests", "test_create_order.py", "TestOrderCreate"]} \ No newline at end of file diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..0c90034 --- /dev/null +++ b/conftest.py @@ -0,0 +1,61 @@ +import allure +import pytest +import requests + +from helpers import ( + build_random_user_payload, + delete_user, + get_ingredient_ids, + register_new_user_and_return_data, +) +from urls import ORDERS_ENDPOINT + + +@pytest.fixture +def user_cleanup(): + tokens = [] + yield tokens + for access_token in tokens: + with allure.step("Удаляем пользователя после теста"): + delete_user(access_token) + + +@pytest.fixture +def user_payload(): + return build_random_user_payload() + + +@pytest.fixture +def duplicate_user_payload(user_cleanup): + with allure.step("Регистрируем пользователя для теста"): + user = register_new_user_and_return_data() + user_cleanup.append(user["accessToken"]) + return { + "email": user["email"], + "password": user["password"], + "name": user["name"], + } + + +@pytest.fixture +def user(): + with allure.step("Создаём пользователя для теста"): + user_data = register_new_user_and_return_data() + yield user_data + with allure.step("Удаляем пользователя после теста"): + delete_user(user_data["accessToken"]) + + +@pytest.fixture +def ingredients(): + bun_id, filling_id = get_ingredient_ids() + return {"bun": bun_id, "filling": filling_id} + + +@pytest.fixture +def user_with_order(user, ingredients): + with allure.step("Создаём заказ для пользователя"): + payload = {"ingredients": [ingredients["bun"], ingredients["filling"], ingredients["bun"]]} + headers = {"Authorization": user["accessToken"]} + requests.post(ORDERS_ENDPOINT, json=payload, headers=headers) + return user diff --git a/data.py b/data.py new file mode 100644 index 0000000..1074d70 --- /dev/null +++ b/data.py @@ -0,0 +1,10 @@ +USER_REQUIRED_FIELDS = ["email", "password", "name"] + +MSG_USER_ALREADY_EXISTS = "User already exists" +MSG_REQUIRED_FIELDS = "Email, password and name are required fields" +MSG_EMAIL_OR_PASSWORD_INCORRECT = "email or password are incorrect" +MSG_SHOULD_BE_AUTHORISED = "You should be authorised" +MSG_INGREDIENTS_REQUIRED = "Ingredient ids must be provided" +MSG_INGREDIENTS_INCORRECT = "One or more ids provided are incorrect" + +INVALID_INGREDIENT_HASH = "aaaaaaaaaaaaaaaaaaaaaaaa" diff --git a/helpers.py b/helpers.py new file mode 100644 index 0000000..a2debee --- /dev/null +++ b/helpers.py @@ -0,0 +1,46 @@ +import random +import string + +import allure +import requests + +from urls import INGREDIENTS_ENDPOINT, REGISTER_ENDPOINT, USER_ENDPOINT + + +def generate_random_string(length): + letters = string.ascii_lowercase + return "".join(random.choice(letters) for _ in range(length)) + + +def build_random_user_payload(): + return { + "email": f"{generate_random_string(10)}@example.com", + "password": generate_random_string(10), + "name": generate_random_string(10), + } + + +def register_new_user_and_return_data(): + payload = build_random_user_payload() + response = requests.post(REGISTER_ENDPOINT, json=payload) + body = response.json() + return { + "email": payload["email"], + "password": payload["password"], + "name": payload["name"], + "accessToken": body["accessToken"], + "refreshToken": body["refreshToken"], + } + + +@allure.step("Удаляем пользователя") +def delete_user(access_token): + return requests.delete(USER_ENDPOINT, headers={"Authorization": access_token}) + + +def get_ingredient_ids(): + response = requests.get(INGREDIENTS_ENDPOINT) + ingredients = response.json()["data"] + bun_id = next(item["_id"] for item in ingredients if item["type"] == "bun") + filling_id = next(item["_id"] for item in ingredients if item["type"] != "bun") + return bun_id, filling_id diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cbdd1be --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pytest +requests +allure-pytest diff --git a/tests/test_create_order.py b/tests/test_create_order.py new file mode 100644 index 0000000..416079c --- /dev/null +++ b/tests/test_create_order.py @@ -0,0 +1,65 @@ +import allure +import requests + +from data import ( + INVALID_INGREDIENT_HASH, + MSG_INGREDIENTS_INCORRECT, + MSG_INGREDIENTS_REQUIRED, +) +from urls import BASE_URL, ORDERS_ENDPOINT + + +@allure.link(BASE_URL, name="Stellar Burgers") +class TestOrderCreate: + @allure.title("Можно создать заказ с авторизацией и ингредиентами") + @allure.description("Авторизованный пользователь с ингредиентами получает 200.") + def test_create_order_with_authorization(self, user, ingredients): + payload = {"ingredients": [ingredients["bun"], ingredients["filling"], ingredients["bun"]]} + response = requests.post( + ORDERS_ENDPOINT, + json=payload, + headers={"Authorization": user["accessToken"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert "name" in response_body + assert "order" in response_body + assert "number" in response_body["order"] + + @allure.title("Можно создать заказ без авторизации с ингредиентами") + @allure.description("Без Authorization с ингредиентами API возвращает 200.") + def test_create_order_without_authorization(self, ingredients): + payload = {"ingredients": [ingredients["bun"], ingredients["filling"], ingredients["bun"]]} + response = requests.post(ORDERS_ENDPOINT, json=payload) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert "name" in response_body + assert "order" in response_body + assert "number" in response_body["order"] + + @allure.title("Нельзя создать заказ без ингредиентов") + @allure.description("Пустое тело возвращает 400.") + def test_create_order_without_ingredients(self): + response = requests.post(ORDERS_ENDPOINT, json={}) + response_body = response.json() + + assert response.status_code == 400 + assert response_body["success"] is False + assert response_body["message"] == MSG_INGREDIENTS_REQUIRED + + @allure.title("Нельзя создать заказ с неверным хешем ингредиентов") + @allure.description("Невалидный id ингредиента возвращает 400.") + def test_create_order_with_invalid_ingredient_hash(self): + response = requests.post( + ORDERS_ENDPOINT, + json={"ingredients": [INVALID_INGREDIENT_HASH]}, + ) + response_body = response.json() + + assert response.status_code == 400 + assert response_body["success"] is False + assert response_body["message"] == MSG_INGREDIENTS_INCORRECT diff --git a/tests/test_create_user.py b/tests/test_create_user.py new file mode 100644 index 0000000..7dfd3fa --- /dev/null +++ b/tests/test_create_user.py @@ -0,0 +1,47 @@ +import allure +import pytest +import requests + +from data import MSG_REQUIRED_FIELDS, MSG_USER_ALREADY_EXISTS, USER_REQUIRED_FIELDS +from helpers import build_random_user_payload +from urls import BASE_URL, REGISTER_ENDPOINT + + +@allure.link(BASE_URL, name="Stellar Burgers") +class TestUserCreate: + @allure.title("Можно создать уникального пользователя") + @allure.description("При валидных данных API возвращает 200, success=true, user и токены.") + def test_create_user_success(self, user_payload, user_cleanup): + response = requests.post(REGISTER_ENDPOINT, json=user_payload) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert "accessToken" in response_body + user_cleanup.append(response_body["accessToken"]) + assert response_body["user"]["email"] == user_payload["email"] + assert response_body["user"]["name"] == user_payload["name"] + assert "refreshToken" in response_body + + @allure.title("Нельзя создать пользователя, который уже зарегистрирован") + @allure.description("Повторная регистрация возвращает 403.") + def test_create_duplicate_user(self, duplicate_user_payload): + response = requests.post(REGISTER_ENDPOINT, json=duplicate_user_payload) + response_body = response.json() + + assert response.status_code == 403 + assert response_body["success"] is False + assert response_body["message"] == MSG_USER_ALREADY_EXISTS + + @allure.title("Нельзя создать пользователя без обязательного поля") + @allure.description("Без одного из обязательных полей API возвращает 403.") + @pytest.mark.parametrize("field", USER_REQUIRED_FIELDS) + def test_create_user_missing_required_field(self, field): + payload = build_random_user_payload() + del payload[field] + response = requests.post(REGISTER_ENDPOINT, json=payload) + response_body = response.json() + + assert response.status_code == 403 + assert response_body["success"] is False + assert response_body["message"] == MSG_REQUIRED_FIELDS diff --git a/tests/test_get_user_orders.py b/tests/test_get_user_orders.py new file mode 100644 index 0000000..24213a2 --- /dev/null +++ b/tests/test_get_user_orders.py @@ -0,0 +1,33 @@ +import allure +import requests + +from data import MSG_SHOULD_BE_AUTHORISED +from urls import BASE_URL, ORDERS_ENDPOINT + + +@allure.link(BASE_URL, name="Stellar Burgers") +class TestUserOrders: + @allure.title("Авторизованный пользователь может получить свои заказы") + @allure.description("GET /api/orders с Authorization возвращает 200 и список orders.") + def test_get_orders_authorized(self, user_with_order): + response = requests.get( + ORDERS_ENDPOINT, + headers={"Authorization": user_with_order["accessToken"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert "orders" in response_body + assert isinstance(response_body["orders"], list) + assert len(response_body["orders"]) >= 1 + + @allure.title("Неавторизованный пользователь не может получить заказы") + @allure.description("GET /api/orders без Authorization возвращает 401.") + def test_get_orders_unauthorized(self): + response = requests.get(ORDERS_ENDPOINT) + response_body = response.json() + + assert response.status_code == 401 + assert response_body["success"] is False + assert response_body["message"] == MSG_SHOULD_BE_AUTHORISED diff --git a/tests/test_login_user.py b/tests/test_login_user.py new file mode 100644 index 0000000..12cf517 --- /dev/null +++ b/tests/test_login_user.py @@ -0,0 +1,39 @@ +import allure +import requests + +from data import MSG_EMAIL_OR_PASSWORD_INCORRECT +from helpers import build_random_user_payload +from urls import BASE_URL, LOGIN_ENDPOINT + + +@allure.link(BASE_URL, name="Stellar Burgers") +class TestUserLogin: + @allure.title("Можно логиниться под существующим пользователем") + @allure.description("При корректных email и password API возвращает 200, user и токены.") + def test_login_user_success(self, user): + response = requests.post( + LOGIN_ENDPOINT, + json={"email": user["email"], "password": user["password"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert response_body["user"]["email"] == user["email"] + assert response_body["user"]["name"] == user["name"] + assert "accessToken" in response_body + assert "refreshToken" in response_body + + @allure.title("Нельзя логиниться с неверным логином и паролем") + @allure.description("При неверных данных API возвращает 401.") + def test_login_wrong_credentials(self): + payload = build_random_user_payload() + response = requests.post( + LOGIN_ENDPOINT, + json={"email": payload["email"], "password": payload["password"]}, + ) + response_body = response.json() + + assert response.status_code == 401 + assert response_body["success"] is False + assert response_body["message"] == MSG_EMAIL_OR_PASSWORD_INCORRECT diff --git a/tests/test_update_user.py b/tests/test_update_user.py new file mode 100644 index 0000000..94b7402 --- /dev/null +++ b/tests/test_update_user.py @@ -0,0 +1,92 @@ +import allure +import requests + +from data import MSG_SHOULD_BE_AUTHORISED +from helpers import build_random_user_payload, generate_random_string +from urls import BASE_URL, USER_ENDPOINT + + +@allure.link(BASE_URL, name="Stellar Burgers") +class TestUserUpdate: + @allure.title("Авторизованный пользователь может изменить email") + @allure.description("PATCH /api/auth/user с Authorization обновляет email.") + def test_update_email_with_authorization(self, user): + new_email = build_random_user_payload()["email"] + response = requests.patch( + USER_ENDPOINT, + json={"email": new_email}, + headers={"Authorization": user["accessToken"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert response_body["user"]["email"] == new_email + + @allure.title("Авторизованный пользователь может изменить password") + @allure.description("PATCH /api/auth/user с Authorization обновляет password.") + def test_update_password_with_authorization(self, user): + response = requests.patch( + USER_ENDPOINT, + json={"password": generate_random_string(10)}, + headers={"Authorization": user["accessToken"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert response_body["user"]["email"] == user["email"] + + @allure.title("Авторизованный пользователь может изменить name") + @allure.description("PATCH /api/auth/user с Authorization обновляет name.") + def test_update_name_with_authorization(self, user): + new_name = generate_random_string(10) + response = requests.patch( + USER_ENDPOINT, + json={"name": new_name}, + headers={"Authorization": user["accessToken"]}, + ) + response_body = response.json() + + assert response.status_code == 200 + assert response_body["success"] is True + assert response_body["user"]["name"] == new_name + + @allure.title("Неавторизованный пользователь не может изменить email") + @allure.description("PATCH без Authorization возвращает 401.") + def test_update_email_without_authorization(self): + response = requests.patch( + USER_ENDPOINT, + json={"email": build_random_user_payload()["email"]}, + ) + response_body = response.json() + + assert response.status_code == 401 + assert response_body["success"] is False + assert response_body["message"] == MSG_SHOULD_BE_AUTHORISED + + @allure.title("Неавторизованный пользователь не может изменить password") + @allure.description("PATCH без Authorization возвращает 401.") + def test_update_password_without_authorization(self): + response = requests.patch( + USER_ENDPOINT, + json={"password": generate_random_string(10)}, + ) + response_body = response.json() + + assert response.status_code == 401 + assert response_body["success"] is False + assert response_body["message"] == MSG_SHOULD_BE_AUTHORISED + + @allure.title("Неавторизованный пользователь не может изменить name") + @allure.description("PATCH без Authorization возвращает 401.") + def test_update_name_without_authorization(self): + response = requests.patch( + USER_ENDPOINT, + json={"name": generate_random_string(10)}, + ) + response_body = response.json() + + assert response.status_code == 401 + assert response_body["success"] is False + assert response_body["message"] == MSG_SHOULD_BE_AUTHORISED diff --git a/urls.py b/urls.py new file mode 100644 index 0000000..dedeb5d --- /dev/null +++ b/urls.py @@ -0,0 +1,7 @@ +BASE_URL = "https://stellarburgers.education-services.ru" + +REGISTER_ENDPOINT = f"{BASE_URL}/api/auth/register" +LOGIN_ENDPOINT = f"{BASE_URL}/api/auth/login" +USER_ENDPOINT = f"{BASE_URL}/api/auth/user" +ORDERS_ENDPOINT = f"{BASE_URL}/api/orders" +INGREDIENTS_ENDPOINT = f"{BASE_URL}/api/ingredients"