Esempio n. 1
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")
Esempio n. 2
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)
Esempio n. 3
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")