Skip to content

Comments

task 6#2

Open
ShamilovR wants to merge 1 commit intomasterfrom
sprint-6
Open

task 6#2
ShamilovR wants to merge 1 commit intomasterfrom
sprint-6

Conversation

@ShamilovR
Copy link
Owner

No description provided.



class TestMainPage:
@allure.description('Проверяем, что при клике на вопрос ответ правильный')
Copy link
Owner Author

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее: для читаемого отображения отчетов над каждым тестом необходимо ставить декоратор title.

)
def test_questions_and_answers(self, driver, num, result):
main_page = MainPage(driver)
driver.get('https://qa-scooter.praktikum-services.ru/')
Copy link
Owner Author

Choose a reason for hiding this comment

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

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

def test_questions_and_answers(self, driver, num, result):
main_page = MainPage(driver)
driver.get('https://qa-scooter.praktikum-services.ru/')
main_page.click_to_element(MainPageLocators.COOKIE_LOCATOR)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Нужно исправить: здесь и далее: в классическом POM тест не должен знать о внутренней реализации, в том числе и о используемых локаторах (за исключением передачи локаторов в рамках параметризации). Подобная реализация должна быть сокрыта в рамках методов пейджи.

Comment on lines +48 to +50
handles = driver.window_handles
driver.switch_to.window(handles[1])
WebDriverWait(driver, 5).until(expected_conditions.visibility_of_element_located(HeaderLocators.
Copy link
Owner Author

Choose a reason for hiding this comment

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

Нужно исправить: в тестах и методах пейджей не должно быть обращений к драйверу и использований WebdriverWait. Все подобные реализации должны находиться в рамках базового класса пейджей.

order_page = OrderPage(driver)
driver.get('https://qa-scooter.praktikum-services.ru/')
main_page.click_to_element(MainPageLocators.UPPER_ORDER_BUTTON)
assert order_page.get_text_from_element(OrderPageLocators.ORDER_PAGE_HEADER_LOCATOR) == 'Для кого самокат'
Copy link
Owner Author

Choose a reason for hiding this comment

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

Можно лучше: здесь и далее: тестовые данные стоит хранить отдельно в data модуле, так поддерживать и переиспользовать будет проще

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.

1 participant