示例#1
0
 def test_page_login_1(self):
     login = PageLogin(self.driver)
     login_user1 = login_data().get_login_data()
     num1 = login_user1[0]["编号"]
     username1 = login_user1[0]["用户名"]
     password1 = login_user1[0]["密码"]
     # print(type(password1))
     login.LoginOn(num1, username1, int(password1))
     time.sleep(2)
     self.assertEqual(login.Title(), "管理中心", msg="测试通过")
     login_result = login_data().write_result(1, "pass")
示例#2
0
 def test_page_login_6(self):
     login = PageLogin(self.driver)
     login_user1 = login_data().get_login_data()
     num1 = login_user1[0]["编号"]
     username1 = login_user1[0]["用户名"]
     password1 = login_user1[0]["密码"]
     login.LoginOn(num1, username1, int(password1))
     time.sleep(2)
     login.Back()
     time.sleep(2)
     self.assertEqual(
         login.Get_att(r'//input[@class="layui-input"]', 'value'), '007')
示例#3
0
 def test_page_login_5(self):
     login = PageLogin(self.driver)
     login_user1 = login_data().get_login_data()
     # login_result = login_data().write_result(5, "pass")
     num5 = login_user1[4]["编号"]
     username5 = login_user1[4]["用户名"]
     password5 = login_user1[4]["密码"]
     login.LoginOn(num5, username5, password5)
     time.sleep(2)
     login_result = login_data().write_result(5, "fail")
     self.assertEqual(login.Text_1(r'//div[@class="layui-layer-content"]'),
                      "账号或者密码错误! ",
                      msg="测试不通过")
     print("-" * 50)
示例#4
0
 def test_page_login_4(self):
     login = PageLogin(self.driver)
     login_user1 = login_data().get_login_data()
     # login_result = login_data().write_result(4, "pass")
     num4 = login_user1[3]["编号"]
     username4 = login_user1[3]["用户名"]
     password4 = login_user1[3]["密码"]
     login.LoginOn(num4, username4, password4)
     time.sleep(2)
     self.assertEqual(login.Text_1(r'//div[@class="layui-layer-content"]'),
                      "账号或者密码错误!",
                      msg="测试通过")
     # self.assertEqual(login.Title(),"管理中心",msg="不测试通过")
     login_result = login_data().write_result(4, "pass")
示例#5
0
 def test_page_login_2(self):
     login = PageLogin(self.driver)
     login_user1 = login_data().get_login_data()
     # login_result = login_data().write_result(2, "pass")
     num2 = login_user1[1]["编号"]
     username2 = login_user1[1]["用户名"]
     password2 = login_user1[1]["密码"]
     login.LoginOn(num2, username2, password2)
     time.sleep(2)
     self.assertEqual(login.Text_1(
         r'//div[@class="layui-layer-content layui-layer-padding"]'),
                      "必填项不能为空",
                      msg="测试通过")
     # self.assertEqual(login.Title(),"管理中心",msg="不测试通过")
     login_result = login_data().write_result(2, "pass")
示例#6
0
    def test_page_login_1(self):

        i = 1
        while i > 6:

            for j in range(0, 6):
                login = PageLogin(self.driver)
                login_user1 = login_data().get_login_data()
                num1 = login_user1[j]["编号"]
                username1 = login_user1[j]["用户名"]
                password1 = login_user1[j]["密码"]
                # print(type(password1))
                login.LoginOn(num1, username1, int(password1))
                time.sleep(2)
                self.assertEqual(login.Title(), "管理中心", msg="测试通过")

            i += 1
            print("testend......")