def test_login_with_wrong_password_five_times(sb, login, setup_user):
    ALERT_MESSAGE_LIST = [
        '用户名或密码有误,请重新输入,您还有 4 次机会', '用户名或密码有误,请重新输入,您还有 3 次机会',
        '用户名或密码有误,请重新输入,您还有 2 次机会', '用户名或密码有误,请重新输入,您还有 1 次机会',
        '多次输入密码有误,账户已被锁定,请联系IT部门'
    ]
    MenuBar.click_personal_info_menu_item(sb, '退出系统')
    for i in range(5):
        LoginPage.login(sb, setup_user['name'], '123456')
        sb.sleep(1)
        LoginPage.assert_alert_message(sb, ALERT_MESSAGE_LIST[i])
        sb.sleep(2)
def test_locked_account_login_in_thirty_minutes(sb, login, setup_user):
    MenuBar.click_personal_info_menu_item(sb, '退出系统')
    for i in range(6):
        LoginPage.login(sb, setup_user['name'], '123456')
        sb.sleep(1)
    LoginPage.assert_alert_message(sb, "多次输入密码有误,账户已被锁定,请联系IT部门")
def test_login_with_wrong_username(sb):
    LoginPage.login(sb, 'user_not_exist', '888888')
    LoginPage.assert_alert_message(sb, '用户名或密码错误,请重新输入')
def test_login_with_wrong_password(sb):
    LoginPage.login(sb, sb_config.username, '123456')
    LoginPage.assert_alert_message(sb, '用户名或密码有误,请重新输入,您还有 4 次机会')
def test_login_with_wrong_captcha(sb):
    LoginPage.login(sb, sb_config.username, sb_config.password, 'captcha')
    LoginPage.assert_alert_message(sb, '验证码错误')