Skip to content

Develop#1

Open
sieagle wants to merge 7 commits into
mainfrom
develop
Open

Develop#1
sieagle wants to merge 7 commits into
mainfrom
develop

Conversation

@sieagle

@sieagle sieagle commented Apr 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

Comment thread Tests/test_delete_courier.py Outdated
# coorier_id = None
# response = Courier.delete_courier(coorier_id)
# assert response["status_code"] == 400
# assert "Недостаточно данных для удаления курьера" in response["response_text"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: в проекте не должно быть закомментированного кода

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread datas.py Outdated
"password": "",
"firstName": first_name
}
return payload

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: в дата модуле не должно быть генерации данных. Модуль должен содержать только статичные данные или данные, сгенерированные через Faker. Логика генерации усложняет поддержку и противоречит стандартам организации кода.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread conftest.py Outdated
courier_create = Courier.registration_courier()
courier_login = Courier.login_courier_and_get_id(courier_create["data"])
yield courier_create
Courier.delete_courier(courier_login["id"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: фикстура создающая курьера, должна удалять курьера после теста

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

на 9 строке функция удаляет курьера

Comment thread Tests/test_create_courier.py Outdated
courier = Courier.registration_courier()
courier_second = Courier.registration_courier_with_data(courier["data"])
assert courier_second["status_code"] == 409
assert "Этот логин уже используется" in courier_second["response_text"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно улучшить: здесь и далее тексты ответов лучше хранить в отдельном модуле для улчшей поддерживаемости

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_create_courier.py Outdated
def test_registration_courier_valid(self):
courier = Courier.registration_courier()
assert courier["status_code"] == 201
assert courier["response_text"] == '{"ok":true}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: здесь и далее проверь, что во всех тестах парсится ответ. Сравнение строк менее надёжно, чем парсинг JSON

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_create_order.py Outdated
data = Orderorder.data
data.update(color)
data = json.dumps(data)
response = requests.post(f'{Url.base_url}{Endpoints.create_order}', headers=headers, data=data)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: над каждым логическим методом (запрос через requests) должен стоять декоратор allure.step

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_login_courier.py Outdated
def test_courier_login_non_exist_fail(self):
response = requests.post(f'{Url.base_url}{Endpoints.login_courier}', data=LoginCourier.login_null)
assert response.status_code == 404
assert "Учетная запись не найдена" in response.text No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: нужно добавить сценарий авторизации с некорректными данными

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread datas.py Outdated
@staticmethod
def delete_courier(id):
response = requests.delete(f'{Url.base_url}{Endpoints.delete_courier}{id}')
return {"response_text": response.text, "status_code": response.status_code}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: логические методы должны быть в отдельном модуле

@sieagle sieagle Apr 20, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread helper.py
class Helper:
# функция для регистрации курьера с валидными рандомными данными
@staticmethod
def registration_courier():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: здесь и далее методы, выполняющие HTTP‑запросы, должны иметь декоратор @allure.step.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread conftest.py Outdated
def courier_delete():
courier_create = Helper.registration_courier()
courier_login = Helper.login_courier_and_get_id(courier_create["data"])
return courier_login No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: фикстура создаёт курьера, но не удаляет его после использования

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_list_orders.py Outdated
with allure.step("Отправить запрос на получение списка заказов"):
response = requests.get(f'{Url.base_url}{Endpoints.get_list_order}')
assert response.status_code == 200
assert "track" in response.text No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: нужно парсить ответ, т.е и спользовать response.json() и проверять наличие поля track

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_login_courier.py Outdated

@allure.title('Авторизация курьера с некорректными данными')
@allure.description('Отправить запрос на авторизацию пользователя с неверно заполненным обязательными полем и проверить ответ')
def test_courier_login_invalid_login_faled(self, courier):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: здесь и далее одинаковые названия методов делают код нечитаемым . Тесты могут не запускаться или перезаписывать друг друга.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Tests/test_create_order.py Outdated

@allure.title('Оформления заказа с разным набором цветов')
@allure.description('Отправить запрос на создание заказа с поочередным добавлением разных цветов и проверяем ответ')
@pytest.mark.parametrize('color', [{"color": ["BLACK"]}, {"color": ["GREY"]}, {"color": ["BLACK", "GRAY"]}, {"color": [""]}])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: еще разок проверь написание цветов. GREY и GRAY - это ошибка

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants