/
varon
/
testcase
Обзор
Документация
Войти
/
varon
/
testcase
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
submit/test_autocomplete.py
22 строки
847 B
varon
Create: .gitignore, CACHEDIR.TAG, README.md, nodeids, conftest.py, test_autocomplete.py, test_checkboxes.py, test_forgot_password.py, test_inputs.py, test_key_presses.py, test_login.py
15 июн 2026, 14:34
Верифицирован
15 июн 2026, 14:34
b72d575
Код
Авторство
О чём код?
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from conftest import BASE_URL class TestAutocomplete: def test_search_and_select_canada(self, driver): driver.get(f"{BASE_URL}/autocomplete") country_input = driver.find_element(By.ID, "country") country_input.clear() country_input.send_keys("Canada") suggestion = WebDriverWait(driver, 10).until( EC.element_to_be_clickable( (By.XPATH, "//div[@id='countryautocomplete-list']/div[contains(., 'Canada')]") ) ) suggestion.click() selected_value = country_input.get_attribute("value") assert "Canada" in selected_value, f"Expected 'Canada', got '{selected_value}'"