Skip to content

Sprint 7: API tests and Allure report#1

Open
AGPerformance wants to merge 3 commits intomainfrom
develop
Open

Sprint 7: API tests and Allure report#1
AGPerformance wants to merge 3 commits intomainfrom
develop

Conversation

@AGPerformance
Copy link
Owner

Sprint 7: API tests and Allure report

conftest.py Outdated
if login_response.status_code == 200:
courier_id = login_response.json().get('id')
if courier_id:
CourierMethods.delete_courier(courier_id) No newline at end of file

Choose a reason for hiding this comment

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

Нужно исправить: фикстура принимает список created_credentials, но не добавляет в него данные из тестов. В результате курьеры не удаляются.

В тестах, где создаётся курьер без create_and_delete_courier, нужно явно добавлять данные в delete_courier.

Copy link
Owner Author

Choose a reason for hiding this comment

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

изменена фикстура. Теперь создание и удаление курьера полностью инкапсулировано в фикстурах через yield, тесты не управляют очисткой данных, и курьеры гарантированно удаляются после выполнения.

password = courier_data['password']

create_response = CourierMethods.create_courier(courier_data)
assert create_response.status_code == 201

Choose a reason for hiding this comment

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

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

Для тестов логина используется фикстура create_and_delete_courier, которая перед тестом создаёт нового уникального курьера через register_new_courier_and_return_login_password() (по заданию).

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