Skip to content

Добавлены автотесты и результаты allure#1

Open
Rimmarndkva wants to merge 3 commits intomainfrom
develop
Open

Добавлены автотесты и результаты allure#1
Rimmarndkva wants to merge 3 commits intomainfrom
develop

Conversation

@Rimmarndkva
Copy link
Owner

No description provided.

def test_transition_from_order_page_to_main_page(self, driver,):
switch_page = HeaderPageLocators(driver)
main_page = MainPage(driver)
driver.get(TestUrl.MAIN_URL)

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее драйвер не должен получаться в тестовом методе, а должен управляться через фикстуру.

Аналогично и с инициализацией страниц.

Нужно вынести driver.get() и инициализацию страниц в фикстуры для всех тестов

Choose a reason for hiding this comment

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

комментарий стоит поправить

from pages.page_baze import BasePage


class HeaderPageLocators(BasePage):

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее название вводит в заблуждение (это не локаторы, а страница)

switch_page = HeaderPageLocators(driver)
main_page = MainPage(driver)
driver.get(TestUrl.MAIN_URL)
main_page.accept_cookie()

Choose a reason for hiding this comment

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

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

rent_date = generate_date_rent()
self.add_text_to_element(OrderPageLocators.input_date_rent, rent_date)
from selenium.webdriver.common.keys import Keys
self.driver.find_element(*OrderPageLocators.input_date_rent).send_keys(Keys.ENTER)

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее вызов driver.find_element() минует методы BasePage. Методы Page object должны скрывать работу с driver за высокоуровневыми методами. Постарайся всегда использовать методы BasePage для работы с элементами

main_page = MainPage(driver)
driver.get(TestUrl.MAIN_URL)
main_page.accept_cookie()
assert main_page.check_answer_for_question(question_id) == expected_answer

Choose a reason for hiding this comment

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

Нужно исправить: запусти, пожалуйста, тест и посмотри не падает ли он

)
order_page.click_button_order_finall()
order_page.confirmation_order()
assert 'Заказ оформлен' in order_page.check_accept_order() 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.

Нужно исправить: запусти, пожалуйста, тест и посмотри не падает ли он

)
self.order_page.click_button_order_finall()
self.order_page.confirmation_order()
assert 'Заказ оформлен' in self.order_page.check_accept_order()

Choose a reason for hiding this comment

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

Нужно исправить: пожалуйста, запусти тест повторно. Он падает из-за из‑за таймаута при ожидании видимости элемента на странице оформления заказа, в частности посмотри порядок заполнения и локатор станции метро

Также это может быть связано с разными используемыми таймаута. Стоит проверить

self.fill_in_checkbox_colour(colour)
self.fill_in_comment_input(comment)

self.click_button_order_finall()

Choose a reason for hiding this comment

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

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

def test_transition_from_order_page_to_main_page(self, driver,):
switch_page = HeaderPageLocators(driver)
main_page = MainPage(driver)
driver.get(TestUrl.MAIN_URL)

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