{"id":348414,"date":"2023-06-06T09:03:30","date_gmt":"2023-06-06T09:03:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=348414"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=348414","title":{"rendered":"<span>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 API<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86b\/806\/3fb\/86b8063fbf77f459a1db5a194aa669b5.png\" width=\"3000\" height=\"1500\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0410\u043b\u0435\u043a\u0441\u0435\u0439, QA Automation Engineer \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u00ab\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438\u00bb \u0432 \u041f\u0435\u0442\u0440\u043e\u0432\u0438\u0447-\u0422\u0415\u0425. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f REST \u0438 SOAP.&nbsp;<\/p>\n<p>\u041d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435: \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0448\u044c \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c Junior QA Automation, \u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u044f\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f API. \u0417\u0432\u0443\u0447\u0438\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e: \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0448\u044c \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0442\u0435\u0431\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0438\u0437 \u0447\u0435\u0433\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0430 \u043a \u043d\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u00ab\u0421\u044b\u0440\u044b\u0435\u00bb \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432 \u043a\u043d\u0438\u0433\u0430\u0445 \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445 \u2013 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0440\u0443\u0447\u0430\u044e\u0442.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0438\u043f\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API \u2013 \u043d\u0430 Python, \u0441 \u043d\u0443\u043b\u044f, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u2013 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u0430\u0448 \u0443\u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430\u043c \u0438 \u0442\u0435\u043c, \u043a\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f API.<\/p>\n<hr>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438&nbsp;<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c API \u2013 <a href=\"https:\/\/reqres.in\/\"><u>ReqRes<\/u><\/a>.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e API; \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 CRUD, \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e; \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u0434\u043e\u0431\u0438\u044e.&nbsp;<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b: Get, Post, Put, Delete.<\/p>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/ScaLseR\/petrovich_test\"><u>https:\/\/github.com\/ScaLseR\/petrovich_test<\/u><\/a>.<\/p>\n<p>\u0421 \u0432\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 API<\/h3>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abapi\u00bb, \u0430 \u0432 \u043d\u0435\u0439 \u2013 \u0444\u0430\u0439\u043b \u00abapi.py\u00bb. \u041e\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u2013 \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u041a\u043b\u0430\u0441\u0441 \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u2013 \u00abApi\u00bb. <\/p>\n<pre><code class=\"python\">class Api:     \"\"\"\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API\"\"\"     _HEADERS = {'Content-Type': 'application\/json; charset=utf-8'}     _TIMEOUT = 10     base_url = {}      def __init__(self):         self.response = None<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0444\u0430\u0439\u043b requirements.txt, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.&nbsp;<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c: <\/p>\n<pre><code class=\"python\">import allure import requests from jsonschema import validate<\/code><\/pre>\n<p>Requests \u2013 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p>Allure \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0432 Allure. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0445\u043e\u0440\u043e\u0448\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.&nbsp;<\/p>\n<p>Jsonschema \u2013 \u043e\u0442\u0441\u044e\u0434\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e validate, \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 Api \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0414\u043b\u044f POST-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">    def post(self, url: str, endpoint: str, params: dict = None,              json_body: dict = None):                     self.response = requests.post(url=f\"{url}{endpoint}\",                                           headers=self._HEADERS,                                           params=params,                                           json=json_body,                                           timeout=self._TIMEOUT)         return self<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c &#171;@allure.step\u201d \u2013 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0432 \u043d\u0430\u0448 Allure-\u043e\u0442\u0447\u0451\u0442.&nbsp;<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c POST-\u0437\u0430\u043f\u0440\u043e\u0441\") def post(self, url: str, endpoint: str, params: dict = None,          json_body: dict = None):     with allure.step(f\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 url: {url}{endpoint}\"                      f\"\\n \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \\n {json_body}\"):         self.response = requests.post(url=f\"{url}{endpoint}\",                                       headers=self._HEADERS,                                       params=params,                                       json=json_body,                                       timeout=self._TIMEOUT)         return self<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c requests \u0438 responses. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abhelper\u00bb \u2013 \u0442\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2013 logger.py.<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\"\"\" import logging  logger = logging.getLogger() logger.setLevel(logging.INFO)  def log(response, request_body=None):     logger.info(f\"REQUEST METHOD: {response.request.method}\")     logger.info(f\"REQUEST URL: {response.url}\")     logger.info(f\"REQUEST HEADERS: {response.request.headers}\")     logger.info(f\"REQUEST BODY: {request_body}\\n\")     logger.info(f\"STATUS CODE: {response.status_code}\")     logger.info(f\"RESPONSE TIME: {response.elapsed.total_seconds() * 1000:.0f} ms\\n\")     logger.info(f\"RESPONSE HEADERS: {response.headers}\")     logger.info(f\"RESPONSE BODY: {response.text}\\n.\\n.\")<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0433\u043e\u0442\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 Api:<\/p>\n<pre><code class=\"python\">from helper.logger import log<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432; \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 POST \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c POST-\u0437\u0430\u043f\u0440\u043e\u0441\") def post(self, url: str, endpoint: str, params: dict = None,          json_body: dict = None):     with allure.step(f\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 url: {url}{endpoint}\"                      f\"\\n \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \\n {json_body}\"):         self.response = requests.post(url=f\"{url}{endpoint}\",                                       headers=self._HEADERS,                                       params=params,                                       json=json_body,                                       timeout=self._TIMEOUT)     log(response=self.response, request_body=json_body)     return self<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u044b \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u044b.&nbsp;<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u043e\u0432 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0430\u0441\u0441\u0435\u0440\u0442\u044b, \u0438\u0445 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 Api. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445.&nbsp;&nbsp;<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434\u0430<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u0421\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u0440\u0430\u0432\u0435\u043d {expected_code}\") def status_code_should_be(self, expected_code: int):     \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 actual_code \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 expected_code\"\"\"     actual_code = self.response.status_code     assert expected_code == actual_code, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {expected_code} \" \\                                          f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {actual_code}\"     return self<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 json-\u0441\u0445\u0435\u043c\u0435<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: C\u0445\u0435\u043c\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 json \u0432\u0430\u043b\u0438\u0434\u043d\u0430\") def json_schema_should_be_valid(self, path_json_schema: str, name_json_schema: str = 'schema'):     \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 json-\u0441\u0445\u0435\u043c\u0435\"\"\"     json_schema = load_json_schema(path_json_schema, name_json_schema)     validate(self.response.json(), json_schema)     return self<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0445\u0435\u043c\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0448 \u00abhelper\u00bb \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2013 load.py. \u0412 \u043d\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e load_json_schema \u2013 \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 json-\u0441\u0445\u0435\u043c\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. \u041c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438\"\"\" from importlib import import_module  def load_json_schema(path: str, json_schema: str = 'schema'):     \"\"\"\u041f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 json-\u0441\u0445\u0435\u043c\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430\"\"\"     module = import_module(f\"schema.{path}\")     return getattr(module, json_schema)<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 \u00abhelper\u00bb \u0432 \u043a\u043b\u0430\u0441\u0441 Api.<\/p>\n<pre><code class=\"python\">from helper.load import load_json_schema<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/strong>&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0443\u0434\u0435\u043c \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c.<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0432\u043d\u044b\") def objects_should_be(self, expected_object, actual_object):     \"\"\"\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0434\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\"\"\"     assert expected_object == actual_object, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {expected_object} \" \\                                              f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {actual_object}\"     return self<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: \u0412 \u043f\u043e\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\") def have_value_in_response_parameter(self, keys: list, value: str):     \"\"\"\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\"\"\"     payload = self.get_payload(keys)     assert value == payload, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {value} \" \\                                  f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {payload}\"     return self<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438\u0437 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430 \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 Api. <\/p>\n<pre><code class=\"python\">def get_payload(self, keys: list):     \"\"\"\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c payload, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c,     \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 payload\"\"\"     response = self.response.json()     payload = self.json_parser.find_json_vertex(response, keys)            return payload<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 get_payload \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u201chelper\u201d \u043c\u043e\u0434\u0443\u043b\u044c parser.py:<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\"\"\" from typing import Union  def get_data(keys: Union[list, str], data: Union[dict, list]):     \"\"\"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c,     \u0435\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0435\u0442, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 dict\"\"\"     body = data     for key in keys:         try:             body = body[key]             if body is None:                 return {}         except KeyError:             raise KeyError(f'\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 {key}')     return body<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 \u00abhelper\u00bb \u0432 \u043a\u043b\u0430\u0441\u0441 \u00abApi\u00bb:<\/p>\n<pre><code class=\"python\">from helper.parser import get_data<\/code><\/pre>\n<p>\u0412\u044b \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u00abApi\u00bb \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 self; \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0443\u0432\u0438\u0434\u0438\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e.&nbsp;<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0433\u043e\u0442\u043e\u0432, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435&nbsp;<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430; \u00ab\u0441\u043a\u0435\u043b\u0435\u0442\u00bb \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u00ab\u043c\u044f\u0441\u043e\u00bb:<\/p>\n<ul>\n<li>\n<p>\u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e API \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2013 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430 \u0438 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>json-\u0441\u0445\u0435\u043c\u044b \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b;<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u2013 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0443. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u00abapi\u00bb \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abreqres\u00bb. \u0412 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u00abreqres_api.py\u00bb \u2013 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u0448 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 API. \u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c URL, Endpoint \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API.&nbsp;<\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 post-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c:<\/p>\n<pre><code class=\"python\">class ReqresApi(Api):      \"\"\"URl\"\"\"     _URL = 'https:\/\/reqres.in'      \"\"\"Endpoint\"\"\"     _ENDPOINT = '\/api\/users\/'  @allure.step('\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a create') def reqres_create(self, param_request_body: RequestCreateUserModel):     return self.post(url=self._URL,                      endpoint=self._ENDPOINT,                      json_body=param_request_body.to_dict())<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abmodel\u00bb, \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u2013 \u0444\u0430\u0439\u043b\u044b \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 create:<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f create user\"\"\" from dataclasses import dataclass, asdict  @dataclass class RequestCreateUserModel:     \"\"\"\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 request\"\"\"     name: str     job: str      def to_dict(self):         \"\"\"\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 dict \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 body\"\"\"         return asdict(self)  @dataclass class ResponseCreateUserModel:     \"\"\"\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430\"\"\"     name: str     job: str     last_name: str     id: str     created_at: str<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043a\u043b\u0430\u0441\u0441 \u00abReqresApi\u00bb:<\/p>\n<pre><code class=\"python\">from model.reqres.create_model import RequestCreateUserModel,  ResponseCreateUserModel<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.&nbsp;<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u201csingle user\u201d \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"python\">\"\"\"\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u0441\u043f\u043e\u043d\u0441 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\"\"\" def deserialize_single_user(self):     \"\"\"\u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 get (single user)\"\"\"     payload = self.get_payload([])     return ResponseSingleUserModel(id=payload['data']['id'],                                    email=payload['data']['email'],                                    first_name=payload['data']['first_name'],                                    last_name=payload['data']['last_name'],                                    avatar=payload['data']['avatar'],                                    url=payload['support']['url'],                                    text=payload['support']['text'])<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430\u0448\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 json-\u0441\u0445\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430. \u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abschema\u00bb, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0445\u0435\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u00absingle user\u00bb:<\/p>\n<pre><code class=\"python\">\"\"\"\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f ReqRes API, single user\"\"\"  schema = {   \"type\": \"object\",   \"properties\": {     \"data\": {       \"type\": \"object\",       \"properties\": {         \"id\": {           \"type\": \"integer\"         },         \"email\": {           \"type\": \"string\"         },         \"first_name\": {           \"type\": \"string\"         },         \"last_name\": {           \"type\": \"string\"         },         \"avatar\": {           \"type\": \"string\"         }       },       \"required\": [         \"id\",         \"email\",         \"first_name\",         \"last_name\",         \"avatar\"       ]     },     \"support\": {       \"type\": \"object\",       \"properties\": {         \"url\": {           \"type\": \"string\"         },         \"text\": {           \"type\": \"string\"         }       },       \"required\": [         \"url\",         \"text\"       ]     }   },   \"required\": [     \"data\",     \"support\"   ] } <\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2013 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u0441\u0442\u044b \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430 \u00abReqresApi\u00bb. \u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abfixture\u00bb.<\/p>\n<p>\u041a\u043e\u0434 \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"python\">\"\"\"\u0424\u0438\u043a\u0441\u0442\u0443\u0440\u044b ReqRes API\"\"\" import pytest from api.reqres.reqres_api import ReqresApi  @pytest.fixture(scope=\"function\") def reqres_api() -&gt; ReqresApi:     \"\"\"\u041a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a ReqRes API\"\"\"     return ReqresApi()<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u2013 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0442\u0435\u0441\u0442\u0430\u043c!<\/p>\n<h3>\u041f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u044b&nbsp;<\/h3>\n<p>\u0412 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u00abload.py\u00bb \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u0441\u0442\u044b; \u0431\u0443\u0434\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">def load_data(path: str, test_data: str = 'data'):     \"\"\"\u041f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\"\"\"     module = import_module(f\"data.{path}\")     return getattr(module, test_data)<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abtest\u00bb, \u0432\u043d\u0443\u0442\u0440\u0438 \u2013 \u0444\u0430\u0439\u043b \u00abtest_single_user.py\u00bb. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">\"\"\"\u0422\u0435\u0441\u0442 \u043a\u0435\u0439\u0441 \u0434\u043b\u044f ReqRes API, single user\"\"\" import allure import pytest from helper.load import load_data  pytest_plugins = [\"fixture.reqres_api\"] pytestmark = [allure.parent_suite(\"reqres\"),               allure.suite(\"single_user\")]  @allure.title('\u0417\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c') @pytest.mark.parametrize(('user_id', 'expected_data'),                          load_data('single_user_data', 'not_valid_data')) def test_single_user_wo_parameters(reqres_api, user_id, expected_data):     reqres_api.reqres_single_user(user_id).status_code_should_be(404).\\         have_value_in_response_parameter([], expected_data)  @allure.title('\u0417\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c') @pytest.mark.parametrize(('user_id', 'expected_data'),                          load_data('single_user_data')) def test_single_user_valid_parameters(reqres_api, user_id, expected_data):     reqres_api.reqres_single_user(user_id).status_code_should_be(200).\\         json_schema_should_be_valid('single_user_schema').\\         objects_should_be(expected_data, reqres_api.deserialize_single_user())<\/code><\/pre>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430:&nbsp;<\/p>\n<ol>\n<li>\n<p>\u0434\u043b\u044f \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0442\u0435\u043b\u0430 \u043e\u0442\u0432\u0435\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 json-\u0441\u0445\u0435\u043c\u0435, \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c (\u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438).<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e \u043a\u043e\u0434\u0443 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u00abApi\u00bb \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442. \u0422\u0443\u0442 \u0432\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.&nbsp;<\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u044b\u0432\u0435\u043b\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438; \u0432 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u2013 \u0444\u0430\u0439\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0441\u0430\u043c\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e.&nbsp;<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abdata\u00bb; \u0432\u043d\u0443\u0442\u0440\u0438 \u2013 \u0444\u0430\u0439\u043b \u00abtest_single_user.py\u00bb. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"python\">\"\"\"\u0414\u0430\u0442\u0430-\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u041a\u0443\u0439\u041a\u0443\u044b API, single user\"\"\" # -*- coding: utf-8 -*- from model.reqres.single_user_model import ResponseSingleUserModel  # \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 # user_id = 2 user_id_2 = ResponseSingleUserModel(id=2, email='janet.weaver@reqres.in', first_name='Janet',                                     last_name='Weaver', avatar='https:\/\/reqres.in\/img\/faces\/2-image.jpg',                                     url='https:\/\/reqres.in\/#support-heading',                                     text='To keep ReqRes free, contributions towards server costs are appreciated!')  # user_id = 3 user_id_3 = ResponseSingleUserModel(id=3, email='emma.wong@reqres.in', first_name='Emma',                                     last_name='Wong', avatar='https:\/\/reqres.in\/img\/faces\/3-image.jpg',                                     url='https:\/\/reqres.in\/#support-heading',                                     text='To keep ReqRes free, contributions towards server costs are appreciated!')  # \u0412\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 ('user_id', 'expected_data') data = ((2, user_id_2), (3, user_id_3))  # \u043f\u0443\u0441\u0442\u043e\u0435 \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430 empty_data = {}  # \u041d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 ('user_id', 'expected_data') not_valid_data = ((129398274923874, empty_data),                   ('test', empty_data),                   ('\u0440\u043e\u044b\u0432\u043e\u0440\u0430', empty_data))<\/code><\/pre>\n<h3>\u041f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b&nbsp;<\/h3>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f2\/4ae\/89e\/3f24ae89e828a9ae818587bd309db9ee.png\" alt=\"\" title=\"\" width=\"654\" height=\"215\"><\/figure>\n<p>\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u043e\u0442\u0447\u0451\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0441 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c Allure-\u043e\u0442\u0447\u0451\u0442\u0430. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f9\/38a\/3d8\/4f938a3d8fd0af71b5aa89828340d18e.png\" alt=\"\" title=\"\" width=\"754\" height=\"848\"><\/figure>\n<p>\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438, \u043e\u0442\u0447\u0451\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043f\u0430\u043f\u043a\u0435 allure_report. \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u043e\u0442\u0447\u0451\u0442 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c Allur.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8c6\/e2e\/a90\/8c6e2ea90f5e3945866b87a22a91d033.png\" alt=\"\" title=\"\" width=\"936\" height=\"588\"><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c: \u0431\u044b\u043b\u043e 17 \u0442\u0435\u0441\u0442\u043e\u0432, \u0432\u0441\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0438\u043c\u0435\u044e\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u201cpassed\u201d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45d\/9e0\/ff8\/45d9e0ff8d179bfa37af20b577f6c738.png\" alt=\"\" title=\"\" width=\"934\" height=\"460\"><\/figure>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 Suites \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b.<\/p>\n<p>\u041f\u043b\u044e\u0441, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0438\u043c\u0435\u0435\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043b\u043e\u0433:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cdf\/7e8\/3a6\/cdf7e83a623c2aefb9f43e9854684f36.png\" alt=\"\" title=\"\" width=\"936\" height=\"970\"><\/figure>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c: \u0447\u0435\u043a\u043b\u0438\u0441\u0442 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API<\/h3>\n<p>\u0418\u0442\u043e\u0433\u043e, \u043d\u0430 \u043f\u0443\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0448\u0430\u0433\u0438:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u0432\u0435\u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abapi\u00bb \u0438 \u0444\u0430\u0439\u043b \u00abapi.py\u00bb \u2013 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u201cApi\u201d;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0444\u0430\u0439\u043b requirements.txt \u2013 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043a\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p>\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432 \u0438 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434\u043e\u0432&nbsp;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0437\u0430\u0432\u0435\u043b\u0438 \u0430\u0441\u0441\u0435\u0440\u0442\u044b<\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>json-\u0441\u0445\u0435\u043c\u0430&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438\u0437 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0437\u0430\u0432\u0435\u043b\u0438<\/p>\n<ul>\n<li>\n<p>\u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e API \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2013 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430 \u0438 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>json-\u0441\u0445\u0435\u043c\u044b \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u044b<\/p>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0442\u0435\u043b\u0430 \u043e\u0442\u0432\u0435\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0433\u043d\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u044b&nbsp;<\/p>\n<ul>\n<li>\n<p>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c Allure-\u043e\u0442\u0447\u0451\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0418\u043c\u0435\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0447\u0435\u043a\u043b\u0438\u0441\u0442 \u2013 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0435\u043a\u043b\u0438\u0441\u0442\u043e\u0432, \u043d\u0430 \u043f\u0443\u0442\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e: \u043a\u043d\u0438\u0433\u0438, \u0441\u0442\u0430\u0442\u044c\u0438, \u0432\u0438\u0434\u0435\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u043a\u0443\u0440\u0441\u044b; \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c, \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0447\u0430\u0442\u0430\u0445 \u0438 \u043f\u0430\u0431\u043b\u0438\u043a\u0430\u0445.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0437\u0430\u043b\u043e\u0433 \u0443\u0441\u043f\u0435\u0445\u0430 \u0442\u0443\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0435\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u2013 \u0447\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0430\u0447\u043d\u0451\u0448\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u0442\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0448\u044c\u0441\u044f. \u041f\u0443\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043f\u0440\u044f\u043c\u044b\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0433\u043e\u0432, \u043f\u0443\u0441\u0442\u044c \u0431\u0435\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u2013 \u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435.&nbsp;<\/p>\n<p>\u0427\u0435\u043a\u043b\u0438\u0441\u0442 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c \u2013 \u043e\u0442\u043b\u0438\u0447\u043d\u043e, \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043d\u0435 \u0437\u0440\u044f. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0438\u043b\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0447\u0435\u043a\u043b\u0438\u0441\u0442 \u2013 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435! \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c.&nbsp;<\/p>\n<p>\u0423\u0441\u043f\u0435\u0445\u043e\u0432 \u0432\u0430\u043c \u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438! <\/p>\n<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/petrovich\/articles\/740050\/\"> https:\/\/habr.com\/ru\/companies\/petrovich\/articles\/740050\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0410\u043b\u0435\u043a\u0441\u0435\u0439, QA Automation Engineer \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u00ab\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438\u00bb \u0432 \u041f\u0435\u0442\u0440\u043e\u0432\u0438\u0447-\u0422\u0415\u0425. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f REST \u0438 SOAP.&nbsp;<\/p>\n<p>\u041d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435: \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0448\u044c \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c Junior QA Automation, \u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u044f\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f API. \u0417\u0432\u0443\u0447\u0438\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043d\u043e \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e: \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0448\u044c \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0442\u0435\u0431\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0438\u0437 \u0447\u0435\u0433\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0430 \u043a \u043d\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u00ab\u0421\u044b\u0440\u044b\u0435\u00bb \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432 \u043a\u043d\u0438\u0433\u0430\u0445 \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445 \u2013 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0440\u0443\u0447\u0430\u044e\u0442.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0438\u043f\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f API \u2013 \u043d\u0430 Python, \u0441 \u043d\u0443\u043b\u044f, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u2013 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u0430\u0448 \u0443\u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u0430\u0432\u0442\u043e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430\u043c \u0438 \u0442\u0435\u043c, \u043a\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f API.<\/p>\n<hr>\n<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438&nbsp;<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c API \u2013 <a href=\"https:\/\/reqres.in\/\"><u>ReqRes<\/u><\/a>.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e API; \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 CRUD, \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e; \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u0434\u043e\u0431\u0438\u044e.&nbsp;<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b: Get, Post, Put, Delete.<\/p>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/ScaLseR\/petrovich_test\"><u>https:\/\/github.com\/ScaLseR\/petrovich_test<\/u><\/a>.<\/p>\n<p>\u0421 \u0432\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 API<\/h3>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abapi\u00bb, \u0430 \u0432 \u043d\u0435\u0439 \u2013 \u0444\u0430\u0439\u043b \u00abapi.py\u00bb. \u041e\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u2013 \u0442\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u041a\u043b\u0430\u0441\u0441 \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u2013 \u00abApi\u00bb. <\/p>\n<pre><code class=\"python\">class Api:     \"\"\"\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API\"\"\"     _HEADERS = {'Content-Type': 'application\/json; charset=utf-8'}     _TIMEOUT = 10     base_url = {}      def __init__(self):         self.response = None<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0444\u0430\u0439\u043b requirements.txt, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.&nbsp;<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c: <\/p>\n<pre><code class=\"python\">import allure import requests from jsonschema import validate<\/code><\/pre>\n<p>Requests \u2013 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p>Allure \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0432 Allure. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0445\u043e\u0440\u043e\u0448\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.&nbsp;<\/p>\n<p>Jsonschema \u2013 \u043e\u0442\u0441\u044e\u0434\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e validate, \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 Api \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0414\u043b\u044f POST-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">    def post(self, url: str, endpoint: str, params: dict = None,              json_body: dict = None):                     self.response = requests.post(url=f\"{url}{endpoint}\",                                           headers=self._HEADERS,                                           params=params,                                           json=json_body,                                           timeout=self._TIMEOUT)         return self<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c &#171;@allure.step\u201d \u2013 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0432 \u043d\u0430\u0448 Allure-\u043e\u0442\u0447\u0451\u0442.&nbsp;<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c POST-\u0437\u0430\u043f\u0440\u043e\u0441\") def post(self, url: str, endpoint: str, params: dict = None,          json_body: dict = None):     with allure.step(f\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 url: {url}{endpoint}\"                      f\"\\n \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \\n {json_body}\"):         self.response = requests.post(url=f\"{url}{endpoint}\",                                       headers=self._HEADERS,                                       params=params,                                       json=json_body,                                       timeout=self._TIMEOUT)         return self<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c requests \u0438 responses. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abhelper\u00bb \u2013 \u0442\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2013 logger.py.<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\"\"\" import logging  logger = logging.getLogger() logger.setLevel(logging.INFO)  def log(response, request_body=None):     logger.info(f\"REQUEST METHOD: {response.request.method}\")     logger.info(f\"REQUEST URL: {response.url}\")     logger.info(f\"REQUEST HEADERS: {response.request.headers}\")     logger.info(f\"REQUEST BODY: {request_body}\\n\")     logger.info(f\"STATUS CODE: {response.status_code}\")     logger.info(f\"RESPONSE TIME: {response.elapsed.total_seconds() * 1000:.0f} ms\\n\")     logger.info(f\"RESPONSE HEADERS: {response.headers}\")     logger.info(f\"RESPONSE BODY: {response.text}\\n.\\n.\")<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0433\u043e\u0442\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 Api:<\/p>\n<pre><code class=\"python\">from helper.logger import log<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432; \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 POST \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c POST-\u0437\u0430\u043f\u0440\u043e\u0441\") def post(self, url: str, endpoint: str, params: dict = None,          json_body: dict = None):     with allure.step(f\"POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 url: {url}{endpoint}\"                      f\"\\n \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \\n {json_body}\"):         self.response = requests.post(url=f\"{url}{endpoint}\",                                       headers=self._HEADERS,                                       params=params,                                       json=json_body,                                       timeout=self._TIMEOUT)     log(response=self.response, request_body=json_body)     return self<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u044b \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u044b.&nbsp;<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u043e\u0432 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0430\u0441\u0441\u0435\u0440\u0442\u044b, \u0438\u0445 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 Api. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445.&nbsp;&nbsp;<\/p>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434\u0430<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u0421\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u0440\u0430\u0432\u0435\u043d {expected_code}\") def status_code_should_be(self, expected_code: int):     \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 actual_code \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 expected_code\"\"\"     actual_code = self.response.status_code     assert expected_code == actual_code, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {expected_code} \" \\                                          f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {actual_code}\"     return self<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 json-\u0441\u0445\u0435\u043c\u0435<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: C\u0445\u0435\u043c\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 json \u0432\u0430\u043b\u0438\u0434\u043d\u0430\") def json_schema_should_be_valid(self, path_json_schema: str, name_json_schema: str = 'schema'):     \"\"\"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 json-\u0441\u0445\u0435\u043c\u0435\"\"\"     json_schema = load_json_schema(path_json_schema, name_json_schema)     validate(self.response.json(), json_schema)     return self<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0445\u0435\u043c\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0448 \u00abhelper\u00bb \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2013 load.py. \u0412 \u043d\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e load_json_schema \u2013 \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 json-\u0441\u0445\u0435\u043c\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. \u041c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438\"\"\" from importlib import import_module  def load_json_schema(path: str, json_schema: str = 'schema'):     \"\"\"\u041f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 json-\u0441\u0445\u0435\u043c\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430\"\"\"     module = import_module(f\"schema.{path}\")     return getattr(module, json_schema)<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 \u00abhelper\u00bb \u0432 \u043a\u043b\u0430\u0441\u0441 Api.<\/p>\n<pre><code class=\"python\">from helper.load import load_json_schema<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/strong>&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0443\u0434\u0435\u043c \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c.<\/p>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0432\u043d\u044b\") def objects_should_be(self, expected_object, actual_object):     \"\"\"\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0434\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\"\"\"     assert expected_object == actual_object, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {expected_object} \" \\                                              f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {actual_object}\"     return self<\/code><\/pre>\n<ul>\n<li>\n<p><strong>\u041d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<\/strong><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">@allure.step(\"\u041e\u0420: \u0412 \u043f\u043e\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\") def have_value_in_response_parameter(self, keys: list, value: str):     \"\"\"\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\"\"\"     payload = self.get_payload(keys)     assert value == payload, f\"\\n\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {value} \" \\                                  f\"\\n\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: {payload}\"     return self<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438\u0437 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430 \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 Api. <\/p>\n<pre><code class=\"python\">def get_payload(self, keys: list):     \"\"\"\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c payload, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c,     \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 payload\"\"\"     response = self.response.json()     payload = self.json_parser.find_json_vertex(response, keys)            return payload<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 get_payload \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u201chelper\u201d \u043c\u043e\u0434\u0443\u043b\u044c parser.py:<\/p>\n<pre><code class=\"python\">\"\"\"\u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\"\"\" from typing import Union  def get_data(keys: Union[list, str], data: Union[dict, list]):     \"\"\"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c,     \u0435\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0435\u0442, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 dict\"\"\"     body = data     for key in keys:         try:             body = body[key]             if body is None:                 return {}         except KeyError:             raise KeyError(f'\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 {key}')     return body<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 \u00abhelper\u00bb \u0432 \u043a\u043b\u0430\u0441\u0441 \u00abApi\u00bb:<\/p>\n<pre><code class=\"python\">from helper.parser import get_data<\/code><\/pre>\n<p>\u0412\u044b \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u00abApi\u00bb \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 self; \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0443\u0432\u0438\u0434\u0438\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e.&nbsp;<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0433\u043e\u0442\u043e\u0432, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435&nbsp;<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0430; \u00ab\u0441\u043a\u0435\u043b\u0435\u0442\u00bb \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u00ab\u043c\u044f\u0441\u043e\u00bb:<\/p>\n<ul>\n<li>\n<p>\u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e API \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2013 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430 \u0438 \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>json-\u0441\u0445\u0435\u043c\u044b \u0440\u0435\u0441\u043f\u043e\u043d\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b;<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u2013 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0443. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u00abapi\u00bb \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abreqres\u00bb. \u0412 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u00abreqres_api.py\u00bb \u2013 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u0448 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 API. \u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c URL, Endpoint \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API.&nbsp;<\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 post-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c:<\/p>\n<pre><code class=\"python\">class ReqresApi(Api):      \"\"\"URl\"\"\"     _URL = 'https:\/\/reqres.in'      \"\"\"Endpoint\"\"\"     _ENDPOINT = '\/api\/users\/'  @allure.step('\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a create') def reqres_create(self, param_request_body: RequestCreateUserModel):     return self.post(url=self._URL,                      endpoint=self._ENDPOINT,                      json_body=param_request_body.to_dict())<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u00abmodel\u00bb, \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u2013 \u0444\u0430\u0439\u043b\u044b \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f<\/p>\n<\/hr>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-348414","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=348414"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348414\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=348414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=348414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=348414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}