Skip to content

Sprint_6#1

Open
DimPonLe wants to merge 2 commits intomainfrom
develop
Open

Sprint_6#1
DimPonLe wants to merge 2 commits intomainfrom
develop

Conversation

@DimPonLe
Copy link
Owner

@DimPonLe DimPonLe commented Nov 3, 2025

No description provided.

Comment on lines 8 to 9
first_station_metro = [By.XPATH, ".//div[@class='select-search__select']/ul/li[1]"]
last_station_metro = [By.XPATH, ".//div[@class='select-search__select']/ul/li[last]"]

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: не стоит использовать в локаторах путь от рута, абсолютный путь или индексы элемента. Это делает локатор очень хрупким

Comment on lines 16 to 17
first_time_rent = [By.XPATH, ".//div[@class='Dropdown-option'][1]"]
last_time_rent = [By.XPATH, ".//div[@class='Dropdown-option'][7]"]

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: не стоит использовать в локаторах путь от рута, абсолютный путь или индексы элемента. Это делает локатор очень хрупким

@allure.step('Скролл до списка вопросов')
def scroll_question(self, index):
element = self.driver.find_element(*questions[index])
self.driver.execute_script("arguments[0].scrollIntoView();", element)

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: все вызовы к driver/WebDriverWait должны быть описаны в методах BasePage, а затем вызываться через эти методы в *Page-классах через наследование

Comment on lines 8 to 22
@allure.title('Проверка верхней кнопки "Заказать"')
@allure.description('На странице "Самокат" нажимаем на кнопку "Заказать", заполняем поля ввода и проверяем, что выпало окошко "Заказ оформлен" с двумя наборами данных')
@pytest.mark.parametrize("name,last_name,address,phone,comment,date", TEST_DATA)
def test_top_button_order_accepted_order(self, browser, name, last_name, address, phone, comment, date):
page = OrderPageScooter(browser)
text = page.order_scooter_on_last_station(name=name, last_name=last_name, address=address, phone=phone, comment=comment, date=date)
assert "Заказ оформлен" in text

@allure.title('Проверка нижней кнопки "Заказать"')
@allure.description('На странице "Самокат" нажимаем на кнопку "Заказать", заполняем поля ввода и проверяем, что выпало окошко "Заказ оформлен с двумя наборами данных"')
@pytest.mark.parametrize("name,last_name,address,phone,comment,date", TEST_DATA)
def test_lower_button_order_accepted_order(self, browser, name, last_name, address, phone, comment, date):
page = OrderPageScooter(browser)
text = page.order_scooter_on_first_station(name=name, last_name=last_name, address=address, phone=phone, comment=comment, date=date)
assert "Заказ оформлен" in text 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.

Можно лучше: шаги этих тестов схожи. Можно их объединить с помощью параметризации

def __init__(self, driver):
self.driver = driver

def find_element(self, locator):

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: не хватает аннотации allure для шага - allure.step

@allure.step('Клик на логотип "Самокат"')
def click_logo_scooter(self):
self.find_element(scooter_logo).click()
return self.driver.current_url

Choose a reason for hiding this comment

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

Необходимо исправить здесь и далее: все вызовы к driver/WebDriverWait должны быть описаны в методах BasePage, а затем вызываться через эти методы в *Page-классах через наследование

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

Comments