def test_logout_run(self):
     self.user_login_verify_run(username="******",
                                password="******")
     sleep(1)
     userver = UserVer(self.driver)
     userver.userLogout()
     sleep(1)
 def test_login_userNull_run(self):
     '''用户名为空,密码正确'''
     time.sleep(2)
     self.user_login_verify_run(username="", password="******")
     userver = UserVer(self.driver)
     self.assertEqual(userver.uname_error_remind(), "用户名不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "uname_empty.jpg")
 def test_login_pwdNull_run(self):
     '''用户名正确,密码为空登录'''
     time.sleep(2)
     self.user_login_verify_run('collegecheck.student2233', "")
     userver = UserVer(self.driver)
     self.assertEqual(userver.pwd_error_remind(), "密码不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "pwd_empty.jpg")
 def test_login_userpwdNull_run(self):
     '''用户名、密码为空登录'''
     time.sleep(2)
     self.user_login_verify_run("", "")
     userver = UserVer(self.driver)
     self.assertEqual(userver.uname_error_remind(), "用户名不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "user_pwd_empty.jpg")
 def test_login_success_run(self):
     '''用户名,密码正确'''
     self.user_login_verify_run(username="******", password="******")
     sleep(2)
     userver = UserVer(self.driver)
     self.assertEqual(userver.user_login_success_verify(),
                      "collegecheck服务站")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "user_login_ok.jpg")
 def test_login_error_run(self):
     '''用户名与密码不匹配'''
     time.sleep(2)
     character = random.choice('123456rtyhj')
     username = "******" + character
     self.user_login_verify_run(username, "f")
     po = UserVer(self.driver)
     self.assertEqual(po.pwd_error_remind(), "用户名或密码不正确!")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "uname_pwd_error.jpg")
 def test_login_success_run(self):
     '''用户名,密码正确'''
     self.user_login_verify_run(username="******",
                                password="******")
     sleep(2)
     userver = UserVer(self.driver)
     coo = userver.getLoginCookie()
     print(coo)
     self.assertEqual(userver.user_login_success_verify(),
                      "collegecheck.student2233")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "user_login_ok.jpg")
 def user_login_verify_run(self, username, password):
     '''
     用户登录用例运行
     :param username: 用户名
     :param password: 密码
     :return:
     '''
     #print ("获取当前句柄",self.driver.current_window_handle)
     UserVer(self.driver).userLogin(username, password)
Пример #9
0
 def autoLofin(self):
     u = UserVer(self.driver)
     homeurl = self.driver.current_url
     print("当前登陆地址" + homeurl)
     cookiestr = u.getLoginCookie()
     print(cookiestr)
     headers = {'cookie': cookiestr}
     req = urllib.request.Request(homeurl, headers=headers)
     try:
         response = urllib.request.urlopen(req)
         text = response.read()
         print("得到的结果信息", text)
         fd = open(
             'E:\\PyCharm_Workspace\\simily_bdcheck_student\\testData\\homepage.html',
             'wb')
         fd.write(text)
         fd.close()
         print('###get home page html success!!')
     except:
         print('### get home page html error!!')
Пример #10
0
 def user_login(self):
     '''用户登录'''
     user_login = UserVer(self.driver)
     user_login.userLogin(username="******",
                          password="******")
 def user_login(self):
     '''用户登录'''
     user_login = UserVer(self.driver)
     user_login.userLogin(username="******",password="******")
Пример #12
0
 def login(self):
     userver = UserVer(self.driver)
     userver.userLogin("collegecheck", "f")