from lib.login import *

class user_login_001:
    name = 'login_test_01'

    def teststeps(self):
        wd = GSTORE['wd']

        STEP(1, '用户登录')
        user_login("admin@pgy", "ub@123456", "csba")
#        run_login_tests()

        STEP(2, '验证是否登录成功')
        get_menu = WebDriverWait(wd, 10).until(
            EC.presence_of_element_located((By.CSS_SELECTOR, '.el-message__content'))
        )
        get_menu1 = get_menu.text
        CHECK_POINT('检查是否出现弹窗', get_menu1 == "操作成功!")
        def suite_teardown():
            wd.quit()


# class user_login_002:
#     name = 'login_test_02'
#
#     def teststeps(self):
#         STEP(1, '打开网页')
#
#         wd = GSTORE['wd']
#
#         STEP(2, '用户登录')
#         user_login("admin@pgy", "ub@123456", "csba")
# #        run_login_tests()
#
#         STEP(3, '验证是否登录成功')
#         get_menu = WebDriverWait(wd, 10).until(
#             EC.presence_of_element_located((By.CSS_SELECTOR, '.el-message__content'))
#         )
#         get_menu1 = get_menu.text
#         CHECK_POINT('检查是否出现弹窗', get_menu1 == "操作成功!")
#
#         STEP(4, '清除数据')
#
#         def suite_teardown():
#             INFO('进行清除操作')
#             wd.quit()
