Skip to content

Задание 2#695

Open
aoiaoki wants to merge 4 commits intoYandex-Practicum:mainfrom
aoiaoki:develop2
Open

Задание 2#695
aoiaoki wants to merge 4 commits intoYandex-Practicum:mainfrom
aoiaoki:develop2

Conversation

@aoiaoki
Copy link

@aoiaoki aoiaoki commented Feb 4, 2026

No description provided.

Choose a reason for hiding this comment

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

Необходимо исправить: эта директория лишняя в проекте. Необходимо убрать её из ветки и добавить в .gitignore в корне проекта

Choose a reason for hiding this comment

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

Необходимо исправить: эта директория лишняя в проекте. Необходимо убрать её из ветки и добавить в .gitignore в корне проекта



@allure.title("Создание заказа с авторизацией")
def test_create_order_with_auth():

Choose a reason for hiding this comment

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

Нужно исправить здесь и далее: Для корректного запуска тестов необходимо код с шагами теста поместить в тестовый метод (нейминг начинается с test_), а метод - в тестовый класс (нейминг начинается с Test). Необходимо привести к такому формату все модули внутри пакета tests

@allure.title("Создание заказа с авторизацией")
def test_create_order_with_auth():
user_data, _ = register_user()
login_response = login_user(user_data["email"], user_data["password"])

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: необходимо сделать allure-аннотации для каждого метода отправки запроса. При такой реализации подходит как контекст-менеджер with allure.step, так навесить декоратор на соответствующий метод отправки


@allure.title("Создание заказа с авторизацией")
def test_create_order_with_auth():
user_data, _ = register_user()

Choose a reason for hiding this comment

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

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

import allure
from data.user_data import get_valid_user

BASE_URL = "https://stellarburgers.education-services.ru"

Choose a reason for hiding this comment

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

Необходимо исправить: в модулях с тестами должны быть только тесты. Адрес можно вынести в отдельный модуль urls

response = requests.post(f"{BASE_URL}/api/auth/register", json=payload)

assert response.status_code == 200
assert response.json()["success"] is True

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: проверка success is True является хрупкой. Стоит проверять специфичный для конкретного ресурса атрибут в ответе



@allure.title("Создание пользователя без обязательного поля")
def test_create_user_without_required_field():

Choose a reason for hiding this comment

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

Необходимо исправить: проверяются не все обязательные поля

assert "accessToken" in response.json()


@allure.title("Логин с неверным логином и паролем")

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

Comments