/
varon
/
testcase
Обзор
Документация
Войти
/
varon
/
testcase
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
submit/test_forgot_password.py
29 строк
894 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
Код
Авторство
О чём код?
import pytest from selenium.webdriver.common.by import By from conftest import BASE_URL class TestForgotPassword: @pytest.mark.parametrize("email,expect_submit", [ ("user@example.com", True), ("", False), ("notanemail", False), ("user@", False), ("@domain.com", False), ]) def test_email_validation(self, driver, email, expect_submit): driver.get(f"{BASE_URL}/forgot-password") email_input = driver.find_element(By.ID, "email") submit_btn = driver.find_element(By.XPATH, "//button[@type='submit']") email_input.clear() if email: email_input.send_keys(email) submit_btn.click() if expect_submit: alerts = driver.find_elements(By.CLASS_NAME, "alert") assert len(alerts) > 0 else: assert "forgot-password" in driver.current_url