Skip to content

Add Stellar Burgers API tests - #1

Open
supogolik-code wants to merge 2 commits into
mainfrom
develop2
Open

supogolik-code wants to merge 2 commits into
mainfrom
develop2

Conversation

@supogolik-code

Copy link
Copy Markdown
Owner

No description provided.


public class OrderClient extends BaseApiClient {

public Response getIngredients() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Для всех методов, описывающих шаги теста, необходимо использовать аннотацию @step

return name;
}

public Map<String, String> toRequestBody() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⛔️Нужно исправить.В теле передавать данные нужно через сериализацию. Это более продвинутый вариант, в теории он описан. Поправь, пожалуйста, этот момент во всем коде.

userClient = new UserClient();
}

@Test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️Можно улучшить. В allure есть аннотации для описания теста Description и DisplayName. Добавь их, пожалуйста, во всех тестах проекта

firstResponse.then().statusCode(200);

userClient.create(user).then()
.statusCode(403)

Copy link
Copy Markdown

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).

}

@Test
public void loginWithWrongCredentialsReturnsUnauthorized() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⛔️Нужно исправить. Должно быть два теста:

  1. Неверный логин
  2. Неверный пароль

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