Skip to content

Sprint_7 develop#1

Open
AngryNiko wants to merge 4 commits intomainfrom
develop
Open

Sprint_7 develop#1
AngryNiko wants to merge 4 commits intomainfrom
develop

Conversation

@AngryNiko
Copy link
Owner

No description provided.

.baseUri(BASE_URL)
.header("Content-type", "application/json")
.body(courier)
.post("/api/v1/courier");

Choose a reason for hiding this comment

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

⚠️Можно улучшить. Константы с указанием пути можно вынести в отдельный класс, так с ними будет удобнее работать. Назови его, например, Endpoints

@@ -0,0 +1,17 @@
package model;

public class Courier {

Choose a reason for hiding this comment

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

⚠️Можно улучшить. Можно использовать @DaTa и @AllArgsConstructor из библиотеки Lombok, для генерации кода

.statusCode(201)
.body("ok", equalTo(true));

courierId = courierSteps.getCourierId(courier);

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Получать токен нужно до выполнения проверок тест

Response response = courierSteps.createCourier(courier);

response.then()
.statusCode(409)

Choose a reason for hiding this comment

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

⚠️Можно улучшить. Вместо числовых кодов ответов, лучше использовать коды из библиотеки static org.apache.http.HttpStatus, так как они там строковые и несут смысл, что повышает читаемость и не надо вспоминать, что есть что. Пример кода, statusCode(SC_CREATED).


response.then()
.statusCode(400)
.body("message", equalTo("Недостаточно данных для создания учетной записи"));

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Нужно проверить создание курьера без пароля

this.color = color;
}

@Parameterized.Parameters

Choose a reason for hiding this comment

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

⚠️Можно улучшить. В параметризованных тестах для аннотации Parameterized.Parameters лучше использовать аргумент name: @Parameterized.Parameters(name = "Тестовые данные: {0} {1}"), где {0}, {1} - индексы параметров. Это повысит информативность проверки


@Test
public void createOrderTest() {
Order order = TestData.generateOrder(List.of("BLACK"));

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Здесь нужно использовать ТД

response.then()
.statusCode(201)
.body("track", notNullValue());
}

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Созданный заказ нужно отменить после выполнения теста

</annotationProcessorPaths>
</configuration>
</plugin>

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Нужно приложить папку allure-results

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