# author:qinguanglei
# ddate:2023/11/20 9:43
import allure
import pytest
from test_login.page_login import PageLogin
from test_login.steps_login import StepsLogin


@allure.feature('登录模块')
class TestLoginPasswordError(object):
    @pytest.fixture(scope='function', autouse=True)
    def housework(self, driver_fixture):
        # 驱动器从fixture传来
        self.driver = driver_fixture
        # 执行案例前统一获取页面元素操作方法
        self.page_login = PageLogin(self.driver)

    @allure.story('输入错误密码登录失败案例-点击登录')
    def test_login_password_error(self):
        # 载入步骤集合
        steps_login = StepsLogin(self.driver)
        # 打开浏览器
        steps_login.open_browser()
        # 输入账号密码,密码输入错误
        steps_login.enter_account_password(4)
        # 输入验证码,输入正确的验证码
        steps_login.enter_verify_code(0)
        # 点击登录
        steps_login.click_login_button()
        # 判断结果
        steps_login.judge_result_error(1)




